Uncertainty Quantification
Theory
In general a model has parameters
and produces outputs
as a function of inputs
:
Observed data = (
,
) can be related to the model by adding mechanisms for discrepancies, for instance:
where the last term accounts for discrepancies between the model and the data, or
where we split the potential discrepancies into two sources: one internal to the model and the other external to the model. The first form will be called the classic uncertainty formulation and the second the embedded formulation.
The classic form has the benefit of simplicity, while the embedded form allows for the uncertainty to be ascribed to external, uncorrelated noise and variations that may have parametric trends.
The classic form is easily interpretable: are the uncertain best fit parameters and
are the discrepancies between the data and model that due to aleatoric (irreducible, stochastic) and epistemic (reducible with additional data) aspects of the data.
For this form, typically
will converge with increasing (self-consistent) data.
The embedded form is motivated by the fact that we usually have experimental data that displays (small) measurement noise and (larger) model inconsistencies which we associate with
.
Both
and
are considered random variables;
is an aleatoric (irreducible, stochastic) source of discrepancy and
is an epistemic (reducible with additional data) error.
The variable
is the mean of the random variable
and can be considered the best estimate of parameters
.
We associate
with uncorrelated measurement noise and
with parameter uncertainty due to limited data.
In the simplest case we assume that both
and
are normally distributed so we just need to determine their mean and variance.
In both cases, we make the common, simplifying assumption that the external noise is mean-zero, independent, identically distributed (IID) and normal or
,
is the variance of the measurement noise.
Furthermore we will take the hyperparameter
as known, either from prior knowledge of the testing machine or extracted from the high-frequency variation in the data
that is uncorrelated with its mean trends.
Uncertainty quantification
Bayes rule is a basis for determining the uncertainties in the parameters as reprsented by the random variables in the discrepancy terms:
where is the posterior distribution of the parameters,
is the parameter likelihood given the data,
is the prior distribution of the parameters, and the evidence
is a normalizing factor.
If both the likelihood and the prior are Gaussian then the posterior is also Gaussian. likewise for the likelihood being Gaussian and the prior being an improper uniform (i.e. a constant). With these assumption the parameter posterior is characterized by a mean and a variance. In general, obtaining the moments of the posterior in a Bayesian calibration is difficult because the model is non-linear in its parameters. Here we use an estimation method derived from the Hessian-based Laplace approximation.
Classic case
If we make the assumption that we have an uniformative prior and focus on the classic case, it sufficies to examine the likelihood:
since it is equal the posterior in this case; it is normal from the previous assumption:
The log likelihood:
has a term that is a variance-weighted mean squared error between the data and the model predictions plus a term that penalizes parameter complexity ( is the number of parameters) and variance.
Here
are the residuals.
The mean can be taken to be the maximum likelihood estimate which is determined by the optimum of the weighted mean squared error.
Laplace’s method approximates the log likelihood by a truncated Taylor series:
where the gradient is zero since is an optimum and
is the Hessian.
The gradient of the likelihood:
and the Hessian
involve the model sensitivities .
The last approximation is valid when the residuals are close to zero
.
Finally the Hessian can be used as the precision/inverse covariance matrix to obtain an approximate parameter posterior distribution:
Note the scaling of the covariance depends on the user provided .
Also an extension to a Gaussian prior is straightforward.
Embedded case
With the embedded case, for the random variable , we take its mean
to be the least squares solution
due to its connection with the maximum likelihood estimate.
To obtain the variance of
, we linearize the model
at the optimum , so that
Since we assume both and
are normal and independent, the variances are related by
due to the independence of the two Gaussian random variables and the linearity of the transform from the parameters to the observable output.
We can solve for the covariance of the parameters using linear algebra.
First, move the characterized measurement noise
then substitute Cholesky factorization of to obtain
Finally, use the singular value decomposition of so that
This provides a guess for the needed parameter convariance , given the assumptions, that is usually sufficient for uncertainty quantification, i.e. an ensemble of push-forwards of the parameter distribution through the model
that usually covers the calibration data.
To accommodate more of the potential deviations from the assumptions, we can take the linear algebra solution as a initial guess for the optimization of the log posterior
given .
This optimization minimizes the mean squared error (the second term) with respect to
, regularized by first term which penalizes overly broad uncertainty and complexity.
Here
is the number of realizations of the data.
Implementation
To estimate the variance of the measurement noise we typically make an empirical estimate (quick) or use a point-estimate/least-squares fit and calculate the variance of the residuals (better).
To form the parameter sensitivity Jacobian in the model linearization we use a finite difference stencil to evaluate the model with centered (accurate) or one-sided (cheap) differences
To keep the log posterior optimization well-conditioned we reparameterize the parameter covariance as
with the diagonal of the covariance matrix and the correlation
with off-diagonal components
, which is reparameterization as:
and
.