R/VAR1.sim.R

Defines functions VAR1.sim

VAR1.sim <-
function(a0,a1,n,sigu)
{
nob <- 50+n
x <- matrix(0,nrow=nob,ncol=2)
tem <- chol(sigu)
for (i in 2:nob)
x[i,] <-  a0 + a1 %*% matrix(x[i-1,]) + crossprod(tem, matrix(rnorm(2),nrow=2))
return(x[51:nob,])
}

Try the VAR.etp package in your browser

Any scripts or data that you put into this service are public.

VAR.etp documentation built on Aug. 31, 2023, 9:08 a.m.