View source: R/calc_functions.R
calc_autocorr | R Documentation |
Calculates the autocorrelation of a given sequence, or of the size of the steps (returns).
calc_autocorr(chain, change = TRUE, alpha = 0.05, lag.max = 100, plot = FALSE)
chain |
Vector of n length, where n is the number of trials or sampler iterations |
change |
Boolean. If true, plot the autocorrelation of the change series. If false, plot the autocorrelation of the given chain. |
alpha |
Measure of Type I error - defaults to .05 |
lag.max |
Length of the x axis. How far to examine the lags. |
plot |
Boolean. Whether to additionally plot the result. |
Markets display no significant autocorrelations in the returns of a given asset.
A vector with the standard deviations at each lag
set.seed(1)
chain1 <- sampler_mh(1, "norm", c(0,1), diag(1))
calc_autocorr(chain1[[1]], plot=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.