Learn R Programming

batchmeans (version 1.0-1)

bm: Perform consistent batch means estimation on a vector of values from a Markov chain.

Description

Perform consistent batch means estimation on a vector of values from a Markov chain.

Usage

bm(x, size = "sqroot", warn = FALSE)

Arguments

x
a vector of values from a Markov chain.
size
the batch size. The default value is "sqroot", which uses the square root of the sample size. "cuberoot" will cause the function to use the cube root of the sample size. A numeric value may be provided if neither "s
warn
a logical value indicating whether the function should issue a warning if the sample size is too small (less than 1,000).

Value

  • bm returns a list with two elements:
  • estthe mean of the vector.
  • sethe MCMC standard error based on the consistent batch means estimator.

References

Jones, G. L., Haran, M., Caffo, B. S. and Neath, R. (2006) Fixed-width output analysis for Markov chain Monte Carlo. Journal of the American Statistical Association, 101, 1537--1547.

The following article is less technical and contains a direct comparison to the Gelman-Rubin diagnostic.

Flegal, J. M., Haran, M. and Jones, G. L. (2008) Markov chain Monte Carlo: Can we trust the third significant figure? Statistical Science, 23, 250--260.

See Also

bmmat, which applies bm to each column of a matrix or data frame.