waic: Diagnostics for a fitted Bayesian model

View source: R/PMXStanFit.R

waicR Documentation

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


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)


stanette documentation built on May 11, 2022, 5:11 p.m.

Related to waic in stanette...