covmats.CovarianceMatrix#
- class covmats.CovarianceMatrix(*args, **kwargs)[source]#
Abstract representation of a covariance matrix.
Calculations involving covariance matrices (e.g. data whitening, multivariate normal function evaluation) are often performed more efficiently using a decomposition of the covariance matrix instead of the covariance matrix itself. This class allows the user to construct an object representing a covariance matrix using any of several decompositions and perform calculations using a common interface.
Note
The CovarianceMatrix class cannot be instantiated directly. Instead, use one of the derived class:
Notes
None of the
Covariancechild implementation supports singular or indefinite covariance matrices. Otherwise, they would not be invertible, colorizing and whitening would not well defined.Properties
Hermitian adjoint.
Transpose this linear operator.
Explicit dense representation of the covariance matrix.
Log of the pseudo-determinant of the covariance matrix.
Number of points in the domain (n).
Explicit dense representation of the precision matrix with shape (n, n).
Rank of the covariance matrix.
Shape of the covariance matrix (n, n).
Subspace size of the covariance matrix.
Methods
Hermitian adjoint.
Perform a colorizing transformation on data.
Matrix-matrix or matrix-vector multiplication.
Representation of a covariance provided via choleksy factorization.
Representation of a covariance provided via diagonal.
Representation of a covariance provided via eigendecomposition.
Return a representation of a covariance from its precision matrix.
Return the diagonal entries of the matrix (variances) as a vector (n,).
Return the trace of the covariance matrix (sum of diagonal elements).
Matrix-matrix multiplication.
Matrix-vector multiplication.
Adjoint matrix-matrix multiplication.
Adjoint matrix-vector multiplication.
Draw samples from the multivariate normal N(0, A).
Solve Ax = b, with A, the current covariance matrix instance.
Explicit dense representation of the covariance matrix with shape (n, n).
Transpose this linear operator.
Perform a whitening transformation on data.