acf.fft {rtrend} | R Documentation |
faster autocorrelation based on ffw
Description
This function is 4-times faster than stats::acf()
Usage
acf.fft(x, lag.max = NULL)
Arguments
lag.max |
maximum lag at which to calculate the acf.
Default is |
Value
An array with the same dimensions as x containing the estimated autocorrelation.
References
https://github.com/santiagobarreda/phonTools/blob/main/R/fastacf.R
https://gist.github.com/FHedin/05d4d6d74e67922dfad88038b04f621c
https://gist.github.com/ajkluber/f293eefba2f946f47bfa
http://www.tibonihoo.net/literate_musing/autocorrelations.html#wikispecd
https://lingpipe-blog.com/2012/06/08/autocorrelation-fft-kiss-eigen
Examples
set.seed(1)
x <- rnorm(100)
r_fast <- acf.fft(x)
r <- acf(x, plot=FALSE, lag.max=100)$acf[,,1]
[Package rtrend version 0.1.5 Index]