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 |
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 |
Value
A numeric array of dimensions sample.size
x2, 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)