plotPostDens-mcmcoutputpermfix-method: Plot posterior densities of the component parameters

Description Usage Arguments Value See Also Examples

Description

Calling plotPostDens() plots posterior densities of the sampled component parameters from MCMC sampling, if the number of components is two.

Usage

1
2
## S4 method for signature 'mcmcoutputpermfix'
plotPostDens(x, dev = TRUE, ...)

Arguments

x

An mcmcoutputpermfix object containing all sampled values.

dev

A logical indicating, if the plots should be shown by a graphical device. If plots should be stored to a file set dev to FALSE.

...

Further arguments to be passed to the plotting function.

Value

Posterior densities of the MCMC samples.

See Also

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
# Define a Poisson mixture model with two components.
f_model <- model("poisson", par = list(lambda = c(0.3, 1.2)), K = 2, 
                 indicfix = TRUE)
# Simulate data from the mixture model.
f_data <- simulate(f_model)
# Define the hyper-parameters for MCMC sampling.
f_mcmc <- mcmc(storepost = FALSE)
# Define the prior distribution by relying on the data.
f_prior <- priordefine(f_data, f_model)
# Do not use a hierarchical prior.
setHier(f_prior) <- FALSE
# Start MCMC sampling.
f_output <- mixturemcmc(f_data, f_model, f_prior, f_mcmc)
f_outputperm <- mcmcpermute(f_output)
plotPostDens(f_outputperm)

## End(Not run)

simonsays1980/finmix documentation built on Dec. 23, 2021, 2:25 a.m.