Learn R Programming

loo (version 0.1.2)

waic: Widely applicable information criterion (WAIC)

Description

Widely applicable information criterion (WAIC)

Usage

waic(log_lik)

Arguments

log_lik
an $S$ by $N$ matrix, where $S$ is the size of the posterior sample (the number of simulations) and $N$ is the number of data points. Typically (but not restricted to be) the object returned by extract_l

Value

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

    [object Object],[object Object],[object Object],[object Object]

See Also

compare, print.loo, loo-package

Examples

Run this code
log_lik1 <- extract_log_lik(stanfit1)
waic1 <- waic(log_lik1)
waic1

log_lik2 <- extract_log_lik(stanfit2)
waic2 <- waic(log_lik2)
print(waic2, digits = 4)

waic_diff <- compare(waic1, waic2)
print(waic_diff, digits = 2)

Run the code above in your browser using DataLab