autocorr {coda}R Documentation

Autocorrelation function for Markov chains


autocorr calculates the autocorrelation function for the Markov chain mcmc.obj at the lags given by lags. The lag values are taken to be relative to the thinning interval if relative=TRUE.

High autocorrelations within chains indicate slow mixing and, usually, slow convergence. It may be useful to thin out a chain with high autocorrelations before calculating summary statistics: a thinned chain may contain most of the information, but take up less space in memory. Re-running the MCMC sampler with a different parameterization may help to reduce autocorrelation.


autocorr(mcmc.obj, lags = c(0, 1, 5, 10, 50), relative=TRUE 


A vector or array containing the autocorrelations.


Martyn Plummer

See Also

acf, autocorr.plot.

[Package coda version 0.8-3 Index]