Learn R Programming

dclone (version 2.1-1)

.dcFit: Internal function for iterative model fitting with data cloning

Description

This is the workhorse for dc.fit and dc.parfit.

Usage

.dcFit(data, params, model, inits, n.clones, 
    multiply = NULL, unchanged = NULL, 
    update = NULL, updatefun = NULL, initsfun = NULL, 
    flavour = c("jags", "bugs"), 
    n.chains=3, cl = NULL, parchains = FALSE, ...)

Arguments

data
A named list (or environment) containing the data.
params
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.
model
Character string (name of the model file), a function containing the model, or a custommodel object (see Examples).
inits
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 gen
n.clones
An integer vector containing the numbers of clones to use iteratively.
multiply
Numeric or character index for list element(s) in the data argument to be multiplied by the number of clones instead of repetitions.
unchanged
Numeric or character index for list element(s) in the data argument to be left unchanged.
update
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 Exam
updatefun
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.
initsfun
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, other
flavour
If "jags", the function jags.fit is called. If "bugs", the function bugs.fit is called.
n.chains
Number of chains to generate.
cl
A cluster object created by makeCluster, or an integer, see parDosa and evalParallelArgumen
parchains
Logical, whether parallel chanins should be run.
...
Other values supplied to jags.fit, or bugs.fit, depending on the flavour argument.

Value

  • An object inheriting from the class 'mcmc.list'.

encoding

UTF-8

See Also

dc.fit, dc.parfit