Path: blob/devel/elmerice/Solvers/Documentation/CovarianceUtilsModule.md
3206 views
Covariance Utils Module {#Covariance_Module}
General Information
Fortran Module File: CovarianceUtils.F90
Remark
This documentation contains equations and is part of a generic documentation that can be converted to pdf using pandoc:
General Description
The CovarianceUtils modules contains routines and functions for the generic operations involving a covariance matrix . In all the implementation we use the following standard factorisations: where:
is a correlation matrix ,
is a diagonal standard deviation matrix.
This module is used in the following solvers:
Diffusion operator
The implementation follows Guillet et al. (2019). See Recinos et al. (2023) and Bulthuis and Larour (2022) for similar methods in the context of ice flow modeling.
The motivation of the method is that is a full-rank matrix of size , with n the number of mesh nodes, so that in general for large problem directly building becomes impossible.
Guillet et al. (2019) show that applying successive applications of a discretized representation of the operator is equivalent to applying an inverse correlation operator which as a kernel given by the following Matérn functions: where:
is the modified Bessel function of the second kind of order ,
is the euclidean distance between 2 points,
is a correlation lenght scale (or range),
is a smoothness parameter that control the shape of the function.
Remarks:
In the literature, the Matérn functions are often defined with the smoothness parameter which can be a real; Here we are restricted to integers an .
The Matérn functions have two limit cases, the exponential correlation function for and the squared exponential (or gaussian) correlation function for .
The Gaussian limit can be approached by setting the range to the Dayley length scale (Guillet et al. (2019) Eq. 7):
For the following, we define the following the mass matrix and stiffness matrix discretized by the FEM:
The BackgroundErrorCostSolver requires the inverse correlation matrix which is discretized as: with:
is a normalization matrix
The CovarianceVectorMultiplySolver requires the correlation matrix which is discretized as: with:
The GaussianSimulationSolver requires a square root of which is obtained from the following factorisation: with: where:
to compute we take the lumped mass matrix,
, so restricting the application to even values of
Remark: This discretization implies Neumann boundary conditions and it is known that it is inaccurate near the boundaries; cf sec. 3.6 and 5.4 in Guillet et al. (2019).
Keywords related to this method:
the method is chosen with the keyword Covariance type = String "diffusion operator"
the correlation length scale is assumed uniform and given by the keyword correlation range = Real
the smoothness parameter is given by the keyword Matern exponent m = Integer ( for all solvers and m must be even for the GaussianSimulationSolver)
the standard deviation to build is assumed uniform and given by the keyword standard deviation = Real
Limitations:
can be used in serial/parallel.
as only be tested on 2D meshes or on a 2D boundary of a 3D mesh. In the latter case projection coordinate=Integer sets the corresponding coordinates to 0, so that the operations are performed in the projected plane; e.g. if projection coordinate= Integer 3, the z- coordinates are set to 0 to compute the mass and stiffness matrices
sif example:
Full matrix
This has been implement mainly for testing/validation on small serial test cases. Here the we build the matrix using standard analytical correlation functions.
Operations on are performed using standard Lapack linear algebra routines:
For the GaussianSimulationSolver with use a Cholesky decomposition using the Lapack routine dpptrf
For the BackgroundErrorCostSolver, the inverse is obtained using the lapack routine dpptri after the Cholesky factorisation.
The following correlation functions have been implemented:
the exponential:
the Gaussian correlation function:
the Matérn function for integer values of (materni):
Analytical power solution of the Matérn function when is half integer so that is an integer (maternp) (rq. p=0 is the exponential):
p=1
p=2
Remark for MaternI the Bessel function is obtained by recursion and accuracy for high values of () has not been tested.
Keywords related to this method:
the method is chosen with the keyword Covariance type = String "full matrix"
the correlation length scale is assumed uniform and given by the keyword correlation range = Real
The correlation function is given by the keyword correlation type = String; possible choices are:
For materni the integer value of is given by MaternI order = Integer
For maternp the integer value of is given by MaternP order = Integer (restricted to 1 and 2)
Limitations:
can only be used in serial.
restricted to relatively small problems
Can be used as a boundary solver; in this case if the mesh is 3D, only the and coordinates are used to compute the euclidean distance.
sif example:
Diagonal
This is the simple choice, there is no spatial correlation and the covariance matrix is simply
Keywords related to this method:
the method is chosen with the keyword Covariance type = String "diagonal"
Module functions and subroutines
Generic routines for the initialisation of the matrices (D referring to the diffusion operator and L to the full matrix):
Generic routines to perform covariance matrix vector multiplications:
Generic routines to perform inverse covariance matrix vector multiplications:
Generic routines to perform square-root covariance matrix vector multiplications:
Functions related to the computation of the analytical correlation functions.
Examples
ElmerIce unitary tests:
[ELMER_TRUNK]/elmerice/Tests/CovarianceVector
[ELMER_TRUNK]/elmerice/Tests/CovarianceVector2
Validation test cases and set-ups:
References
Recinos, B., Goldberg, D., Maddison, J. R., and Todd, J.: A framework for time-dependent ice sheet uncertainty quantification, applied to three West Antarctic ice streams, The Cryosphere, 17, https://doi.org/10.5194/tc-17-4241-2023, 2023.
Bulthuis, K. and Larour, E.: Implementation of a Gaussian Markov random field sampler for forward uncertainty quantification in the Ice-sheet and Sea-level System Model v4.19, Geosci. Model Dev., 15, 1195–1217, https://doi.org/10.5194/gmd-15-1195-2022, 2022
Guillet O., Weaver A.T., Vasseur X., Michel Y., Gratton S., Gurol S. Modelling spatially correlated observation errors in variational data assimilation using a diffusion operator on an unstructured mesh. Q. J. R. Meteorol. Soc., 2019. https://doi.org/10.1002/qj.3537