covmats.CovKernelAsLinopViaFFT#

class covmats.CovKernelAsLinopViaFFT(*args, **kwargs)[source]#

Represents a fast fourier transform covariance matrix.

FFT based operations if kernel is stationary or translation invariant and points are on a regular grid.

Notes

This FFT-based code is a reimplementation of Arvind Saibaba’s work (https://github.com/arvindks/kle).

TODO: add references.

__init__(kernel, mesh_dim: float | ndarray[tuple[Any, ...], dtype[float64]] | Sequence[float], domain_shape: int | ndarray[tuple[Any, ...], dtype[int64]] | Sequence[int], len_scale: ndarray[tuple[Any, ...], dtype[float64]], nugget: float = 0.0, k: int = 100, is_use_preconditioner: bool = False) None[source]#

Initialize the instance.

Parameters:
  • kernel (_type_) – _description_

  • mesh_dim (Union[NDArrayInt, Tuple[float, float]]) – _description_

  • domain_shape (Union[NDArrayInt, Tuple[int, int]]) – _description_

  • len_scale (NDArrayFloat) – _description_

  • nugget (float, optional) – _description_, by default 0.0

  • k (int, optional) – Number of local centers in the preconditioner. Controls the sparity of the preconditioner. It should be inferior to the number of points. By default 100.

  • is_use_preconditioner (bool) – Whether to build the preconditioner at instance creation and use it to solve Ax = b systems. The default is False.

Properties

H

Hermitian adjoint.

T

Transpose this linear operator.

count

n_pts

Return the number of points covered.

ndim

solvematvecs

Methods

adjoint

Hermitian adjoint.

dot

Matrix-matrix or matrix-vector multiplication.

get_diagonal

Return the diagonal entries of the matrix (variances).

itercount

Return the number of counts.

matmat

Matrix-matrix multiplication.

matvec

Matrix-vector multiplication.

reset_comptors

Set the comptors to zero.

rmatmat

Adjoint matrix-matrix multiplication.

rmatvec

Adjoint matrix-vector multiplication.

solve

Solve Ax = b, with A, the current covariance matrix instance.

todense

Explicit dense representation of the covariance matrix.

transpose

Transpose this linear operator.