I am trying to simulate the Monte Carlo error bands for a 6-variable VAR model. The procedure @MCVARDoDraws and @MCGRAPHIRF are really helpful and make it much easier to do the simulation, but my case is that I use new coefficients and sigma matrices for the VAR, but not the estimated one.
Here are the problems.
1. when @MCVARDoDraws and @MCGRAPHIRF use %xx and other variables that should have been defined through "ESTIMATE", which I dont have for this VAR, the procedure automatically use the ones that are generated in last VAR. This gives error about matrix dimension because my last VAR is 4-variable.
2. Even I defined new sigma for this 6-variable VAR, the procedure will only use %sigma from "ESTIMATE", but not my newly assigned sigmas. From @MCVARDoDraws :
"compute fxx =%decomp(%xx)"
"compute fwish =%decomp(inv(%nobs*%sigma))"
3. In addition, I have quite a few similar 6-variable VAR to analyze, should I include @MCVARDoDraws and @MCGRAPHIRF in a do loop? How do I do that?
The only way I could think of is that I still do estimate for this 6*6 VAR, but reassign new coefficient matrix and sigmas,and I change the %sigma to sigma(i) in @MCVARDoDraws. Is there any other way to do it?
Code: Select all
DEC VECT[MODEL] Model(40)
DEC VECT[SYMM] Variance(40) fakesigma(40)
dec vect[rect] unneeded(40)
smpl 1975:1 2007:4
do i=1,40
system(model=model(i))
var q(i) p(i) A B C D
lags 1 to 2
end(system)
estimate(coeffs=unneeded(i),cvout=fakesigma(i), noprint) ;* I do ESTIMATE because @@MCVARDoDraws need some thing (e.g, %xx)defined by "ESTIMATE"
compute %modelsetcoeffs(model(i),B(i)) ; *new coefficients matrix calculated throug other process
compute %modelsetvcv(model(i),sigma(i)) ;* new covariance matrix calculated throug other process
end do i
source(echo) MCVARDoDraws.src
@MCVARDoDraws(model=model(5), draws=2000,steps=8, accumulate=||1,2,4,5,6||) ;* this is going to use the last sigma generated in VAR ESTIMATE which is fakesigma(40) I believe, what I want is to use sigma(5), what if I want bands for each of all 40 models?
source mcgraphirf.src
@mcgraphirf(model=model(5),center=median, percent=||.025,.975||, shocks=$ [u];* so the samething happens?[/u] ||"A", "B", "C", "D", "E","F"||,$
footer="95% Monte Carlo Bands")
Can I do this for each of the 40 models, i=1...40
[u]compute %sigma=sigma(i)[/u]
source(echo) MCVARDoDraws.src
@MCVARDoDraws(model=model(i), draws=2000,steps=8, accumulate=||1,2,4,5,6||)