stats.inla {INLAspacetime} | R Documentation |
To retrieve goodness of fit statistics for a specific model class.
Description
Extracts dic, waic and log-cpo from an output returned by the inla function from the INLA package or by the bru function from the inlabru package, and computes log-po, mse, mae, crps and scrps for a given input. A summary is applied considering the user imputed function, which by default is the mean.
Usage
stats.inla(m, i = NULL, y, fsummarize = mean)
Arguments
m |
an inla output object. |
i |
an index to subset the estimated values. |
y |
observed to compare against. |
fsummarize |
the summary function,
the default is |
Value
A named numeric vector with the extracted statistics.
Details
It assumes Gaussian posterior predictive distributions!
Considering the defaults, for n observations,
, we have
. dic
where is the dic computed for observation i.
. waic
where is the waic computed for observation i.
. lcpo
where is the cpo computed for observation i.
For the log-po, crps, and scrps scores it assumes a
Gaussian predictive distribution for each observation
which the following definitions:
,
is the posterior mean for the linear predictor,
,
is the observation posterior mean,
is the posterior variance of the
linear predictor for
.
Then we consider the density of a standard
Gaussian variable and
the corresponding
Cumulative Probability Distribution.
. lpo
. crps
where
. scrps
where
Warning
All the scores are negatively oriented which means that smaller scores are better.
References
Held, L. and Schrödle, B. and Rue, H. (2009). Posterior and Cross-validatory Predictive Checks: A Comparison of MCMC and INLA. Statistical Modelling and Regression Structures pp 91–110. https://link.springer.com/chapter/10.1007/978-3-7908-2413-1_6.
Bolin, D. and Wallin, J. (2022) Local scale invariance and robustness of proper scoring rules. Statistical Science. doi:10.1214/22-STS864.