mcmcstart: Finmix default starting values

Description Usage Arguments Value See Also Examples

Description

Calling mcmcstart() creates starting values for MCMC sampling. Starting values are constructed for the indicators in the fdata argument and the parameters in the model argument. In addition an mcmc object can be provided in the varargin argument to set up all slots consistently for a non-default setting of hyper-parameters.

To assing the returned objects directly to existing names the assignment operator %%=%% can be used together with a formula concatenating each name with a tilde ~. See the examples.

Usage

1
mcmcstart(fdata, model, varargin)

Arguments

fdata

An fdata object containing the data.

model

A model object specifying the finite mixture model to be estimated.

varargin

Either NULL or an mcmc object defining (possibly non-default) hyper-parameters. If not provided a default mcmc object is created internally and returned.

Value

A list containing the fdata object, the model object and an mcmc object all set up for MCMC sampling.

See Also

Examples

1
2
3
4
5
6
# Specify a Poisson model.
f_model <- model("poisson", par = list(lambda = c(0.3, 0.7)), K = 2)
# Simulate data from the model.
f_data <- simulate(f_model)
# Set up all objects for MCMC sampling.
(f_data ~ f_model ~ f_mcmc) %=% mcmcstart(f_data, f_model)

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