Beyesian Error Bands Calculation

Questions and discussions on Vector Autoregressions
xswz
Posts: 4
Joined: Thu Nov 01, 2012 11:54 am

Beyesian Error Bands Calculation

Unread post by xswz »

Hello,

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||)
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Beyesian Error Bands Calculation

Unread post by TomDoan »

I'm a bit confused about what you are trying to do. I see that you have 40 VAR's. Are you trying combine the error bands from those, or are you trying to get 40 completely different sets of IRF's? Regarding %XX, how are you estimating the 40 VAR's in the first place? You should save the %XX from those and restore it when needed.
xswz
Posts: 4
Joined: Thu Nov 01, 2012 11:54 am

Re: Beyesian Error Bands Calculation

Unread post by xswz »

Hello Tom,

I am trying to do 40 different VARS and want completely different sets for IRFs, but these 40 VARs do have some common variables, so they are not completely irrelevant.

So I first estimated 40 different VARS, do some transformation for coefficients and sigmas, then reassign these new coeffs and sigma matrix (after taking care of dimensions) to new set of 40 VARS using different regressors, therefore, the %xx are different from the previous %xx.




TomDoan wrote:I'm a bit confused about what you are trying to do. I see that you have 40 VAR's. Are you trying combine the error bands from those, or are you trying to get 40 completely different sets of IRF's? Regarding %XX, how are you estimating the 40 VAR's in the first place? You should save the %XX from those and restore it when needed.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Beyesian Error Bands Calculation

Unread post by TomDoan »

@MCVARDODRAWS is expecting that the %SIGMA and %XX correspond to the MODEL that you provide, and that it (the MODEL) has the OLS coefficients for that model. If you are doing some transformations of the variables, then as long as you do all of those things correctly in back-transforming the output, it will work.
Post Reply