tsDyn (version 0.8-1)

VAR.sim: Simulation of VAR

Description

Estimate or bootstraps a multivariate Threshold VAR

Usage

VAR.sim(B, n=200, lag=1, include = c("const", "trend","none", "both"), starting=NULL,  innov=rmnorm(n, mean=0, varcov=varcov), varcov=diag(1,nrow(B)), show.parMat=FALSE)

Arguments

B
Matrix of coefficients to simulate
n
Number of observations to create when type="simul"
lag
Number of lags to include in each regime
include
Type of deterministic regressors to include. NOT WORKING PROPERLY CURRENTLY if not const
starting
Starting values when a simulation with given parameter matrix is made
innov
Innovations used for simulation. Should be matrix of dim nxk. By default multivariate normal.
varcov
Variance-covariance matrix for the innovations. By default multivariate normal is used.
show.parMat
Logical. Should the parameter matrix be shown? Useful to understand how to give right input

Value

  • A matrix with the simulated/bootstraped series.

Details

Bootstrap a VAR model. K, the number of variables, is determined by the number of rows of B matrix.

See Also

lineVar to estimate a VAR/VECM, TVAR.sim to simulate/bootstrap a TVAR.

Examples

Run this code
##simulate VAR as in Enders 2004, p 268
B1<-matrix(c(0.7, 0.2, 0.2, 0.7), 2)
var1<-VAR.sim(B=B1,n=100,include="none")
ts.plot(var1, type="l", col=c(1,2))

Run the code above in your browser using DataLab