View source: R/VAR_procs_20240530.R
simulate.VAR | R Documentation |
Simulates a Gaussian bivariate series from a VAR model, described by an object of class var
.
simulate.VAR(a.var, sample.size, burn.in = 1000)
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 |
A numeric array of dimensions sample.size
x2, the bivariate sample series simulated from the VAR model.
VAR.spec-package
, Init.var
, calculate.VAR
,
plot_VAR.spectra
, plot_VAR.Phase.details
,
calc.VAR.spec.from.coefs
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.