Auto-correlation computation
calc_acf.Rd
Computation of the auto-correlation function (ACF) or the cross-correlation function (CCF), if the argument 'y' is provided.
Arguments
- x
A numeric vector
- y
A numeric vector (default = NULL), that will be the value to compute the CCF
Examples
x <- rnorm(100)
calc_acf(x)
#> # A tibble: 21 × 2
#> acf lag
#> <dbl> <dbl>
#> 1 1 0
#> 2 -0.0893 1
#> 3 0.0206 2
#> 4 -0.0172 3
#> 5 -0.136 4
#> 6 -0.0597 5
#> 7 0.0324 6
#> 8 0.169 7
#> 9 -0.0795 8
#> 10 0.0389 9
#> # ℹ 11 more rows
y <- rexp(100)
calc_acf(x,y)
#> # A tibble: 33 × 2
#> ccf lag
#> <dbl> <dbl>
#> 1 0.0755 -16
#> 2 -0.143 -15
#> 3 0.200 -14
#> 4 -0.234 -13
#> 5 -0.0297 -12
#> 6 0.0284 -11
#> 7 0.0534 -10
#> 8 0.111 -9
#> 9 0.0848 -8
#> 10 -0.179 -7
#> # ℹ 23 more rows