Page 2 of 3

Re: Query over MONTESVAR.RPF

Posted: Tue Jul 07, 2015 8:19 am
by TomDoan
sanjeev wrote:Thank you so much for your suggestion.

Actually Sir, I thought of taking all my variables (apart from interest rates) in Logs. But there are two series, namely, NPCF (net private capital flow to developing countries) and FISDIFC (fiscal deficit) which has negative values for some months and therefore log of these series is not defined. Can you please suggest me what to do in this case? i mean how to deflate these series???. My objective is to study the determinants of private capital flow to developing country with SVAR model.
Deflate by a price index or by nominal GDP.
sanjeev wrote: Also please tell me what do you mean by simultaneity? is it concern with my identification restrictions or something else?
Your 3-4-5 equations and 8-9 equations are very similar and will be "identified" only by whether a few stray coefficients are zero or non-zero.

Re: Query over MONTESVAR.RPF

Posted: Wed Jul 08, 2015 1:20 am
by sanjeev
Dear Sir

I have taken all my variables in logs (apart from interest rates; LIBOR, INT_RATE) as suggested by you. However, I have few clarifications. Please help me.

1. Can I use programming defined in file, namely, MONTESVAR.RPF, for my over-identified SVAR model with monte carlo simulation (of course, variables and identification restriction will be defined by me)? I am attaching a file below, where I have my own variables and identification restrictions. Assuming that my variables and identification restrictions are true, will the programming defined in the attached file will work for Monte Carlo simulation in my case?

2. Given that I use same programming as defined under file, MONTESVAR.RPF [refer the attached file], I am getting slightly different (or very different for some variables) impulse responses and variance decomposition, each time I run a new simulation i.e each new simulation results in a slightly different (or very different for some variables) impulse responses and variance decomposition functions. Please tell why is this happening? and Which result should I stick to?

Or whether I need to fix some initial values so that I get same results each time I run a new simulation [which is often done with simulation techniques], If yes, then Please tell how to fix these initial values so that my results do not differ when I run a new simulation.

3. Given that I use same programming as defined under file, MONTESVAR.RPF [refer the attached file], my LR test always reject the null hypothesis. Rejection means my over-identificated SVAR is not statistically justified. I think my identification restrictions are well defined and are well based on economic theory and empirical observations. I dont know what to do in this case. Because on the one hand, LR test is getting rejected, while on the hand, I have no alternative identification restrictions. I just want to ask, is this a big problem? is LR test that necessary for over-identified SVAR model?

Or whether I can just ignore LR test results and continue with my SVAR model as it is.

Thanks and Regards

Re: Query over MONTESVAR.RPF

Posted: Wed Jul 08, 2015 8:18 am
by TomDoan
  1. You need to do something about your NPCF variable. As it enters the model, it won't interact well with the other data.
  2. It's pointless to do the Monte Carlo integration until you've gotten the model to converge. In the program you sent, the CVMODEL tells you it hasn't converged. Pay attention to that.
  3. Your model is overwhelmingly rejected. A chi-squared(2) of over 200 means that whatever you may think, the data think your model is wrong.
  4. You're getting an effective sample size of around 100 out of 10000 draws. That's why the results vary from run to run.

Re: Query over MONTESVAR.RPF

Posted: Wed Jul 08, 2015 9:10 am
by sanjeev
Thank you so much for the reply Sir

a. Sir, Can you please tell me why the variable NPCF is creating problem?. Actually Sir NPCF (net private capital flow to developing country) is a monthly series. So it is difficult to deflate it with respect to nominal GDP (as nominal GDP is available only quarterly). Please suggest

b. Yes, I noticed that it is not converging. Can you please suggest me why it is not converging? what to do in this case? do I need to change the identification restrictions or the model itself?. What is the immediate solution?

c. What should be done so that results do not vary run to run?? please suggest

Finally, I do not know why it is creating the problem despite the fact that restrictions have been imposed purely on the basis of economic theory and empirical observations :( :(

Thanks and Regards

Re: Query over MONTESVAR.RPF

Posted: Wed Jul 08, 2015 9:50 am
by TomDoan
sanjeev wrote:Thank you so much for the reply Sir

a. Sir, Can you please tell me why the variable NPCF is creating problem?. Actually Sir NPCF (net private capital flow to developing country) is a monthly series. So it is difficult to deflate it with respect to nominal GDP (as nominal GDP is available only quarterly). Please suggest
Have you ever graphed the series? As you put it into the model, it's effectively zero for half the data set. You're dummying out the two spikes which helps with the fit for the NPCF series itself, but the spike values will still be included as lagged data in all the equations, so that's likely to push the coefficients on NPCF towards zero.

It's your data and your model. If this is the nominal capital flows, you need to think about why you think the nominal value that will have an effect on real GDP and other real-dominated values. Just because there's no perfect way to deflate it doesn't mean that you should just slap it into the model as is.
sanjeev wrote: b. Yes, I noticed that it is not converging. Can you please suggest me why it is not converging? what to do in this case? do I need to change the identification restrictions or the model itself?. What is the immediate solution?
The message that I get is that it's not converged in 100 iterations. That seems to suggest increasing the iteration limit.
sanjeev wrote: c. What should be done so that results do not vary run to run?? please suggest
That's putting the cart before the horse. Get the model to work first.
sanjeev wrote: Finally, I do not know why it is creating the problem despite the fact that restrictions have been imposed purely on the basis of economic theory and empirical observations :( :(
Although the identification mechanism for an SVAR is different, consider page one of a standard description of simultaneous equations. Supply is p as a function of q. Demand is p as a function of q. Perfectly good economic theory. Except you can't estimate either the supply or the demand curve if that's all you have.

Here, the data are telling you your "theory" is wrong.

Re: Query over MONTESVAR.RPF

Posted: Thu Jul 09, 2015 4:22 am
by sanjeev
Thank you so much Sir. I will try to modify my model as per suggestion.

However, I have few clarifications:

1. You suggested me to increase the iteration limit. Please tell me how to do that in the programming.

2. Actually Sir, I was working on file, MONTESVAR. Here I found that if I interchange the two rows of contemporaneous matrix, the impulse responses have also got interchanged (approx.) despite the fact that two rows belong to different variables having different restrictions. For example; I have attached two Rats files below; first is original file MonteSVAR and second is modified MonteSVAR. After running the first file, I saved the impulse response of variable ffed to LR and FMI separately. Then in the second file, I interchanged the raw2 (which belongs to FM1) with raw5 (which belongs to LR). Now when I run the second file, I find that impulse responses have got interchanged i.e. impulse response of ffed to FM1 in the second model is more or less same as impulse response of ffed to LR in the first model ; similarly impulse response of ffed to LR in the second model is more or less same as impulse response of ffed to FM1 in the first model. This is very puzzling because LR and FM1 are two different variables having different restrictions. Please clarify.

Thanks and Regards

Re: Query over MONTESVAR.RPF

Posted: Thu Jul 09, 2015 7:56 am
by TomDoan
sanjeev wrote:Thank you so much Sir. I will try to modify my model as per suggestion.

However, I have few clarifications:

1. You suggested me to increase the iteration limit. Please tell me how to do that in the programming.
CVMODEL is included in the Reference Manual. The ITERATIONS option controls that for CVMODEL and basically all other non-linear estimation instructions.
sanjeev wrote: 2. Actually Sir, I was working on file, MONTESVAR. Here I found that if I interchange the two rows of contemporaneous matrix, the impulse responses have also got interchanged (approx.) despite the fact that two rows belong to different variables having different restrictions. For example; I have attached two Rats files below; first is original file MonteSVAR and second is modified MonteSVAR. After running the first file, I saved the impulse response of variable ffed to LR and FMI separately. Then in the second file, I interchanged the raw2 (which belongs to FM1) with raw5 (which belongs to LR). Now when I run the second file, I find that impulse responses have got interchanged i.e. impulse response of ffed to FM1 in the second model is more or less same as impulse response of ffed to LR in the first model ; similarly impulse response of ffed to LR in the second model is more or less same as impulse response of ffed to FM1 in the first model. This is very puzzling because LR and FM1 are two different variables having different restrictions. Please clarify.
You would also have to switch the columns in order to do a complete remap. If you look at where the normalization "1"'s are, the second shock in the revised program is actually for the fifth variable and the fifth shock is for the second. So the automatic labeling by series names doesn't work.

Re: Query over MONTESVAR.RPF

Posted: Tue Jul 14, 2015 8:28 am
by sanjeev
Hi Sir

1. In the file Monte SVAR, CVMODEL command has been mentioned two times;
a) compute delta=3.5
cvmodel(parmset=simszha,dfc=ncoef,pdf=delta,dmatrix=marginalized,method=bfgs) vmat afrml
dec rect faxx

b) compute a =afrml(1)
compute dhat =a*vmat*tr(a)
compute ddiag =%xdiag(dhat)
cvmodel(parmset=simszha,dfc=ncoef,pdf=delta,dmatrix=marginalized,method=evaluate) vmat afrml
compute pdensity=%funcval

Please tell, Why this command have been mentioned two times?. Can we not get answer only by mentioning only a) or b). Do you need to mention a) and b) together to do Monte Carlo Simulation? if yes, then why?

2. Hi Sir, I have now deflated the series NPCF (net private capital flow) and getting convergence in 127 iteration. But despite that my LR test is rejecting the null hypothesis of over-identification. I have checked the same at all possible model specifications. I dont know what to do. I just want to ask, is this a big problem? is LR test that necessary for over-identified SVAR model?
Or whether I can just ignore LR test results and continue with my SVAR model as it is.

Thanks and Regards

Re: Query over MONTESVAR.RPF

Posted: Tue Jul 14, 2015 10:21 am
by TomDoan
sanjeev wrote:Hi Sir

1. In the file Monte SVAR, CVMODEL command has been mentioned two times;
a) compute delta=3.5
cvmodel(parmset=simszha,dfc=ncoef,pdf=delta,dmatrix=marginalized,method=bfgs) vmat afrml
dec rect faxx

b) compute a =afrml(1)
compute dhat =a*vmat*tr(a)
compute ddiag =%xdiag(dhat)
cvmodel(parmset=simszha,dfc=ncoef,pdf=delta,dmatrix=marginalized,method=evaluate) vmat afrml
compute pdensity=%funcval

Please tell, Why this command have been mentioned two times?. Can we not get answer only by mentioning only a) or b). Do you need to mention a) and b) together to do Monte Carlo Simulation? if yes, then why?
Again, CVMODEL is in the Reference Manual. Note that the second use has METHOD=EVALUATE, which doesn't estimate the model (like the first), but simply evaluates the posterior at the test settings. This is all part of the importance sampling process which you can read about in the User's Guide. Also, this is covered in great detail as part of the VAR e-course. Again, I would really strongly urge you to buy that so you can understand what you're doing.
sanjeev wrote: 2. Hi Sir, I have now deflated the series NPCF (net private capital flow) and getting convergence in 127 iteration. But despite that my LR test is rejecting the null hypothesis of over-identification. I have checked the same at all possible model specifications. I dont know what to do. I just want to ask, is this a big problem? is LR test that necessary for over-identified SVAR model?
Or whether I can just ignore LR test results and continue with my SVAR model as it is.
If you're still getting a chi-square(2) with a value of 100 or more, you really shouldn't be ignoring it---you're being told that your structural model is really missing something important.

Re: Query over MONTESVAR.RPF

Posted: Tue Jul 14, 2015 10:35 am
by TomDoan
sanjeev wrote: 2. Is that possible to get accumulated response when we do monte carlo simulation for error bands. If yes, then please provide the appropriate command. Because I tried to get accumulated responses by writing accum=||1,2,3,4,5,6,7,8,9|| [as I have 9 variables in my model] in the option of @MCGraphIRF but I got error. Please suggest.
I've posted updated versions of @MCGRAPHIRF and @MCPROCESSIRF which has ACCUM options.

Re: Query over MONTESVAR.RPF

Posted: Wed Jul 15, 2015 12:52 am
by sanjeev
Thank you so much Sir for informing me about new updates regarding option Accumulate.

1. However, I applied the following command to get accumulated IRF:

@MCGraphIRF(model=varmodel,center=mean,stddev=2,page=byshock,Accumulate=||1,2,3,4,5,6,7,8,9||,weights=weights,footer="95% Monte Carlo bands")

But I am still getting following error message: ## OP3. This Instruction Does Not Have An Option ACC
>>>>byshock,Accumulate=<<<<

Please tell how to defined @MCGraphIRF command to IRF with accumulated response. I have 8.1 Version Rats, Do I need to update it?, if yes, How?

2. Yes, I am getting Chi square greater than 100 at all possible model combinations and identification restrictions. I really do not know what to do. Do I need to exclude or include some variable?. what are your suggestion in general?. What can be done?

3. Lastly sir, none of error bands of my impulse responses are converging in the first period (period 0). I means I am getting error bands for impulse responses like in figure1 (where error bands are not converging in period 0) instead of error bands for impulse responses like in figure2 (where error bands are converging in period 0). [refer the attachment]. Please tell me why this is happening and how can I get impulses responses like mentioned in figure2?

Thanks and Regards

Re: Query over MONTESVAR.RPF

Posted: Wed Jul 15, 2015 8:19 am
by TomDoan
sanjeev wrote:Thank you so much Sir for informing me about new updates regarding option Accumulate.

1. However, I applied the following command to get accumulated IRF:

@MCGraphIRF(model=varmodel,center=mean,stddev=2,page=byshock,Accumulate=||1,2,3,4,5,6,7,8,9||,weights=weights,footer="95% Monte Carlo bands")

But I am still getting following error message: ## OP3. This Instruction Does Not Have An Option ACC
>>>>byshock,Accumulate=<<<<

Please tell how to defined @MCGraphIRF command to IRF with accumulated response. I have 8.1 Version Rats, Do I need to update it?, if yes, How?


Download the newer version using the link in the forum post. However, why do you want accumulated responses anyway? What's the meaning of an accumulated response of (say) interest rates?

sanjeev wrote: 2. Yes, I am getting Chi square greater than 100 at all possible model combinations and identification restrictions. I really do not know what to do. Do I need to exclude or include some variable?. what are your suggestion in general?. What can be done?


A nine variable model is a bit large for a first go at an SVAR. Did you ever consider starting with something more similar to what's in the literature?

sanjeev wrote: 3. Lastly sir, none of error bands of my impulse responses are converging in the first period (period 0). I means I am getting error bands for impulse responses like in figure1 (where error bands are not converging in period 0) instead of error bands for impulse responses like in figure2 (where error bands are converging in period 0). [refer the attachment]. Please tell me why this is happening and how can I get impulses responses like mentioned in figure2?


You're completely misunderstanding this. In general, period 0 responses should have a non-trivial spread since they're based upon sample covariance matrices. They "converge" (which is a poor choice of word) only if they are forcibly zero because of the structure of the model.

Re: Query over MONTESVAR.RPF

Posted: Thu Jul 16, 2015 5:00 am
by sanjeev
Respected Sir

1. Accumulated impulse response is cumulative sum of impulse response functions. We derive accumulated impulse response when variable of interest is in first difference or in growth form. I asked about the command for Accumulated responses just out of curiosity not to bother you in any way. :(

2. Sir, I agree that a nine variable model is bit large to go for SVAR. However, my theoretical model says that there should be at least 9 variables. That is why I could not reduce number of variables to include. Can you suggest something in this regard?

3. Lastly I am attaching two impulse responses below; figure1 (one form of identification) and figure2 (another form of identification). In the figure1, the error band in period 0 is very spread while in figure2, the error band in period 0 is smooth. Given that both the identification forms are acceptable, which figure should I go with?. I mean which figure (figure1 or figure2) is more accurate or acceptable?

Or whether It does not matter whether I chose figure1 or figure2 [which differs only in terms of error bands in period 0].

Actually Sir, I am more comfortable with first form of identification (which results in figure1) but because of very spread error bands in the period 0, I was wondering whether it is a good result. Please suggest.

Thanks and Regards

Re: Query over MONTESVAR.RPF

Posted: Thu Jul 16, 2015 7:45 am
by TomDoan
sanjeev wrote:Respected Sir

1. Accumulated impulse response is cumulative sum of impulse response functions. We derive accumulated impulse response when variable of interest is in first difference or in growth form. I asked about the command for Accumulated responses just out of curiosity not to bother you in any way. :(

2. Sir, I agree that a nine variable model is bit large to go for SVAR. However, my theoretical model says that there should be at least 9 variables. That is why I could not reduce number of variables to include. Can you suggest something in this regard?
Work with Cholesky factors until you better understand the data. You're wasting a lot of time with a contemporaneous model that obviously doesn't work.
sanjeev wrote: 3. Lastly I am attaching two impulse responses below; figure1 (one form of identification) and figure2 (another form of identification). In the figure1, the error band in period 0 is very spread while in figure2, the error band in period 0 is smooth. Given that both the identification forms are acceptable, which figure should I go with?. I mean which figure (figure1 or figure2) is more accurate or acceptable?

Or whether It does not matter whether I chose figure1 or figure2 [which differs only in terms of error bands in period 0].

Actually Sir, I am more comfortable with first form of identification (which results in figure1) but because of very spread error bands in the period 0, I was wondering whether it is a good result. Please suggest.

Thanks and Regards
You don't pick a structural model based upon which one has the "smallest" initial error bands.

Re: Query over MONTESVAR.RPF

Posted: Fri Jul 17, 2015 4:42 am
by sanjeev
Thank you so much Sir for your suggestions.

Last question:

Suppose that I have identified my SVAR model. Now given this, if I get a impulse response which has shape like in figure1 i.e. if error bands in the period 0 are very spread, is this problematic? even if impulse responses are as expected by the theory.

Thanks and Regards,