Description Usage Arguments Details See Also
View source: R/plotBUGSTrace.R
Produces trace plots of the MCMC samples for each parameter in the fitted FCS2 model. These can be used to visualise the convergence of the MCMC chains and the autocorrelation.
1 2 3 4 5 6 7 8 9 10 11 12 | plotBUGSTrace(
fit,
variables = variable.names(fit, rw = "singular", spatial = "singular", hyperpar =
"prec"),
chains = 1:fit$bugsFit$n.chains,
nPerPage = 12,
col = chains + 1,
ylab,
ylim,
main,
...
)
|
fit |
an |
variables |
an optional character vector giving the names of the model
variables to plot. |
chains |
which MCMC chains to plot. Default to all. |
nPerPage |
the number of trace plots to create on each page. |
col |
a vector giving the colour to use for each chain in
|
ylab, ylim, main, ... |
further arguments passed to |
If the MCMC chains have converged, the multiple chains (in different colours) should agree; Their values should not be identical but they should cover the same range of values as each other.
The MCMC chains should also mix well meaning that they should move
about the parameter space quickly. A chain that moves slowly across the
parameter space has high autocorrelation. This can also be verified by
plotting the autocorrelation of a parameter using acf
. The
autocorrelation can be reduced by thinning the sample using
thinBUGSSamples
or by specifying a larger number for
n.thin
when fitting.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.