White noise generators and AR covariance operators#4716
Merged
JHopeCollins merged 35 commits intomainfrom Feb 5, 2026
Merged
Conversation
Co-authored-by: Jack Betteridge <j.betteridge@imperial.ac.uk>
Contributor
|
|
Member
Author
Of course, you can just grab the local part of the matrix because it's block diagonal so you don't actually need a parallel Cholesky factor. I've added that PR to the Firedrake meeting agenda this afternoon. |
JHopeCollins
commented
Dec 8, 2025
…iredrakeproject/firedrake into JHopeCollins/moar-covariance-operators
dham
previously requested changes
Dec 9, 2025
JHopeCollins
commented
Jan 30, 2026
Member
Author
|
@pbrubeck the only outstanding comments were to add an MMS test for the diffusion forms, which I've done here: https://github.com/firedrakeproject/firedrake/pull/4716/changes#diff-2327a64dc67ea8e9dd667c73fc315e5ca301b26fa9fcdaa08de4c6e94200fdb4R364 |
pbrubeck
reviewed
Feb 5, 2026
pbrubeck
reviewed
Feb 5, 2026
pbrubeck
reviewed
Feb 5, 2026
pbrubeck
approved these changes
Feb 5, 2026
Contributor
pbrubeck
left a comment
There was a problem hiding this comment.
I'm not familiar with the maths, but this looks good in general.
Member
Author
|
Only failures are unrelated timeouts. |
j-bowhay
pushed a commit
to j-bowhay/firedrake
that referenced
this pull request
Feb 24, 2026
…4716) * White noise generators and AR covariance operators --------- Co-authored-by: Jack Betteridge <j.betteridge@imperial.ac.uk>
connorjward
pushed a commit
that referenced
this pull request
Mar 3, 2026
* White noise generators and AR covariance operators --------- Co-authored-by: Jack Betteridge <j.betteridge@imperial.ac.uk>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #4773 and firedrakeproject/fiat#201.
White and correlated noise generation from #3799, plus extra methods to calculate action and inverse of autoregressive covariance operators and use it for a weighted norm.
White noise generation
See Croci et al 2018.
White noise samples calculating$M^{1/2}z$ where $z_{i}\sim\mathcal{N}(0, I)$ and $M$ is the mass matrix.
$M^{1/2}$ can be constructed by assembling the Cholesky factor of the element-wise mass matrices.
There are two implementations of this:
L2Choleskyclass from Mesh independent optimization trick #4575. There is also a specialisation of this method forVertexOnlyMesh.Autoregressive covariance operator
See Mirouze & Weaver, 2010
A covariance operator$B$ with an
m-th autoregressive function kernel can be calculated usingmBackward Euler steps of a diffusion operator, where the diffusion coefficient is specified by the correlation lengthscale.If$M$ is the mass matrix, $K$ is the matrix for a single Backward Euler step, and $\lambda$ is a normalisation factor, then the m-th order covariance operator with variance $\sigma^2$ is:
This formulation leads to an efficient implementation for$B^{-1}$ (using the action of $K$ ) and for $B^{1/2}$ by taking only m/2 steps of the diffusion operator. This can be used to calculate weighted norms $||x||_{B^{-1}}$ and sample from $\mathcal{N}(0,B)$ .
The
CovarianceOperatorBaseclass provides an abstract interface for other covariance operators, which must implement:sampleto returnapply_action(x)to applyapply_inverse(x)to applynorm(x)to returnPETSc python contexts
If you use the weighted norm$||x||_{B^{-1}}$ in the functional for an adjoint calculation, then often $B$ is a good preconditioner for the 2nd order Hessian. This PR provides a python Mat context and corresponding python PC context for children of
CovarianceOperatorBase.