Skip to content
Prev 4424 / 15274 Next

Creating a VCEM data generating process

Hi

To simulate a VECM you could look in package vars in the impulse 
response functions, as this implements a bootstrap procedure.However, 
this is rather a low level function and it is based I think on the VMA 
representation.

I implemented functions to simulate VAR and VECM in package tsDyn. The 
TVECM.sim() can only simulate bivariate models, whereas the TVAR.sim() 
can handle multiple variables. Examples pages for these functions 
include code to reproduce the examples in Enders. If you want to play 
with more than 2 variables, you could convert your VECM into a VAR with 
function vec2var() from package vars (you will need to cheat) and then 
use the var coef for TVAR.sim(). or just simply write yourself a 
function to simulate a VAR, should not be too complicated.

Here is a code to simulate trivariate VAR:
B1<-matrix(c(0.7, 0.2, 0.2, 0.2, 0.1, 0.3,0.1, 0.1, 0.3), nrow=3)
var1<-TVAR.sim(B=B1,nthresh=0,n=100, lag=1,type="simul", include="none", 
show.parMat=TRUE)
ts.plot(var1, type="l", col=1:3)

The arg varcov allows to specify the complete var-cov matrix of errors 
and hence have cross-correlation. If you want more complicated 
structures, create your erros series and input is with arg innov.

Note that this is with dev version of package tsDyn 
(http://code.google.com/p/tsdyn/wiki/ThresholdCointegration) that you 
will need to compile. A new version should come soon (next week).

Let us know if you find any interesting/illustrative examples of 
VAR/VECM simulation.

I do agree with Mark concerning the books. Lutkepohl is the last book to 
read... first read after Enders, then Hamilton and then Lutkpohl!

Bests

Matthieu

RON70 a ?crit :