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:
Prediction transformation calculates the concatenated prediction based on several input predictions.
Covbase transformation calculates the predefined part of the block covariance matrix based on input covaraince matrices given as is.
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¶
Input vector \(m_1\).
Optional input vector \(m_2\).
etc.
Vectors \(m_i\) are added via append(obs)
method.
Outputs¶
'prediction.prediction'
— Prediction vector \(\mu\).
Implementation¶
Calculates \(\mu\) as a concatination product of vectors \(m_i\):
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¶
Covariance matrix. Options:
covariance matrix \(V_i\) for model \(m_i\).
cross covariance matrix \(V_{ij}\) for models \(m_i\) \(m_j\).
etc.
Inputs are assigned via covariate(cov, obs1, n1, obs2, n2)
method.
Outputs¶
'covbase.covbase'
— basic covariance matrix with optional pull-terms.
Implementation¶
Calculates \(V_\text{base}\) as a block matrix:
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¶
'cov.covbase'
— Base covariance matrix \(V_\text{base}\).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¶
'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:
where \(J\) is the complete Jacobian:
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\):
Returns the Cholesky decomposition \(L\) of \(V\).