Creates the BUGSmodel specification and return the values for the initialization, the prior specification and the observations.
1 2 
y 
a numeric vector. 
k 
integer indicating the number of segments. 
priors 
specification of priors by a named list or a

inits 
specification of initial values by a named list or string indicating the function to be called. 
aprioriWeights 
specification of prior of the apriori weights. If

no.empty.classes 
logical: should it be prevented that empty classes arise during sampling. 
restrict 
one of "none", "mu", "tau". 
... 
further parameters for the function specified in

By default the function initsFS
is called for generating
initial values. Any other function specified by inits
is
assumed to have at least x
, k
and restrict
as
input parameters.
The parameter restrict
indicates if a
locationshift model ("tau"), a scale contaminated model
("mu") or a model where both variables vary over components shall
be fitted.
If the logical no.empty.classes
is TRUE
there
are observations added to the model that the classes are not empty. This
signifies that the likelihood when sampling the class affiliations is
changed thus that any data point which is sampled and is the last one
in its class stays there.
If y
is specified an object of class BMMmodel
is
returned with components:
inits 
named list. 
data 
named list. 
bugs 
text for .bugfile with prefix missing. 
If y
is missing an object of class BMMsetup
is
returned containing the parameter specifications. When JAGScall
is called with this object as model argument, BMMmodel
is
called with y
and the other parameters as input arguments
before calling JAGS.
Bettina Gruen
JAGSrun
, initsFS
1 2 3 4 5 
Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
All documentation is copyright its authors; we didn't write any of that.