Learn R Programming

psychtm (version 2021.1.0)

waic_all: Compute WAIC for all outcomes.

Description

Compute WAIC for all outcomes.

Usage

waic_all(iter, l_pred)

Arguments

iter

The length of the sampled chain.

l_pred

A iter x D matrix of predictive likelihoods (NOT log-likelihoods).

Value

Vector of (1) WAIC for model, (2) standard error for WAIC, and (3) the effective number of parameters.

Examples

Run this code
# NOT RUN {
data(teacher_rate)
fit_mlr <- gibbs_mlr(rating ~ grade, data = teacher_rate, m = 5)
waic_all(iter = 5, t(lpd(fit_mlr)))
# }

Run the code above in your browser using DataLab