autocov_VAR1 {stcos} | R Documentation |
Compute the autocovariance matrix for a VAR(1) process.
Description
Compute the autocovariance matrix for a VAR(1) process.
Usage
autocov_VAR1(A, Sigma, lag_max)
Arguments
A |
Coefficient matrix |
Sigma |
Covariance matrix |
lag_max |
maximum number of lags to compute. |
Details
Computes the autocovariance matrix of the
-dimensional VAR(1) process
For the required computation of , this function
solves the
system
without directly computing matrices.
Value
An array Gamma
of dimension c(m, m, lag_max + 1)
,
where the slice Gamma[,,h]
represents the autocovariance at lag
h = 0, 1, ..., lag_max
.
Examples
U = matrix(NA, 3, 3)
U[,1] = c(1, 1, 1) / sqrt(3)
U[,2] = c(1, 0, -1) / sqrt(2)
U[,3] = c(0, 1, -1) / sqrt(2)
B = U %*% diag(c(0.5, 0.2, 0.1)) %*% t(U)
A = (B + t(B)) / 2
Sigma = diag(x = 2, nrow = 3)
autocov_VAR1(A, Sigma, lag_max = 5)
[Package stcos version 0.3.1 Index]