View source: R/as.bugs.array.R
as.bugs.array | R Documentation |
Function converting results from Markov chain simulations,
that might not be from BUGS, to bugs object. Used mainly to display
results with plot.bugs
.
as.bugs.array(sims.array, model.file=NULL, program=NULL,
DIC=FALSE, DICOutput=NULL, n.iter=NULL, n.burnin=0, n.thin=1)
sims.array |
3-way array of simulation output, with dimensions n.keep, n.chains, and length of combined parameter vector. |
model.file |
file containing the model written in WinBUGS code |
program |
the program used |
DIC |
logical; whether DIC should be calculated, see also
argument |
DICOutput |
DIC value |
n.iter |
number of total iterations per chain used for generating
|
n.burnin |
length of burn in, i.e. number of iterations to
discarded at the beginning for generating |
n.thin |
thinning rate, a positive integer, used for generating
|
This function takes a 3-way array of simulations and makes it into a
bugs
object that can be conveniently displayed using
print
and plot
and accessed using attach.bugs
. If
the third dimension of sims() has names, the resulting bugs object will
respect that naming convention. For example, if the parameter names are
“alpha[1]”, “alpha[2]”, ..., “alpha[8]”,
“mu”, “tau”, then as.bugs.array
will know that
alpha is a vector of length 8, and mu and tau are scalar parameters.
These will all be plotted appropriately by plot
and attached
appropriately by attach.bugs
.
If DIC=TRUE
then DIC can be either already passed to argument
DICOutput
as it is done in openbugs
or calculated
from deviance values in sims.array
.
A bugs
object is returned
Jouni Kerman, kerman@stat.columbia.edu with modification by Andrew Gelman, gelman@stat.columbia.edu, packaged by Uwe Ligges, ligges@statistik.tu-dortmund.de.
bugs
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.