simulate.VAR {VAR.spec}R Documentation

Simulates a bivariate series from a bivariate VAR (Vector autoregression) model.

Description

Simulates a Gaussian bivariate series from a VAR model, described by an object of class var.

Usage

simulate.VAR(a.var, sample.size, burn.in = 1000)

Arguments

a.var

An object of class var, obtained from calculate.VAR. Actually only the attributes order and ar.list of a.var are needed.

sample.size

Integer. The size of the bivariate sample to be generated.

burn.in

Integer. The number of initial observations to be discarded. The bivariate series is simulated by iterating the VAR recursion, starting with white noise (with the covariance structure of the innovations, given in ar.list$var.pred ). This iteration converges to the correct distribution after a burn.in period, provided the roots of det are outside the unit circle, i.e. their inverses have a modulus less than 1. The closer roots of det are to the unit circle, the longer the burn.in period should be chosen.

Value

A numeric array of dimensions sample.sizex2, the bivariate sample series simulated from the VAR model.

See Also

VAR.spec-package, Init.var, calculate.VAR, plot_VAR.spectra, plot_VAR.Phase.details, calc.VAR.spec.from.coefs

Examples


my.var <- Init.var(grid=501, order.max.init=10, inv.roots.def=NULL)
my.var$inv.roots[2,]<- c(0.98,0.017261,2,3,1,1,2, rep(0,8))
my.var$inv.roots[3,]<- c(0.92,0.897598,2,1,1,1,2, rep(0,8))
my.var$inv.roots[4,]<- c(0.98,1.795196,1,1,0,1,1, rep(0,8))
my.var <- calculate.VAR(a.var=my.var,calc.method="from.det.cross",
                        suppr.spec.check.warn=TRUE)
print(my.var$validity.msg)
my.sample <-simulate.VAR(a.var=my.var, sample.size=250, burn.in = 500)


[Package VAR.spec version 1.0 Index]