traces: Generation of trace plots of the samples

View source: R/PMXStanFit.R

tracesR Documentation

Generation of trace plots of the samples

Description

Plots traces of samples corresponding to one or more Markov chains during the sampling procedure with Stan. This is a generic version of the method plot.trace() for the PMXStanFit class.

Usage

traces(fit, pars = NULL)

Arguments

fit

a PMXStanFit object.

pars

specifies names of parameters whose traces will be plotted. When it is not specified, the function by default plots all the theta's (model parameters), sigma_eta's (variance of the inter-individual random effects), and sigma (variance of the intra-individual random effects) in the auto-generated Stan code.

Value

No return value, called for side effects

See Also

PMXStanFit for the method plot.trace(); traceplot for a similar implementation of plotting traces in rstan.

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$plot.trace()
traces(fit)

fit$plot.trace(pars = c("CL", "V", "sigma"))
traces(fit, pars = c("CL", "V", "sigma"))


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

Related to traces in stanette...