This is the workhorse for dc.fit
and
dc.parfit
.
.dcFit(data, params, model, inits, n.clones,
multiply = NULL, unchanged = NULL,
update = NULL, updatefun = NULL, initsfun = NULL,
flavour = c("jags", "bugs", "stan"),
n.chains=3, cl = NULL, parchains = FALSE,
return.all=FALSE, check.nclones=TRUE, ...)
An object inheriting from the class 'mcmc.list'.
A named list (or environment) containing the data.
Character vector of parameters to be sampled. It can be a list of 2 vectors, 1st element is used as parameters to monitor, the 2nd is used as parameters to use in calculating the data cloning diagnostics.
Character string (name of the model file), a function containing
the model, or a custommodel
object (see Examples).
Optional specification of initial values in the form of a list or a
function (see Initialization at jags.model
).
If missing, will be treated as NULL
and initial values will
be generated automatically.
An integer vector containing the numbers of clones to use iteratively.
Numeric or character index for list element(s) in the data
argument to be multiplied by the number of clones instead of repetitions.
Numeric or character index for list element(s) in the data
argument to be left unchanged.
Numeric or character index for list element(s) in the data
argument that has to be updated by updatefun
in each iterations.
This usually is for making priors more informative, and enhancing
convergence. See Details and Examples.
A function to use for updating data[[update]]
.
It should take an 'mcmc.list' object as 1st argument,
2nd argument can be the number of clones.
See Details and Examples.
A function to use for generating initial values, inits
are
updated by the object
returned by this function from the second iteration. If initial values
are not dependent on the previous iteration, this should be NULL
,
otherwise, it should take an 'mcmc.list' object as 1st argument,
2nd argument can be the number of clones.
This feature is useful if latent nodes are provided in inits
so it also requires to be cloned for subsequent iterations.
See Details and Examples.
If "jags"
, the function jags.fit
is called.
If "bugs"
, the function bugs.fit
is called.
If "stan"
, the function stan.fit
is called.
Number of chains to generate.
A cluster object created by makeCluster
, or
an integer, see parDosa
and
evalParallelArgument
.
Logical, whether parallel chains should be run.
Logical. If TRUE
, all the MCMC list objects corresponding to the sequence
n.clones
are returned for further inspection
(this only works with partype = "parchains"
). Otherwise only
the MCMC list corresponding to highest number of clones is returned
with summary statistics for the rest.
Logical, whether to check and ensure that values of n.clones
are unique and increasing. check.nclones = FALSE
means that
n.clones
is used as is, thus it is possible to supply
repeated values but still use the update functionality.
Other values supplied to jags.fit
, or
bugs.fit
, depending on the flavour
argument.
Peter Solymos, solymos@ualberta.ca, implementation is based on many discussions with Khurram Nadeem and Subhash Lele.
dc.fit
, dc.parfit