pcAR2acf {pcts} | R Documentation |
Compute periodic autocorrelations from PAR coefficients
Description
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.
Usage
pcAR2acf(coef, sigma2, p, maxlag = 10)
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).
Author(s)
Georgi N. Boshnakov
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 algorithm for 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)
pcAR2acf(m, si2)
pcAR2acf(m, si2, 2)
pcAR2acf(m, si2, 2, maxlag = 10)
# 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
all(myf(1:2, 0:9) == pcAR2acf(m, si2, 2, maxlag = 9)) # TRUE