Learn R Programming

BigVAR (version 1.1.2)

MultVarSim: Simulate a VAR

Description

Simulate a VAR

Usage

MultVarSim(k, A1, p, Sigma, T)

Value

Returns a \(T \times k\) of realizations from a VAR.

Arguments

k

Number of Series

A1

Either a \(k \times k\) coefficient matrix or a \(kp \times kp\) matrix created using VarptoVar1MC.

p

Maximum Lag Order

Sigma

Residual Covariance Matrix of dimension \(k\times k\)

T

Number of simulations

References

Lutkepohl, 'A New Introduction to Multiple Time Series Analysis'

See Also

VarptoVar1MC

Examples

Run this code
k=3;p=6
B=matrix(0,nrow=k,ncol=p*k)
A1<- matrix(c(.4,-.02,.01,-.02,.3,.02,.01,.04,.3),ncol=3,nrow=3)
A2 <- matrix(c(.2,0,0,0,.3,0,0,0,.13),ncol=3,nrow=3)
B[,1:k]=A1
B[,(4*k+1):(5*k)]=A2
A <- VarptoVar1MC(B,p,k)
Y <-MultVarSim(k,A,p,.1*diag(k),100)

Run the code above in your browser using DataLab