powered by
Function to extract random samples from the posterior distribution of the parameters of a jags model.
jags
jags.samples(model, variable.names, n.iter, thin = 1, type="trace", ...)
a jags model object
a character vector giving the names of variables to be monitored
number of iterations to monitor
thinning interval for monitors
type of monitor
optional arguments passed to the update method for jags model objects
A list of mcarray objects, with one element for each element of the variable.names argument.
mcarray
variable.names
The jags.samples function creates monitors for the given variables, runs the model for n.iter iterations and returns the monitored samples.
jags.samples
n.iter
jags.model, coda.samples
jags.model
coda.samples
# NOT RUN { data(LINE) LINE$recompile() LINE.samples <- jags.samples(LINE, c("alpha","beta","sigma"), n.iter=1000) LINE.samples # }
Run the code above in your browser using DataLab