fips.covariance.KroneckerError#

class fips.covariance.KroneckerError(name, variances, marginal_kernels)[source]#

Bases: ErrorComponent

Builds a full covariance matrix for a strict grid.

Uses Kronecker products of N arbitrary marginal correlation matrices.

Parameters:
  • name (str) – Name of the error component.

  • variances (float or pd.Series) – Variances for the diagonal of the covariance matrix. Can be a single float or a Series indexed by the same MultiIndex as the covariance matrix.

  • marginal_kernels (list of tuples) –

    Each tuple contains:

    1. The dimension name(s) as a string or list of strings.

    2. The Callable kernel function that takes a DataFrame of those unique coordinates and returns a 2D correlation matrix.

Note

ORDER MATTERS: These must be provided in the exact order that the dimensions appear in the matrix’s MultiIndex!

Attributes

marginal_kernels

List of marginal kernels, each defined by a tuple of dimension name(s) and a kernel function.

Methods

build(index, **kwargs)

Build covariance matrix using product of marginal kernels.

Inherited

From ErrorComponent: name, variances