Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[be77e8]: man / jags.samples.Rd Maximize Restore History

Download this file

jags.samples.Rd    41 lines (40 with data), 1.2 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
\name{jags.samples}
\alias{jags.samples}
\title{Generate posterior samples}
\description{
Function to extract random samples from the posterior distribution
of the parameters of a \code{jags} model.
}
\usage{
jags.samples(model, variable.names, n.iter, thin = 1,
type="trace", ...)
}
\arguments{
\item{model}{a jags model object}
\item{variable.names}{a character vector giving the names of variables
to be monitored}
\item{n.iter}{number of iterations to monitor}
\item{thin}{thinning interval for monitors}
\item{type}{type of monitor}
\item{...}{optional arguments passed to the update method for jags
model objects}
}
\details{
The \code{jags.samples} function creates monitors for the given
variables, runs the model for \code{n.iter} iterations and returns
the monitored samples.
}
\value{
A list of \code{mcarray} objects, with one element for each
element of the \code{variable.names} argument.
}
\examples{
data(LINE)
LINE$recompile()
LINE.samples <- jags.samples(LINE, c("alpha","beta","sigma"),
n.iter=1000)
LINE.samples
}
\author{Martyn Plummer}
\seealso{\code{\link{jags.model}}, \code{\link{coda.samples}}}
\keyword{models}