anees¶
-
probnumeval.timeseries.
anees
(approximate_solution, reference_solution, locations)[source]¶ Compute the average normalised estimation error squared.
Also known as chi-squared statistic. It computes
\[\chi^2 := \frac{1}{N + 1} \sum_{n=0}^N (y^*(t_n) - \mathbb{E}[y(t_n)])^\top \mathbb{C}[y(t_n)]^{-1} (y^*(t_n) - \mathbb{E}[y(t_n)])\]where \(\mathbb{E}\) is the mean and \(\mathbb{C}\) is the covariance. If \(y\) is a Gaussian process, \(\chi^2\) follows a chi-squared distribution. For a \(d\) dimensional solution, the outcome is
Underconfident if \(\chi^2 < d\) holds. The estimated error is way larger than the actual error.
Overconfident if \(\chi^2 > d\) holds. The estimated error is way smaller than the actual error.
- Parameters
approximate_solution (
TimeSeriesPosterior
) – Approximate solution as returned by a Kalman filter or ODE solver. This must be a FiltSmoothPosterior.reference_solution (
Callable
[[ndarray
],ndarray
]) – Reference solution. (This is not assumed to be a TimeSeriesPosterior, because ideally this is the true solution of a problem; often, it is a reference solution computed with a non-probabilistic algorithm.)locations (
ndarray
) – Set of locations on which to evaluate the statistic.
- Returns
- Return type
ANEES statistic (i.e. \(\chi^2\) above).
See also
chi2_confidence_intervals()
Confidence intervals for the ANEES test statistic.
nci()
An alternative calibration measure.