Skip to contents

Returns autocorrelations indexed by lag in strict ascending order, so the lag index and the values always share the same ordering as the underlying series.

Usage

morie_ts_acf(x, lag_max = 20L, type = c("correlation", "covariance"))

Arguments

x

A numeric series or morie_ts.

lag_max

Maximum lag.

type

"correlation" or "covariance".

Value

A data.frame with columns lag (ascending) and value, plus a units attribute inherited from x.

Examples

morie_ts_acf(cumsum(rnorm(50)), lag_max = 5)
#>   lag     value
#> 1   0 1.0000000
#> 2   1 0.7748687
#> 3   2 0.5522889
#> 4   3 0.4086717
#> 5   4 0.3547471
#> 6   5 0.3616598