Title: | Hierarchical Models Made Easy with Data Cloning |
---|---|
Description: | S4 classes around infrastructure provided by the 'coda' and 'dclone' packages to make package development easy as a breeze with data cloning for hierarchical models. |
Authors: | Peter Solymos [cre, aut] |
Maintainer: | Peter Solymos <[email protected]> |
License: | GPL-2 |
Version: | 0.4-1 |
Built: | 2024-09-24 02:20:01 UTC |
Source: | https://github.com/datacloning/dcmle |
S4 classes around infrastructure provided by the dclone package to make package development with data cloning for hierarchical models easy as a breeze.
The package defines S4 object classes for plain BUGS models
("gsFit"
, after BU*GS*/JA*GS*),
and BUGS models made ready for data cloning
("dcFit"
).
It also defines virtual classes for S3 object classes defined in
the dclone and coda packages.
The S4 class "dcmle"
is a fitted
model object containing MCMC results as returned by the
dcmle
function.
These object classes are easily
extensible to allow inclusion into functions fitting
specific models to the data (see Examples).
Peter Solymos
Maintainer: Peter Solymos <[email protected]>
Forum: https://groups.google.com/forum/#!forum/dclone-users
Issues: https://github.com/datacloning/dcmle/issues
Data cloning website: https://datacloning.org
Fitting wrapper function: dcmle
Object classes: "dcmle"
,
"codaMCMC"
, "dcCodaMCMC"
Creator functions makeGsFit
and
makeDcFit
## Data and model taken from Ponciano et al. 2009 ## Ecology 90, 356-362. ## Function to create template object for the Beverton-Holt model ## R CMD check will not choke on character representation of model ## the convenient makeDcFit creator function is used here bevholtFit <- function(y) { makeDcFit( data = list(ncl=1, n=length(y), Y=dcdim(data.matrix(y))), model = structure( c("model {", " for (k in 1:ncl) {", " for(i in 2:(n+1)) {", " Y[(i-1), k] ~ dpois(exp(X[i, k]))", " X[i, k] ~ dnorm(mu[i, k], 1 / sigma^2)", " mu[i,k] <- X[(i-1),k]+log(lambda)-log(1+beta*exp(X[(i-1),k]))", " }", " X[1, k] ~ dnorm(mu0, 1 / sigma^2)", " }", " beta ~ dlnorm(-1, 1)", " sigma ~ dlnorm(0, 1)", " tmp ~ dlnorm(0, 1)", " lambda <- tmp + 1", " mu0 <- log(2) + log(lambda) - log(1 + beta * 2)", "}"), class = "custommodel"), multiply = "ncl", unchanged = "n", params <- c("lambda","beta","sigma")) } ## S4 class 'bevholtMle' extends the 'dcmle' class ## it can have additional slots setClass("bevholtMle", representation(y="numeric", title="character"), contains = "dcmle") ## Function to fit the Beverton-Holt model to data bevholt <- function(y, n.clones, ...) { new("bevholtMle", dcmle(bevholtFit(y), n.clones=n.clones, ...), y = y, title = "Beverton-Holt Model") } ## Show method with appropriate heading setMethod("show", "bevholtMle", function(object) show(summary(as(object, "dcmle"), object@title))) paurelia <- c(17,29,39,63,185,258,267,392,510, 570,650,560,575,650,550,480,520,500) ## Not run: (m <- bevholt(paurelia, n.clones=2, n.iter=1000)) vcov(m) m@y ## End(Not run)
## Data and model taken from Ponciano et al. 2009 ## Ecology 90, 356-362. ## Function to create template object for the Beverton-Holt model ## R CMD check will not choke on character representation of model ## the convenient makeDcFit creator function is used here bevholtFit <- function(y) { makeDcFit( data = list(ncl=1, n=length(y), Y=dcdim(data.matrix(y))), model = structure( c("model {", " for (k in 1:ncl) {", " for(i in 2:(n+1)) {", " Y[(i-1), k] ~ dpois(exp(X[i, k]))", " X[i, k] ~ dnorm(mu[i, k], 1 / sigma^2)", " mu[i,k] <- X[(i-1),k]+log(lambda)-log(1+beta*exp(X[(i-1),k]))", " }", " X[1, k] ~ dnorm(mu0, 1 / sigma^2)", " }", " beta ~ dlnorm(-1, 1)", " sigma ~ dlnorm(0, 1)", " tmp ~ dlnorm(0, 1)", " lambda <- tmp + 1", " mu0 <- log(2) + log(lambda) - log(1 + beta * 2)", "}"), class = "custommodel"), multiply = "ncl", unchanged = "n", params <- c("lambda","beta","sigma")) } ## S4 class 'bevholtMle' extends the 'dcmle' class ## it can have additional slots setClass("bevholtMle", representation(y="numeric", title="character"), contains = "dcmle") ## Function to fit the Beverton-Holt model to data bevholt <- function(y, n.clones, ...) { new("bevholtMle", dcmle(bevholtFit(y), n.clones=n.clones, ...), y = y, title = "Beverton-Holt Model") } ## Show method with appropriate heading setMethod("show", "bevholtMle", function(object) show(summary(as(object, "dcmle"), object@title))) paurelia <- c(17,29,39,63,185,258,267,392,510, 570,650,560,575,650,550,480,520,500) ## Not run: (m <- bevholt(paurelia, n.clones=2, n.iter=1000)) vcov(m) m@y ## End(Not run)
coda package related generic functions.
chanames(x, ...) varnames(x, ...)
chanames(x, ...) varnames(x, ...)
x |
MCMC object. |
... |
Other arguments. |
See corresponding help pages.
Peter Solymos
"codaMCMC"
An S4 representation of an mcmc.lits object of the coda package.
Objects can be created by calls of the form new("codaMCMC", ...)
.
values
:Object of class "numeric"
,
values from the posterior sample of length
niter * nvar * nchains
.
varnames
:Object of class "character"
,
variable names.
start
:Object of class "integer"
,
start of iterations.
end
:Object of class "integer"
,
end of iterations.
thin
:Object of class "integer"
,
thinning value.
nchains
:Object of class "integer"
,
number of chains.
niter
:Object of class "integer"
,
number of iterations.
nvar
:Object of class "integer"
,
number of variables
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(mcmc.obj = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(object = "codaMCMC")
: ...
signature(from = "codaMCMC", to = "dcmle")
: ...
signature(from = "codaMCMC", to = "MCMClist")
: ...
signature(from = "dcmle", to = "codaMCMC")
: ...
signature(from = "MCMClist", to = "codaMCMC")
: ...
signature(object = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(object = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC", y = "missing")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(object = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(object = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(object = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
signature(x = "codaMCMC")
: ...
Peter Solymos
showClass("codaMCMC")
showClass("codaMCMC")
Generic after similar coda function
crosscorr.plot(x, ...)
crosscorr.plot(x, ...)
x |
MCMC object. |
... |
Other arguments. |
See corresponding help page
Peter Solymos
Generic after similar coda function
cumuplot(x, ...)
cumuplot(x, ...)
x |
MCMC object. |
... |
Other arguments. |
See corresponding help page
Peter Solymos
"custommodel"
Stands for the 'custommodel' S3 class from dclone package.
A virtual Class: No objects may be created from it.
Class "dcModel"
, directly.
No methods defined with class "custommodel" in the signature.
Peter Solymos
showClass("custommodel")
showClass("custommodel")
"dcArgs"
A class union for NULL
and "character"
.
A virtual Class: No objects may be created from it.
No methods defined with class "dcArgs" in the signature.
Peter Solymos
showClass("dcArgs")
showClass("dcArgs")
"dcCodaMCMC"
An S4 representation of an mcmc.list object of the coda package, with data cloning attributes from dclone package (the mcmc.list.dc class).
Objects can be created by calls of the form new("dcCodaMCMC", ...)
.
dctable
:Object of class "dcTable"
,
data cloning based iterative posterior statistics
based on dctable
.
dcdiag
:Object of class "dcDiag"
,
data cloning convergence diagnostics
based on dcdiag
.
nclones
:Object of class "nClones"
,
number of clones.
values
:Object of class "numeric"
,
same as in "codaMCMC"
class.
varnames
:Object of class "character"
,
same as in "codaMCMC"
class.
start
:Object of class "integer"
,
same as in "codaMCMC"
class.
end
:Object of class "integer"
,
same as in "codaMCMC"
class.
thin
:Object of class "integer"
,
same as in "codaMCMC"
class.
nchains
:Object of class "integer"
,
same as in "codaMCMC"
class.
niter
:Object of class "integer"
,
same as in "codaMCMC"
class.
nvar
:Object of class "integer"
,
same as in "codaMCMC"
class.
Class "codaMCMC"
, directly.
signature(x = "dcCodaMCMC")
: ...
signature(x = "dcCodaMCMC")
: ...
signature(from = "dcCodaMCMC", to = "dcmle")
: ...
signature(from = "dcCodaMCMC", to = "MCMClist")
: ...
signature(from = "dcmle", to = "dcCodaMCMC")
: ...
signature(from = "MCMClist", to = "dcCodaMCMC")
: ...
signature(object = "dcCodaMCMC")
: ...
signature(x = "dcCodaMCMC")
: ...
signature(x = "dcCodaMCMC")
: ...
signature(x = "dcCodaMCMC")
: ...
signature(object = "dcCodaMCMC")
: ...
signature(object = "dcCodaMCMC")
: ...
Peter Solymos
showClass("dcCodaMCMC")
showClass("dcCodaMCMC")
"dcdiag"
Stands for the 'dcdiag' S3 class from dclone package.
A virtual Class: No objects may be created from it.
Class "dcDiag"
, directly.
No methods defined with class "dcdiag" in the signature.
Peter Solymos
showClass("dcdiag")
showClass("dcdiag")
"dcDiag"
Virtual class for data cloning convergence diagnostics.
A virtual Class: No objects may be created from it.
No methods defined with class "dcDiag" in the signature.
Peter Solymos
showClass("dcDiag")
showClass("dcDiag")
"dcFit"
Compendium for data cloning
Objects can be created by calls of the form new("dcFit", ...)
.
multiply
:Object of class "dcArgs"
,
same as corresponding dc.fit
argument.
unchanged
:Object of class "dcArgs"
,
same as corresponding dc.fit
argument.
update
:Object of class "dcArgs"
,
same as corresponding dc.fit
argument.
updatefun
:Object of class "dcFunction"
,
same as corresponding dc.fit
argument.
initsfun
:Object of class "dcFunction"
,
same as corresponding dc.fit
argument.
flavour
:Object of class "character"
,
same as corresponding dc.fit
argument,
default is "jags"
.
It can also be "winbugs"
,
"openbugs"
, or "brugs"
referring to
the argument
of bugs.fit
,
in which case flavour
will be treated as "bugs"
.
data
:Object of class "list"
,
same as corresponding dc.fit
argument.
model
:Object of class "dcModel"
,
same as corresponding dc.fit
argument.
params
:Object of class "dcParams"
,
same as corresponding dc.fit
argument.
inits
:Object of class "dcInits"
,
same as corresponding dc.fit
argument.
Class "gsFit"
, directly.
signature(object = "dcFit")
: ...
Peter Solymos
showClass("dcFit")
showClass("dcFit")
"dcFunction"
Virtual class for BUGS/JAGS models defined as functions.
A virtual Class: No objects may be created from it.
No methods defined with class "dcFunction" in the signature.
Peter Solymos
showClass("dcFunction")
showClass("dcFunction")
"dcInits"
Virtual class for initial values.
A virtual Class: No objects may be created from it.
No methods defined with class "dcInits" in the signature.
Peter Solymos
showClass("dcInits")
showClass("dcInits")
This function is a wrapper to fit the model to the data and obtain MLE point estimates and asymptotic standard errors based on the estimate of the Fisher information matrix (theory given by Lele et al. 2007, 2010, software implementation is given in Solymos 2010).
dcmle(x, params, n.clones = 1, cl = NULL, nobs, ...)
dcmle(x, params, n.clones = 1, cl = NULL, nobs, ...)
x |
|
params |
character, vector of model parameters to monitor. |
n.clones |
integer, vector for the number of clones used in fitting. |
cl |
cluster object (snow type cluster) or number of cores (multicore type forking), optional. |
nobs |
number of observations, optional. |
... |
other arguments passed to underlying functions (see Details). |
The function uses slots of the input object
and passes them as arguments to underlying functions
(jags.fit
, jags.parfit
,
bugs.fit
, bugs.parfit
,
stan.fit
, stan.parfit
dc.fit
, dc.parfit
).
An object of class "dcmle"
.
Peter Solymos
Solymos, P., 2010. dclone: Data Cloning in R. The R Journal 2(2), 29–37. URL: https://journal.r-project.org/archive/2010-2/RJournal_2010-2_Solymos.pdf
Lele, S.R., B. Dennis and F. Lutscher, 2007. Data cloning: easy maximum likelihood estimation for complex ecological models using Bayesian Markov chain Monte Carlo methods. Ecology Letters 10, 551–563.
Lele, S. R., K. Nadeem and B. Schmuland, 2010. Estimability and likelihood inference for generalized linear mixed models using data cloning. Journal of the American Statistical Association 105, 1617–1625.
For additional arguments:
jags.fit
, jags.parfit
,
bugs.fit
, bugs.parfit
,
stan.fit
, stan.parfit
dc.fit
, dc.parfit
.
Object classes: "dcmle"
Creator functions makeGsFit
and
makeDcFit
## Data and model taken from Ponciano et al. 2009 ## Ecology 90, 356-362. paurelia <- c(17,29,39,63,185,258,267,392,510, 570,650,560,575,650,550,480,520,500) paramecium <- new("dcFit") paramecium@data <- list( ncl=1, n=length(paurelia), Y=dcdim(data.matrix(paurelia))) paramecium@model <- function() { for (k in 1:ncl) { for(i in 2:(n+1)){ Y[(i-1), k] ~ dpois(exp(X[i, k])) # observations X[i, k] ~ dnorm(mu[i, k], 1 / sigma^2) # state mu[i, k] <- X[(i-1), k] + log(lambda) - log(1 + beta * exp(X[(i-1), k])) } X[1, k] ~ dnorm(mu0, 1 / sigma^2) # state at t0 } beta ~ dlnorm(-1, 1) # Priors on model parameters sigma ~ dlnorm(0, 1) tmp ~ dlnorm(0, 1) lambda <- tmp + 1 mu0 <- log(2) + log(lambda) - log(1 + beta * 2) } paramecium@multiply <- "ncl" paramecium@unchanged <- "n" paramecium@params <- c("lambda","beta","sigma") ## Not run: (m1 <- dcmle(paramecium, n.clones=1, n.iter=1000)) (m2 <- dcmle(paramecium, n.clones=2, n.iter=1000)) (m3 <- dcmle(paramecium, n.clones=1:3, n.iter=1000)) cl <- makePSOCKcluster(3) (m4 <- dcmle(paramecium, n.clones=2, n.iter=1000, cl=cl)) (m5 <- dcmle(paramecium, n.clones=1:3, n.iter=1000, cl=cl)) (m6 <- dcmle(paramecium, n.clones=1:3, n.iter=1000, cl=cl, partype="parchains")) (m7 <- dcmle(paramecium, n.clones=1:3, n.iter=1000, cl=cl, partype="both")) stopCluster(cl) ## End(Not run)
## Data and model taken from Ponciano et al. 2009 ## Ecology 90, 356-362. paurelia <- c(17,29,39,63,185,258,267,392,510, 570,650,560,575,650,550,480,520,500) paramecium <- new("dcFit") paramecium@data <- list( ncl=1, n=length(paurelia), Y=dcdim(data.matrix(paurelia))) paramecium@model <- function() { for (k in 1:ncl) { for(i in 2:(n+1)){ Y[(i-1), k] ~ dpois(exp(X[i, k])) # observations X[i, k] ~ dnorm(mu[i, k], 1 / sigma^2) # state mu[i, k] <- X[(i-1), k] + log(lambda) - log(1 + beta * exp(X[(i-1), k])) } X[1, k] ~ dnorm(mu0, 1 / sigma^2) # state at t0 } beta ~ dlnorm(-1, 1) # Priors on model parameters sigma ~ dlnorm(0, 1) tmp ~ dlnorm(0, 1) lambda <- tmp + 1 mu0 <- log(2) + log(lambda) - log(1 + beta * 2) } paramecium@multiply <- "ncl" paramecium@unchanged <- "n" paramecium@params <- c("lambda","beta","sigma") ## Not run: (m1 <- dcmle(paramecium, n.clones=1, n.iter=1000)) (m2 <- dcmle(paramecium, n.clones=2, n.iter=1000)) (m3 <- dcmle(paramecium, n.clones=1:3, n.iter=1000)) cl <- makePSOCKcluster(3) (m4 <- dcmle(paramecium, n.clones=2, n.iter=1000, cl=cl)) (m5 <- dcmle(paramecium, n.clones=1:3, n.iter=1000, cl=cl)) (m6 <- dcmle(paramecium, n.clones=1:3, n.iter=1000, cl=cl, partype="parchains")) (m7 <- dcmle(paramecium, n.clones=1:3, n.iter=1000, cl=cl, partype="both")) stopCluster(cl) ## End(Not run)
"dcmle"
Fitted model object from dcmle
.
Objects can be created by calls of the form new("dcmle", ...)
.
call
:Object of class "language"
, the call.
coef
:Object of class "numeric"
,
coefficients (posterior means).
fullcoef
:Object of class "numeric"
,
full coefficients, possibly with fixed values.
vcov
:Object of class "matrix"
,
variance covariance matrix.
details
:Object of class "dcCodaMCMC"
,
the fitted model object.
nobs
:Object of class "integer"
,
number of observations, optional.
method
:Object of class "character"
.
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(mcmc.obj = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(object = "dcmle")
: ...
signature(from = "codaMCMC", to = "dcmle")
: ...
signature(from = "dcCodaMCMC", to = "dcmle")
: ...
signature(from = "dcmle", to = "codaMCMC")
: ...
signature(from = "dcmle", to = "dcCodaMCMC")
: ...
signature(from = "dcmle", to = "MCMClist")
: ...
signature(from = "MCMClist", to = "dcmle")
: ...
signature(object = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(object = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle", y = "missing")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(object = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(object = "dcmle")
: ...
signature(object = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(object = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(object = "dcmle")
: ...
signature(x = "dcmle")
: ...
signature(x = "dcmle")
: ...
Peter Solymos
showClass("dcmle")
showClass("dcmle")
"dcModel"
Virtual class for BUGS/JAGS models.
A virtual Class: No objects may be created from it.
No methods defined with class "dcModel" in the signature.
Peter Solymos
showClass("dcModel")
showClass("dcModel")
"dcParams"
Virtual class for model parameters to monitor.
A virtual Class: No objects may be created from it.
No methods defined with class "dcParams" in the signature.
Peter Solymos
showClass("dcParams")
showClass("dcParams")
"dctable"
Stands for the 'dctable' S3 class from dclone package.
A virtual Class: No objects may be created from it.
Class "dcTable"
, directly.
No methods defined with class "dctable" in the signature.
Peter Solymos
showClass("dctable")
showClass("dctable")
"dcTable"
Posterior statistics from iterative fit, virtual class.
A virtual Class: No objects may be created from it.
No methods defined with class "dcTable" in the signature.
Peter Solymos
showClass("dcTable")
showClass("dcTable")
Diagnostic functions set as generic.
gelman.diag(x, ...) geweke.diag(x, ...) heidel.diag(x, ...) raftery.diag(x, ...) gelman.plot(x, ...)
gelman.diag(x, ...) geweke.diag(x, ...) heidel.diag(x, ...) raftery.diag(x, ...) gelman.plot(x, ...)
x |
MCMC objects. |
... |
Other arguments. |
Diagnostic functions from coda package are defined as generics for extensibility.
Diagnostics summaries, and plot.
Peter Solymos
See relevant help pages.
gelman.diag
geweke.diag
heidel.diag
raftery.diag
"gsFit"
BUGS/JAGS compendium
Objects can be created by calls of the form new("gsFit", ...)
.
data
:Object of class "list"
,
same as corresponding jags.fit
bugs.fit
or argument.
model
:Object of class "dcModel"
,
same as corresponding jags.fit
bugs.fit
or argument.
params
:Object of class "dcParams"
,
same as corresponding jags.fit
bugs.fit
or argument.
inits
:Object of class "dcInits"
,
same as corresponding jags.fit
bugs.fit
or argument.
flavour
:Object of class "character"
,
same as corresponding dc.fit
argument,
default is "jags"
.
It can also be "winbugs"
,
"openbugs"
, or "brugs"
referring to
the argument
of bugs.fit
,
in which case flavour
will be treated as "bugs"
.
signature(object = "gsFit")
: ...
Peter Solymos
showClass("gsFit")
showClass("gsFit")
Creator functions for data types used in the dcmle package.
makeGsFit(data, model, params = NULL, inits = NULL, flavour) makeDcFit(data, model, params=NULL, inits = NULL, multiply = NULL, unchanged = NULL, update = NULL, updatefun = NULL, initsfun = NULL, flavour)
makeGsFit(data, model, params = NULL, inits = NULL, flavour) makeDcFit(data, model, params=NULL, inits = NULL, multiply = NULL, unchanged = NULL, update = NULL, updatefun = NULL, initsfun = NULL, flavour)
data |
usually a named list with data. |
model |
BUGS model (function, character vector or
a |
params |
optional, character vector for model parameters to monitor. |
inits |
initial values ( |
multiply |
optional, argument passed to
|
unchanged |
optional, argument passed to
|
update |
optional, argument passed to
|
updatefun |
optional, argument passed to
|
initsfun |
optional, argument passed to
|
flavour |
optional, argument passed to
|
'gsFit' (after BU*GS*/JA*GS*) is a basic object class representing
requirements for the Bayesian MCMC model fitting.
The 'dcFit' object class extends 'gsFit'
by additional slots that are used to fine tune
how data cloning is done during fitting process.
Both 'gsFit' and 'dcFit' represent prerequisites
for model fitting, but do not containing any fitted
parts. Creator functions makeGsFit
and makeDcFit
are available for these classes.
See dcmle-package
help page for usage of creator functions.
The default flavour
is stored in
getOption("dcmle.flavour")
with value "jags"
.
It can be changed as options("dcmle.flavour"="bugs")
if required.
makeGsFit
returns a 'gsFit' object (gsFit-class).
makeDcFit
returns a 'dcFit' object (dcFit-class).
Peter Solymos
gsFit-class, dcFit-class, dcmle
showClass("gsFit") new("gsFit") showClass("dcFit") new("dcFit")
showClass("gsFit") new("gsFit") showClass("dcFit") new("dcFit")
"mcmc"
Stands for the 'mcmc' S3 class from coda package.
A virtual Class: No objects may be created from it.
Class "MCMClist"
, directly.
No methods defined with class "mcmc" in the signature.
Peter Solymos
showClass("mcmc")
showClass("mcmc")
"mcmc.list"
Stands for the 'mcmc.list' S3 class from coda package.
A virtual Class: No objects may be created from it.
Class "MCMClist"
, directly.
No methods defined with class "mcmc.list" in the signature.
Peter Solymos
showClass("mcmc.list")
showClass("mcmc.list")
"mcmc.list.dc"
Stands for the 'mcmc.list.dc' S3 class from dclone package.
A virtual Class: No objects may be created from it.
Class "MCMClist"
, directly.
No methods defined with class "mcmc.list.dc" in the signature.
Peter Solymos
showClass("mcmc.list.dc")
showClass("mcmc.list.dc")
"MCMClist"
Virtual class for S3 mcmc.list object from coda package.
A virtual Class: No objects may be created from it.
signature(x = "MCMClist")
: ...
signature(mcmc.obj = "MCMClist")
: ...
signature(x = "MCMClist")
: ...
signature(x = "MCMClist")
: ...
signature(from = "codaMCMC", to = "MCMClist")
: ...
signature(from = "dcCodaMCMC", to = "MCMClist")
: ...
signature(from = "dcmle", to = "MCMClist")
: ...
signature(from = "MCMClist", to = "codaMCMC")
: ...
signature(from = "MCMClist", to = "dcCodaMCMC")
: ...
signature(from = "MCMClist", to = "dcmle")
: ...
signature(object = "MCMClist")
: ...
signature(x = "MCMClist")
: ...
signature(x = "MCMClist")
: ...
signature(x = "MCMClist")
: ...
signature(x = "MCMClist")
: ...
signature(x = "MCMClist")
: ...
signature(x = "MCMClist")
: ...
signature(x = "MCMClist")
: ...
signature(x = "MCMClist")
: ...
signature(x = "MCMClist")
: ...
signature(x = "MCMClist")
: ...
signature(x = "MCMClist")
: ...
signature(x = "MCMClist")
: ...
signature(x = "MCMClist")
: ...
signature(x = "MCMClist")
: ...
signature(x = "MCMClist")
: ...
signature(x = "MCMClist")
: ...
signature(x = "MCMClist", y = "missing")
: ...
signature(x = "MCMClist")
: ...
signature(x = "MCMClist")
: ...
signature(x = "MCMClist")
: ...
signature(x = "MCMClist")
: ...
signature(x = "MCMClist")
: ...
signature(x = "MCMClist")
: ...
signature(x = "MCMClist")
: ...
Peter Solymos
showClass("MCMClist")
showClass("MCMClist")
"nClones"
Number of clones, virtual class.
A virtual Class: No objects may be created from it.
No methods defined with class "nClones" in the signature.
Peter Solymos
showClass("nClones")
showClass("nClones")
"summary.codaMCMC"
Summary object.
Objects can be created by calls of the
form new("summary.codaMCMC", ...)
.
settings
:Object of class "integer"
,
MCMC settings.
coef
:Object of class "matrix"
,
posterior statistics.
signature(object = "summary.codaMCMC")
: ...
Peter Solymos
showClass("summary.codaMCMC")
showClass("summary.codaMCMC")
"summary.dcCodaMCMC"
Summary object.
Objects can be created by calls of the form
new("summary.dcCodaMCMC", ...)
.
settings
:Object of class "integer"
,
MCMC settings.
coef
:Object of class "matrix"
,
coefficients (posterior means).
convergence
:Object of class "dcDiag"
,
data cloning convergence diagnostics.
Class "summary.codaMCMC"
, directly.
signature(object = "summary.dcCodaMCMC")
: ...
Peter Solymos
showClass("summary.dcCodaMCMC")
showClass("summary.dcCodaMCMC")
"summary.dcmle"
Summary object.
Objects can be created by calls of the form
new("summary.dcmle", ...)
.
title
:Object of class "character"
,
title to print, optional.
call
:Object of class "language"
,
the call.
settings
:Object of class "integer"
,
MCMC settings.
coef
:Object of class "matrix"
,
coefficients (posterior means).
convergence
:Object of class "dcDiag"
,
data cloning convergence diagnostics.
Class "summary.dcCodaMCMC"
, directly.
Class "summary.codaMCMC"
,
by class "summary.dcCodaMCMC", distance 2.
signature(object = "summary.dcmle")
: ...
Peter Solymos
showClass("summary.dcmle")
showClass("summary.dcmle")