waic.angmcmc {BAMBI} | R Documentation |
Watanabe-Akaike Information Criterion (WAIC) for angmcmc objects
Description
Watanabe-Akaike Information Criterion (WAIC) for angmcmc objects
Usage
## S3 method for class 'angmcmc'
waic(x, ...)
Arguments
x |
angmcmc object. |
... |
additional model specific arguments to be passed to waic from loo. For example, |
Details
Given a deviance function , and an estimate
of the posterior mean
, where
denote the data,
is the unknown
parameter vector of the model,
are MCMC samples from the posterior
distribution of
given
and
is the likelihood function,
the Watanabe-Akaike Information Criterion (WAIC) is defined as
where
and (form 1 of)
An alternative form (form 2) for is given by
where for ,
denotes the estimated variance
of
based on the realizations
.
Note that waic.angmcmc calls waic for computation. If the likelihood contribution of each data
point for each MCMC iteration is available in object
(can be returned by setting return_llik_contri = TRUE
)
during fit_angmix call), waic.array
is used; otherwise waic.function
is
called. Computation is much faster if the likelihood contributions are available - however, they are very
memory intensive, and by default not returned in fit_angmix.
Value
Computes the WAIC for a given angmcmc object.
Examples
# illustration only - more iterations needed for convergence
fit.vmsin.20 <- fit_vmsinmix(tim8, ncomp = 3, n.iter = 20,
n.chains = 1, return_llik_contri = TRUE)
library(loo)
waic(fit.vmsin.20)