Learn R Programming

stanette (version 2.21.4)

waic: Diagnostics for a fitted Bayesian model

Description

Calculates diagnostic statistics for a fitted Bayesian model: Watanabe-Akaike information criterion (WAIC) and Leave-on-out cross-validation (LOO-CV). This is a generic version of the method get.waic() for the PMXStanFit class.

Usage

waic(fit, complete = FALSE)

Arguments

fit

a PMXStanFit object.

complete

a logical to select whether to input all pointwise and total statistics (TRUE) or only total statistics (FALSE, by default).

Value

No return value, called for side effects

See Also

PMXStanFit for the method get.waic(), and related references.

Examples

Run this code
# NOT RUN {
m1 <- PMXStanModel(path = tempfile("pk_m1"), pk.struct = "1-cmpt", compile=TRUE)

data("examples_data")
dat <- prepareInputData(data.source = d1_nm_poppk, model = m1)
fit <- PMXStanFit(m1, dat, iter=100, chains=1)

fit$get.waic()
waic(fit, complete = TRUE)
# }

Run the code above in your browser using DataLab