Description Usage Arguments Details Author(s) See Also Examples
This function method draws trace plots for a Bayesian mixture model, e.g. visualizes the course of the Markov Chains. Inspection of the Markov Chains is important to determine convergence of the chains, which is necessary for sensible results.
1 | plotChains(object, chain, component, itb = 1, thin = 1, cols, ...)
|
object |
An object of |
chain |
A character of length one giving the name of the paramter, which
chain should be plotted. Can be omitted, if |
component |
An integer specifying the components, which parameter chains should
be plotted. Can be omitted, if |
itb |
Number of iterations used for burn-in. The burn-in is relative to
the output of |
thin |
Thinning value for the iterations after burn-in. The thinning is
relative to the output of |
cols |
Number of columns to be used in the plot. Optional, if omitted, the number of columns and rows are choosen be the method itself. |
... |
Further arguments passed to |
The number of iterations necessary until a Markov chain reaches stationarity depends on the specific model and data. For any inference based on Markov Chain Monte Carlo methods, it is therefore necessary to inspect the convergence of Markov Chains. One way to do this is visual inspection of trace plots using this method.
If argument main
is passed to this method, it should have as
many elements as chains are plotted. Otherwise, vector main
is
reapted.
Hans-Ulrich Klein (h.klein@uni-muenster.de) Martin Schaefer (martin.schaefer@udo.edu)
bayesMixModel
, MixModelBayes-class
1 2 3 4 5 6 7 8 9 | z <- c(rnorm(1000, 0, 3), rnorm(1000, 0, 5), rexp(1000, 5), -rexp(1000, 5))
mm <- bayesMixModel(z, normNull=1:2, expNeg=3, expPos=4,
sdNormNullInit=c(1, 2), rateExpNegInit=8, rateExpPosInit=8,
shapeNorm0=c(1, 1), scaleNorm0=c(1, 1),
shapeExpNeg0=c(1, 1), scaleExpNeg0=c(1, 1),
shapeExpPos0=c(1, 1), scaleExpPos0=c(1, 1),
sdAlpha=1, itb=200, nmc=1000, thin=10)
plotChains(mm, chain="pi")
plotChains(mm, component=c(2,3))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.