Learn R Programming

ggmcmc (version 0.3)

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

Description

Calculate the autocorrelation of a single chain, for a specified amount of lags.

Usage

ac(x, nLags)

Arguments

x
Vector with a chain of simulated values.
nLags
Numerical value with the maximum number of lags to take into account.

Value

  • A matrix with the autocorrelations of every chain.

Details

Internal function used by ggs_autocorrelation.

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