Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

autocorr.diag

Autocorrelation function for Markov chains


Description

autocorr.diag 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. Unlike autocorr, if mcmc.obj has many parmeters it only computes the autocorrelations with itself and not the cross correlations. In cases where autocorr would return a matrix, this function returns the diagonal of the matrix. Hence it is more useful for chains with many parameters, but may not be as helpful at spotting parameters.

If mcmc.obj is of class mcmc.list then the returned vector is the average autocorrelation across all chains.

Usage

autocorr.diag(mcmc.obj, ...)

Arguments

mcmc.obj

an object of class mcmc or mcmc.list

...

optional arguments to be passed to autocorr

Value

A vector containing the autocorrelations.

Author(s)

Russell Almond

See Also


coda

Output Analysis and Diagnostics for MCMC

v0.19-4
GPL (>= 2)
Authors
Martyn Plummer [aut, cre, trl], Nicky Best [aut], Kate Cowles [aut], Karen Vines [aut], Deepayan Sarkar [aut], Douglas Bates [aut], Russell Almond [aut], Arni Magnusson [aut]
Initial release
2020-09-30

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.