Learn R Programming

ggmcmc (version 0.2)

ac: Compute the autocorrelation of a single chain, for a specified amount of lags

Description

Internal function used by ggs_autocorrelation.

Usage

ac(x, nLags)

Arguments

x
vector with a chain of simulated values
nLags
maximum number of lags to take into account

Value

  • a matrix with the autocorrelations of every chain

Examples

Run this code
# Calculate the autocorrelation of a simple vector
ac(cumsum(rnorm(10))/10, nLags=4)

Run the code above in your browser using DataLab