pcAR2acf | R Documentation |
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.
pcAR2acf(coef, sigma2, p, maxlag = 10)
coef |
PAR coefficients, a matrix, see Details. |
sigma2 |
innovations variances. |
p |
PAR order. |
maxlag |
How many lags to compute. |
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.
a matrix, in which row s
contains the acf's for season s
for lags 0, 1, ..., maxlag (in this order).
Georgi N. Boshnakov
boshnakov1996pcarmapcts
\insertRefb:Varna92pcts
pcarma_acvf_lazy
, which does the main computation, but note
that the coefficients for it start from lag zero
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.