covmats.CovViaEnsemble#
- class covmats.CovViaEnsemble(*args, **kwargs)[source]#
Represents a covariance matrix as an ensemble of realizations.
For a given ensemble with shape (\(N_{s}\), \(N_{e}\)), the number of points and the number of members in the ensemble respectively, the covariance matrix \(\mathbf{\Sigma_{ss}}\) is approximated from the ensemble in the standard way of EnKF [Evensen, 2007, Aanonsen et al., 2009]:
\[\mathbf{\Sigma_{ss}} = \frac{1}{N_{e} - 1} \sum_{j=1}^{N_{e}}\left(s_{j} - \overline{s}\right)\left(s_{j} - \overline{s^{l}} \right)^{T}\]Or by defining a matrix of anomalies \(\mathbf{A} = \mathbf{S} - \overline{\mathbf{S}}\) with shape (\(N_{s}\), \(N_{e}\)):
\[\mathbf{\Sigma_{ss}} = \frac{1}{N_{e} - 1} \mathbf{A}^{T}\mathbf{A}\]Note
Practically, the dense covariance matrix is never built, only the anomalies matrix \(\mathbf{A}\) is used. The product between the inverse of the covariance matrix and a vector \(\mathbf{x} = \mathbf{\Sigma_{ss}}^{-1}\mathbf{b}\) is obtained solving the system \(\mathbf{A}^{T}\mathbf{Ax} = \mathbf{b}\), using gmres, where only anomalies matrix vector products are required.
References
Geir Evensen. Data Assimilation - The Ensemble Kalman Filter. Springer Berlin Heidelberg, 2007. ISBN 978-3-642-03710-8. doi:10.1007/978-3-642-03711-5.
Sigurd Aanonsen, Geir Nævdal, Dean Oliver, Albert Reynolds, and Brice Vallès. The Ensemble Kalman Filter in Reservoir Engineering–a Review. SPE Journal - SPE J, 14:393–412, September 2009. doi:10.2118/117274-PA.
- __init__(ensemble: ndarray[tuple[Any, ...], dtype[float64]]) None[source]#
Initiate the instance.
- Parameters:
ensemble (NDArrayFloat) – Ensemble of realization with shape (\(N_{e}\), \(N_{s}\)).
Properties
Hermitian adjoint.
Transpose this linear operator.
Return the matrix of anomalies.
Explicit dense representation of the covariance matrix.
Log of the pseudo-determinant of the covariance matrix.
Return the number of members in the ensemble.
Number of points in the domain (n).
Explicit dense representation of the precision matrix with shape (n, n).
Rank of the covariance matrix.
Shape of the covariance matrix (n, n).
Subspace size of the covariance matrix.
Methods
Hermitian adjoint.
Perform a colorizing transformation on data.
Matrix-matrix or matrix-vector multiplication.
Representation of a covariance provided via choleksy factorization.
Representation of a covariance provided via diagonal.
Representation of a covariance provided via eigendecomposition.
Return a representation of a covariance from its precision matrix.
Return the diagonal entries of the matrix (variances).
Return the trace of the covariance matrix (sum of diagonal elements).
Matrix-matrix multiplication.
Matrix-vector multiplication.
Adjoint matrix-matrix multiplication.
Adjoint matrix-vector multiplication.
Draw samples from the multivariate normal N(0, A).
Solve A^{T}Ax = b, with A, the anomalies matrix instance.
Explicit dense representation of the covariance matrix with shape (n, n).
Transpose this linear operator.
Perform a whitening transformation on data.