Compute PAR autocovariance matrix
pcacfMat.Rd
Compute PAR autocovariance matrix
Details
pc.acf.parModel
returns the autocovariances of a PAR model in
season-lag form with maximum lag equal to maxlag
. If
maxlag
is larger than the available precomputed
autocovariances, they missing ones are computed using the Yule-Walker
relations. Note that pc.acf.parModel
assumes that there are enough precomputed autocovariances to use the
Yule-Walker recursions directly.
TODO: pc.acf.parModel
is tied to the old classes since it accesses
their slots. Could be used as a template to streamline the method for
autocovariances
for class "PeriodicAutocovariance"
.
The season-lag form can be easily converted to other forms with the
powerful indexing operator, see the examples and slMatrix-class
.
pcacfMat
is a convenience function for statistical
inference. It creates a covariance matrix with dimension chosen
automatically. This covariance matrix is such that the asymptotic
covariance matrix of the estimated parameters can be obtained by dividing
sub-blocks by innovation variances and inverting them. See,
eq. (3.3) in the reference.
References
McLeod AI (1994). “Diagnostic checking of periodic autoregression models with application.” Journal of Time Series Analysis, 15(2), 221--233.
Examples
x <- arima.sim(list(ar = 0.9), n = 1000)
proba1 <- fitPM(c(3,2,2,2), x)
acfb <- pc.acf.parModel(proba1, maxlag = 8)
acfb[4:(-2), 4:(-2), type = "tt"]
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7]
#> [1,] 4.354767 4.076277 3.437176 3.145738 2.762350 2.631064 2.220523
#> [2,] 4.076277 4.690931 3.960936 3.625010 3.183214 3.031926 2.558836
#> [3,] 3.437176 3.960936 4.203584 3.834758 3.367974 3.207862 2.707318
#> [4,] 3.145738 3.625010 3.834758 4.462997 3.874579 3.693773 3.117554
#> [5,] 2.762350 3.183214 3.367974 3.874579 4.354767 4.076277 3.437176
#> [6,] 2.631064 3.031926 3.207862 3.693773 4.076277 4.690931 3.960936
#> [7,] 2.220523 2.558836 2.707318 3.117554 3.437176 3.960936 4.203584
pcacfMat(proba1)
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7]
#> [1,] 4.354767 4.076277 3.437176 3.145738 2.762350 2.631064 2.220523
#> [2,] 4.076277 4.690931 3.960936 3.625010 3.183214 3.031926 2.558836
#> [3,] 3.437176 3.960936 4.203584 3.834758 3.367974 3.207862 2.707318
#> [4,] 3.145738 3.625010 3.834758 4.462997 3.874579 3.693773 3.117554
#> [5,] 2.762350 3.183214 3.367974 3.874579 4.354767 4.076277 3.437176
#> [6,] 2.631064 3.031926 3.207862 3.693773 4.076277 4.690931 3.960936
#> [7,] 2.220523 2.558836 2.707318 3.117554 3.437176 3.960936 4.203584