This function computes the theoretical Autocorrelation (ACF) of an ARMA process.

theo_acf(ar, ma = NULL, lagmax = 20)

Arguments

ar

A vector containing the AR coefficients.

ma

A vector containing the MA coefficients.

lagmax

An integer indicating the maximum lag up to which to compute the theoretical ACF.

Author

Yuming Zhang

Examples

# Compute the theoretical ACF for an ARMA(1,0) (i.e. a first-order autoregressive model: AR(1))
theo_acf(ar = -0.25, ma = NULL)
#> , , Theoretical
#> 
#>      Theoretical
#> 0   1.000000e+00
#> 1  -2.500000e-01
#> 2   6.250000e-02
#> 3  -1.562500e-02
#> 4   3.906250e-03
#> 5  -9.765625e-04
#> 6   2.441406e-04
#> 7  -6.103516e-05
#> 8   1.525879e-05
#> 9  -3.814697e-06
#> 10  9.536743e-07
#> 11 -2.384186e-07
#> 12  5.960464e-08
#> 13 -1.490116e-08
#> 14  3.725290e-09
#> 15 -9.313226e-10
#> 16  2.328306e-10
#> 17 -5.820766e-11
#> 18  1.455192e-11
#> 19 -3.637979e-12
#> 20  9.094947e-13
#> 
#> attr(,"type")
#> [1] "Autocorrelation"
#> attr(,"n")
#> [1] 20
#> attr(,"class")
#> [1] "simtsACF" "array"   
# Computes the theoretical ACF for an ARMA(2, 1)
theo_acf(ar = c(.50, -0.25), ma = 0.20, lagmax = 10)
#> , , Theoretical
#> 
#>      Theoretical
#> 0   1.0000000000
#> 1   0.5050000000
#> 2   0.0025000000
#> 3  -0.1250000000
#> 4  -0.0631250000
#> 5  -0.0003125000
#> 6   0.0156250000
#> 7   0.0078906250
#> 8   0.0000390625
#> 9  -0.0019531250
#> 10 -0.0009863281
#> 
#> attr(,"type")
#> [1] "Autocorrelation"
#> attr(,"n")
#> [1] 10
#> attr(,"class")
#> [1] "simtsACF" "array"