API Reference#

Covariance matrix representations and priors for large scale inverse problems.

Abstract Covariance class#

The common interface CovarianceMatrix can be seen as a extension of the class scipy.stats.Covariance as it inherits from it (thus making it compatible with all scipy.stats functions and classes) and dope it with LinearOperator capabilities.

CovarianceMatrix(*args, **kwargs)

Abstract representation of a covariance matrix.

Full-rank covariance matrix decomposition#

Several full-rank representation of covariance matrices.

CovViaDiagonal(*args, **kwargs)

Representation of a covariance matrix via its diagonal.

CovViaCholesky(*args, **kwargs)

Representation of a covariance via a Cholesky factorization.

CovViaSparseCholesky(*args, **kwargs)

Representation of a covariance via a sparse Cholesky factorization.

CovViaPrecisionCholesky(*args, **kwargs)

Representation of a covariance via the Cholesky factorization of its inverse (aka the precision matrix).

CovViaSparsePrecisionCholesky(*args, **kwargs)

Representation of a covariance via the sparse Cholesky factorization of its sparse inverse (aka the precision matrix).

Low-rank approximations#

Several low-rank (approximate) representation of covariance matrices.

CovViaEigenFactorization(*args, **kwargs)

Representation of a covariance provided via eigenfactorization

CovViaEnsemble(*args, **kwargs)

Represents a covariance matrix as an ensemble of realizations.

Kernel based approximations#

Low-rank approximations from a given Kernel. Only provides the linear operations capabilities (no sampling not statistical calculations).

CovKernelAsLinop(*args, **kwargs)

Abstract class providing linear operator capability from a kernel definition.

CovKernelAsLinopViaFFT(*args, **kwargs)

Represents a fast fourier transform covariance matrix.

Matrix compression#

Allow to factorize CovarianceMatrix and CovKernelAsLinop using Eigen low-rank approximation.

get_linop_eigen_factorization(linop, size, n_pc)

Compute Eigenmodes of the covariance.

eigen_factorize_cov_mat(cov_mat, n_pc[, ...])

Return an eigen factorized covariance matrix from the input covariance matrix.

Sparse Helpers#

Helper to work with sparse matrices and covariances.

SparseCholeskyFactor(*args, **kwargs)

Sparse Cholesky factor of a matrix \(\mathbf{A}\).

Other utility functions#

To work with covariance matrices and low rank approximations.

get_explained_var(eigval[, cov_mat, ...])

Return the variance explained by each eigen value.

Test data#

Functions providing test data.

load_precision_example_4225x()

load_precision_example_4225x_SCF()

get_SPD_sparse_n11_example(seed)

Create a symmetric positive definite matrix of shape(11, 11).

get_SPD_sparse_example(n, seed[, diag_mean])

Create a symmetric positive definite matrix.