adelie.matrix.lazy_cov#

adelie.matrix.lazy_cov(mat: ndarray, *, copy: bool = False, n_threads: int = 1)[source]#

Creates a lazy covariance matrix.

The lazy covariance matrix \(A\) uses the underlying matrix \(X\) given by mat to compute the values of \(A = X^\top X\) dynamically. It only computes rows of \(A\) on-the-fly that are needed when calling its member functions. This is useful in adelie.solver.gaussian_cov() where the covariance method must be used but the dimensions of \(A\) are too large to construct the entire matrix as a dense matrix.

Note

This matrix only works for covariance method!

Parameters:
mat(n, p) ndarray

The data matrix from which to lazily compute the covariance.

copybool, optional

If True, a copy of mat is stored internally. Otherwise, a reference is stored instead. Default is False.

n_threadsint, optional

Number of threads. Default is 1.

Returns:
wrap

Wrapper matrix object.