View source: R/mcmcInternals.R
modelDefinitionToNIMBLE | R Documentation |
A function to create a full NIMBLE model definition from a
standard model specification with a syntax similar to that used in the
glm
model specification
modelDefinitionToNIMBLE(
formula,
data,
family = "gaussian",
link = "identity",
centreCovs = TRUE,
scaleCovs = TRUE,
suffix = "",
sharedTermNode = NULL,
...
)
formula |
A formula that takes a similar form to that used in
|
data |
A data.frame, list, or inla.data.stack object containing the data to apply the model formula to. |
family |
The specification of the likelihood family to use. The default
is a Gaussian distribution with identity link. The argument can either be
a string containing the name of the likelihood family (case insensitive) or
a |
link |
A character scalar giving the name of the link function to be
used with the likelihood family. See |
centreCovs |
A logical scalar denoting whether the fixed effects in the
model should be centred before the analysis: each covariate element is
subtracted by its mean. |
scaleCovs |
A logical scalar denoting whether the fixed effects in the
model should be scaled before the analysis: each covariate element is divided
by its standard deviation. |
suffix |
A character scalar that will be appended to all variables used in the NIMBLE code (including constants and data) |
sharedTermNode |
A character containing the name of a node containing
the expectation that is shared across different likelihoods. Defaults to
|
... |
Other parameters that are passed to the error distribution processing functions |
A list object containing the following named elements:
responseValues
The values of the response variable
responseName
The name of the response variable
hFunctions
Calls to special 'h' functions
fFunctions
Calls to special 'f' functions
sFunctions
Calls to special 's' functions
covNames
The names of the covariates used in the model specification and equivalent valid names to use in the NIMBLE model
covFrame
A data frame of the processed covariates
modelMatrix
A model matrix resulted from an expansion of the
covariates performed by model.matrix
offetFrame
A data frame of offset terms used in the model
code
NIMBLE model specification code for the model
defined using the input parameters (see nimbleCode
)
constants
A list of constants to be passed to NIMBLE (see
nimbleModel
)
data
A list of data to be passed to NIMBLE (see
nimbleModel
)
inits
A list of starting values for model variables to be
passed to NIMBLE (see nimbleModel
)
dimensions
Named list of dimensions for variables to be
passed to NIMBLE (see nimbleModel
)
monitors
A character vector of names of variables to record
during MCMC sampling in NIMBLE (see configureMCMC
)
monitors2
A character vector of names of varaibles to record
during MCMC sampling in NIMBLE with a different thinning interval (see
configureMCMC
)
hierAttributes
A list containing attributes that are set in each of the hierarchical component models
link
A link list structure (as returned from
customLink
) that defines the link function used in the model
family
A error distribution list structure (as returned from
customError
) that defines the error distribution used in the
model
Joseph D. Chipperfield, joechip90@googlemail.com
nimbleCode
customLink
customError
errorFamilies
glm
inla.stack.data
model.matrix
nimbleModel
configureMCMC
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.