Compute periodic autocorrelations from PAR coefficients
pcAR2acf.Rd
Compute periodic autocorrelations from PAR coefficients. This effectively solves the inverse problem to that solved by the periodic Levinson-Durbin algorithm but does not use a recursion.
Arguments
- coef
PAR coefficients, a matrix, see Details.
- sigma2
innovations variances.
- p
PAR order.
- maxlag
How many lags to compute.
Details
coef
is a matrix with the coefficients for season i
in
the i-th row. The coefficients start from lag 1.
The first few autocorrelations are computed by solving a linear system, see the references. The rest, are generated using the periodic Yule-Walker equations.
Value
a matrix, in which row s
contains the acf's for season s
for lags 0, 1, ..., maxlag (in this order).
References
Boshnakov GN (1996). “Recursive computation of the parameters of periodic autoregressive moving-average processes.” J. Time Ser. Anal., 17(4), 333--349. ISSN 0143-9782, doi: 10.1111/j.1467-9892.1996.tb00281.x .
Boshnakov GN, Boteva A (1992). “An algorithmfor the computation of the theoretical autocovariances of a periodic autoregression process.” Varna.
See also
pcarma_acvf_lazy
, which does the main computation, but note
that the coefficients for it start from lag zero
Examples
m <- rbind( c(0.81, 0), c(0.4972376, 0.4972376) )
si2 <- PeriodicVector(c(0.3439000, 0.1049724))
pcAR2acf(m)
#> [,1] [,2] [,3]
#> [1,] 5.306937 5.317206 4.279006
#> [2,] 6.564452 5.282723 5.908007
pcAR2acf(m, si2)
#> [,1] [,2] [,3]
#> [1,] 1.000000 0.8100006 0.7290005
#> [2,] 1.000001 0.9000006 0.9000007
pcAR2acf(m, si2, 2)
#> [,1] [,2] [,3]
#> [1,] 1.000000 0.8100006 0.7290005
#> [2,] 1.000001 0.9000006 0.9000007
pcAR2acf(m, si2, 2, maxlag = 10)
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7]
#> [1,] 1.000000 0.8100006 0.7290005 0.7290006 0.6561005 0.6561006 0.5904905
#> [2,] 1.000001 0.9000006 0.9000007 0.8100006 0.8100007 0.7290006 0.7290007
#> [,8] [,9] [,10] [,11]
#> [1,] 0.5904905 0.5314414 0.5314415 0.4782973
#> [2,] 0.6561005 0.6561006 0.5904905 0.5904906
# same using pcarma_acvf_lazy directly
m1 <- rbind( c(1, 0.81, 0), c(1, 0.4972376, 0.4972376) )
testphi <- slMatrix(init = m1)
myf <- pcarma_acvf_lazy(testphi, testtheta, si2, 2, 0, 2, maxlag = 10)
myf(1:2, 0:9) # get a matrix of values
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7]
#> [1,] 1.000000 0.8100006 0.7290005 0.7290006 0.6561005 0.6561006 0.5904905
#> [2,] 1.000001 0.9000006 0.9000007 0.8100006 0.8100007 0.7290006 0.7290007
#> [,8] [,9] [,10]
#> [1,] 0.5904905 0.5314414 0.5314415
#> [2,] 0.6561005 0.6561006 0.5904905
all(myf(1:2, 0:9) == pcAR2acf(m, si2, 2, maxlag = 9)) # TRUE
#> [1] TRUE