Description Arguments Details Value See Also Examples
Calling plotPostDens()
on an object of class mcmcoutput
or
mcmcoutputperm
plots the posterior density of the sampled component
parameters from MCMC sampling, either the original parameters or the
relabeled ones (mcmcoutputperm
).
x |
An |
dev |
A logical indicating, if the plots should be shown by a graphical
device. If plots should be stored to a file set |
... |
Further arguments to be passed to the plotting function. |
Next to sampling representations and the point process of MCMC samples the
posterior density of component parameters can also be plotted directly for
finite mixture distributions with K=2
components and a single parameter.
The posterior density will always be bimodal due to to label-switching in
the MCMC sampling. This could change when considering a relabeld MCMC sample
(mcmcoutputperm
object).
Note that this method for mcmcoutputperm
objects is only implemented for
mixtures of Poisson and Binomial distributions.
The posterior density of the MCMC samples.
mixturemcmc()
for performing MCMC sampling
mcmcpermute()
for permuting MCMC samples
plotTraces()
for plotting the traces of sampled values
plotHist()
for plotting histograms of sampled values
plotDens()
for plotting densities of sampled values
plotPointProc()
for plotting the point process of sampled values
plotSampRep()
for plotting the sampling representation for sampled values
1 2 3 4 5 6 7 8 9 10 11 | # Define a Poisson mixture model with two components.
f_model <- model("poisson", par = list(lambda = c(0.3, 1.2)), K = 2)
# Simulate data from the mixture model.
f_data <- simulate(f_model)
# Define the hyper-parameters for MCMC sampling.
f_mcmc <- mcmc()
# Define the prior distribution by relying on the data.
f_prior <- priordefine(f_data, f_model)
# Start MCMC sampling.
f_output <- mixturemcmc(f_data, f_model, f_prior, f_mcmc)
plotPostDens(f_output)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.