Description Arguments Details Value References See Also Examples
Calling plotSampRep()
on an object of class mcmcoutput
or
mcmcoutputperm
plots the sampling representation 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. |
To visualize the posterior density of the component parameters the MCMC
draws are used as a sampling representation. Each combination of component
parameters is plotted in a scatter to visualize the contours of the
posterior density. For bivariate component parameters this could also be
done by estimating and plotting the density directly, but for
higher-dimensional parameter vectors this is not anymore possible and so
sampling representations define a proper solution for visualization and
allow us to study how a specific dimension of the parameter vector differs
among the various components of the mixture distribution. If this element
is significantly different among components we will observe K(K-1)
modes
in the sampling representation. On the other side, if this element is
mainly the same among the components of the mixture, we will rather observe
a single cluster.
As Frühwirth-Schnatter (2006) writes, "One informal method for diagnosing
mixtures is mode hunting in the mixture posterior density
(Frühwirth-Schnatter, 2001b). It is based on the observation that with an
increasing number of observations, the mixture likelihood function has K!
dominant modes if the data actually arise from a finite mixture distribution
with K
components, and that less than K!
dominant modes are present if
the finite mixture model is overfitting the number of components." The
sampling representation helps to perform this mode hunting in practice.
Note that this method for mcmcoutputperm
objects is only implemented for
mixtures of Poisson and Binomial distributions.
The sampling representation of the MCMC samples.
Frühwirth-Schnatter (2006), "Finite Mixture and Markov Switching Models"
Frühwirth-Schnatter, S. (2001b), "Markov chain Monte Carlo estimation of classical and dynamic switching and mixture models." Journal of the American Statistical Association 96, 194–209.
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
plotPostDens()
for plotting posterior densities 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)
plotSampRep(f_output)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.