Learn R Programming

dynamichazard (version 1.0.2)

get_Q_0: Compute Time-Invariant Covariance Matrix

Description

Computes the invariant covariance matrix for a vector autoregression model.

Usage

get_Q_0(Qmat, Fmat)

Value

The invariant covariance matrix.

Arguments

Qmat

covariance matrix in transition density.

Fmat

coefficients in transition density.

Examples

Run this code
Fmat <- matrix(c(.8, .4, .1, .5), 2, 2)
Qmat <- matrix(c( 1, .5, .5,  2), 2)

x1 <- get_Q_0(Qmat = Qmat, Fmat = Fmat)
x2 <- Qmat
for(i in 1:101)
  x2 <- tcrossprod(Fmat %*% x2, Fmat) + Qmat
stopifnot(isTRUE(all.equal(x1, x2)))


Run the code above in your browser using DataLab