Description Usage Arguments Details Value Author(s) Examples
readBUGSmodel
processes inputs providing the model
and values for constants, data, initial values of the model
in a variety of forms, returning a NIMBLE BUGS R model
1 2 3 |
model |
one of (1) a character string giving the
file name containing the BUGS model code, with relative
or absolute path, (2) an R function whose body is the
BUGS model code, or (3) the output of |
data |
(optional) (1) character string giving the file name for an R file providing the input constants and data as R code [assigning individual objects or as a named list], with relative or absolute path, or (2) a named list providing the input constants and data. If neither is provided, the function will look for a file named {modelName}-data including extensions .R, .r, or .txt. |
inits |
(optional) (1) character string giving the file name for an R file providing the input constants and data as R code [assigning individual objects or as a named list], with relative or absolute path, or (2) a named list providing the input constants and data |
dir |
(optional) character string giving the directory where the (optional) files are located |
useInits |
boolean indicating whether to set the
initial values, either based on |
Note that readBUGSmodel
should handle most common
ways of providing information on a model as used in BUGS
and JAGS but does not handle input model files that refer
to additional files containing data. Please see the BUGS
examples provided with JAGS
(http://sourceforge.net/projects/mcmc-jags/files/Examples/)
for examples of supported formats. Also,
readBUGSmodel
takes both constants and data via the
'data' argument, unlike nimbleModel
, in which these
are distinguished. The reason for allowing both to be given
via 'data' is for backwards compatibility with the BUGS
examples, in which constants and data are not
distinguished.
return returns a NIMBLE BUGS R model
Christopher Paciorek
1 2 3 4 5 6 7 8 9 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.