pcAR2acf: Compute periodic autocorrelations from PAR coefficients

View source: R/PeriodicCalc.R

pcAR2acfR 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

\insertRef

boshnakov1996pcarmapcts

\insertRef

b:Varna92pcts

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


GeoBosh/pcts documentation built on Dec. 8, 2023, 9:57 p.m.