File: effectiveSize.Rd

package info (click to toggle)
r-cran-coda 0.13-2-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 456 kB
  • sloc: makefile: 2
file content (33 lines) | stat: -rw-r--r-- 893 bytes parent folder | download | duplicates (5)
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
\name{effectiveSize}
\alias{effectiveSize}
\title{Effective sample size for estimating the mean}
\description{
Sample size adjusted for autocorrelation.
}
\usage{
effectiveSize(x) 
}
\arguments{
\item{x}{An mcmc or mcmc.list object.}
}
\details{
For a time series \code{x} of length \code{N}, the standard error of
the mean is \code{var(x)/n} where \code{n} is the effective sample
size.  \code{n = N} only when there is no autocorrelation.

Estimation of the effective sample size requires estimating the
spectral density at frequency zero.  This is done by the function
\code{spectrum0.ar}

For a \code{mcmc.list} object, the effective sizes are summed across
chains.  To get the size for each chain individually use
\code{lapply(x,effectiveSize)}.  

}
\value{
A vector giving the effective sample size for each column of \code{x}.
}
\seealso{
   \code{\link{spectrum0.ar}}.
}
\keyword{ts}