waic {loo}R Documentation

Widely applicable information criterion (WAIC)

Description

Widely applicable information criterion (WAIC)

Usage

waic(x, ...)

## S3 method for class 'matrix'
waic(x, ...)

## S3 method for class 'function'
waic(x, ..., args)

Arguments

x

A log-likelihood matrix or function. See the Methods (by class) section below for a detailed description.

...

Other arguments. Currently ignored.

args

Only required if x is a function. A list containing the data required to specify the arguments to the function. See the Methods (by class) section below for how args should be specified.

Value

A named list (of class 'loo') with components:

elpd_waic, se_elpd_waic

expected log pointwise predictive density and standard error

p_waic, se_p_waic

estimated effective number of parameters and standard error

waic, se_waic

-2 * elpd_waic (i.e., converted to the deviance scale) and standard error

pointwise

the pointwise contributions of each of the above measures

Methods (by class)

See Also

compare, print.loo, loo-package

Examples

## Not run: 
log_lik1 <- extract_log_lik(stanfit1)
log_lik2 <- extract_log_lik(stanfit2)
(waic1 <- waic(log_lik1))
(waic2 <- waic(log_lik2))
print(compare(waic1, waic2), digits = 2)

## End(Not run)


[Package loo version 1.1.0 Index]