CovariatedPrediction

Description

CovariatedPrediction class contains three distinct trasformations used to calculate the compound prediction and the full covariance matrix for it. The trasformations are the following:

  1. Prediction transformation calculates the concatenated prediction based on several input predictions.

  2. Covbase transformation calculates the predefined part of the block covariance matrix based on input covaraince matrices given as is.

  3. Cov transformation calculates the extra systematic part of the covariance matrix based on the known parameters uncertainties.

The result is not the covariance matrix \(V\) it self, but it’s Cholesky decomposition \(L\) as needed by the Chi2 transformation.

Prediction transformation

Description

Calculate compound prediction vector \(\mu\) by concatenating individual predictions \(m_i\).

Inputs

  1. Input vector \(m_1\).

  2. Optional input vector \(m_2\).

  3. etc.

Vectors \(m_i\) are added via append(obs) method.

Outputs

  1. 'prediction.prediction' — Prediction vector \(\mu\).

Implementation

Calculates \(\mu\) as a concatination product of vectors \(m_i\):

\[\mu = \{m_1, m_2, \dots\}.\]

Covbase transformation

Description

Calculate compound covariance matrix based on statistical uncertainties (diagonal) , optional covariation matrices for each prediction \(m_i\) and between predictions \(m_i\) and \(m_j\). The pull terms are included here.

This is the constant predefined covariance matrix part: the base.

Inputs

  1. Covariance matrix. Options:

    1. covariance matrix \(V_i\) for model \(m_i\).

    2. cross covariance matrix \(V_{ij}\) for models \(m_i\) \(m_j\).

  2. etc.

Inputs are assigned via covariate(cov, obs1, n1, obs2, n2) method.

Outputs

  1. 'covbase.covbase' — basic covariance matrix with optional pull-terms.

Implementation

Calculates \(V_\text{base}\) as a block matrix:

\[\begin{split}V_\text{base} = \begin{pmatrix} V_1 & V_{12} & \dots \\ V_{12}^T & V_{2} & \dots \\ \dots & \dots & \dots \end{pmatrix}.\end{split}\]

Returns constructed covariance matrix. .. Returns the Cholesky decomposition \(L_\text{base}\).

Cov transformation

Description

Calculate the final covariance matrix based on:
  • predefined covariance base.

  • extra (optional) systematical part based on the variation of the prediction \(\mu\) due to variation of the systematical parameters \(\eta\).

Inputs

  1. 'cov.covbase' — Base covariance matrix \(V_\text{base}\).

  2. Optional systematical covariance matrix due to propagation of uncertain parameters.

See Jacobian, ParMatrix and MatrixProduct transformations. Parameters \(\eta_i\) are meant to be uncorrelated.

Outputs

  1. 'cov.L' — full covariance matrix Cholesky decomposition \(L\): \(V=LL^T\).

IMPORTANT: Be sure to use \(L\) as lower triangular matrix (use numpy.tril or triangularView<Eigen::Lower>). Upper triangular part may contain unmaintained non-zero elements.

Implementation

Calculates covariance matrix \(V\) in the linear approximation:

\[V = V_\text{base} + J V_{sys} J^T,\]

where \(J\) is the complete Jacobian:

\[J = \{ J_1, J_2, \dots \}.\]

Considering prediction column of size \([N \times 1]\) and uncertainties vector of size \(M\) the Jacobian \(J\) dimension is \([N \times M]\) and covariance matrix \(V\) dimension is \([N \times N]\).

Then the Cholesky decomposition is applied to the full covaraince matrix \(V\):

\[V = LL^T\]

Returns the Cholesky decomposition \(L\) of \(V\).