priordefine: Advanced constructor for the 'prior' class

Description Usage Arguments Value References See Also Examples

Description

This constructor defines a data dependent prior with parameters by matching moments. As a consequence it needs as inputs an fdata object and a model object. The prior distributions chosen and the methods how parameters are computed are described in Frühwirth-Schnatter (2006).

Usage

1
2
3
4
5
6
7
priordefine(
  fdata = fdata(),
  model = model(),
  varargin = NULL,
  prior.wagner = TRUE,
  s = 5
)

Arguments

fdata

An fdata object holding the data. Observations in slot @y must be existent.

model

A model object specifying the finite mixture model.

varargin

NULL or a prior object. This enables the user to pass in an already constructed prior object that gets then completed.

prior.wagner

A logical indicating, if the prior from Wagner (2007) should be used in case of an exponential mixture model.

s

A numeric specifying the standard deviation s for the Metropolis-Hastings proposal.

Value

A fully specified prior object.

References

See Also

Examples

1
2
3
4
5
6
# Create a Poisson mixture 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)
# Use the advanced constructor to generate a prior.
f_prior <- priordefine(f_data, f_model)

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