This is a wrapper function for
jags.samples which sets a trace
monitor for all requested nodes, updates the model, and coerces the
output to a single
coda.samples(model, variable.names, n.iter, thin = 1, na.rm=TRUE, ...)
a jags model object
a character vector giving the names of variables to be monitored
number of iterations to monitor
thinning interval for monitors
logical flag that indicates whether variables containing missing values should be omitted. See details.
optional arguments that are passed to the update method for jags model objects
na.rm=TRUE (the default) then elements of a variable that
are missing (
NA) for any iteration in at least one chain will
This argument was added to handle incompletely defined variables.
From JAGS version 4.0.0, users may monitor variables that are not
completely defined in the BUGS language description of the model,
y[i] is defined in a
for loop starting from
y, y are not defined. The user may still
y and the monitored values corresponding to
y, y will have value
NA for all iterations in all
chains. Most of the functions in the coda package cannot handle
missing values so these variables are dropped by default.
data(LINE) LINE$recompile() LINE.out <- coda.samples(LINE, c("alpha","beta","sigma"), n.iter=1000) summary(LINE.out)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.