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

set.seed(1)
morie_ts_acf(cumsum(rnorm(50)), lag_max = 5)
#>   lag     value
#> 1   0 1.0000000
#> 2   1 0.8098372
#> 3   2 0.6274128
#> 4   3 0.4655057
#> 5   4 0.3735939
#> 6   5 0.2718343