Query over MONTESVAR.RPF
Query over MONTESVAR.RPF
Dear Tom
I am learning SVAR (A-Model) using MONTESVAR.RPF to produce impulse responses. I have few questions to ask:
A) After running this file in Rats, I am getting impulse responses (of all variables) with shocks to only three variables namely ffed, fmi and gdph. In other words, I am getting matrix of the order (6*3). I do not understand why there is shock to only three variables. I want impulse responses when there is shock to all the variables i.e. I want matrix of the order (6*6). Please tell me how to do so. I even tried to define @MCGraphIRF command according to my requirement but it again produced the same result. So please help me how to get impulses responses of all the variables when there is shocks to all the variables.
B) my second query is regarding command "CVMODEL". Since here SVAR is overidentified, so when I apply "CVMODEL" command in Rats, I should get log likelihood statistics both for restricted and unrestricted model. I want these values in order to compare whether over-restrictions are statistically justified or not. However, using the command given in the file " MONTESVAR.RPF", I am not getting these values. Can you please help how to get these values?.
C) This query is regarding accumulated impulse responses. Suppose I have nine variables in SVAR model. Then What would be the command for accumulated response. Would that be Accum=||1,2,3,4,5,6,7,8,9|| or Accum=||1,2|| ???
Thanks and Regards
I am learning SVAR (A-Model) using MONTESVAR.RPF to produce impulse responses. I have few questions to ask:
A) After running this file in Rats, I am getting impulse responses (of all variables) with shocks to only three variables namely ffed, fmi and gdph. In other words, I am getting matrix of the order (6*3). I do not understand why there is shock to only three variables. I want impulse responses when there is shock to all the variables i.e. I want matrix of the order (6*6). Please tell me how to do so. I even tried to define @MCGraphIRF command according to my requirement but it again produced the same result. So please help me how to get impulses responses of all the variables when there is shocks to all the variables.
B) my second query is regarding command "CVMODEL". Since here SVAR is overidentified, so when I apply "CVMODEL" command in Rats, I should get log likelihood statistics both for restricted and unrestricted model. I want these values in order to compare whether over-restrictions are statistically justified or not. However, using the command given in the file " MONTESVAR.RPF", I am not getting these values. Can you please help how to get these values?.
C) This query is regarding accumulated impulse responses. Suppose I have nine variables in SVAR model. Then What would be the command for accumulated response. Would that be Accum=||1,2,3,4,5,6,7,8,9|| or Accum=||1,2|| ???
Thanks and Regards
Re: Query over MONTESVAR.RPF
See the comments in the program:sanjeev wrote:Dear Tom
I am learning SVAR (A-Model) using MONTESVAR.RPF to produce impulse responses. I have few questions to ask:
A) After running this file in Rats, I am getting impulse responses (of all variables) with shocks to only three variables namely ffed, fmi and gdph. In other words, I am getting matrix of the order (6*3). I do not understand why there is shock to only three variables. I want impulse responses when there is shock to all the variables i.e. I want matrix of the order (6*6). Please tell me how to do so. I even tried to define @MCGraphIRF command according to my requirement but it again produced the same result. So please help me how to get impulses responses of all the variables when there is shocks to all the variables.
Code: Select all
compute nshock=3
*
* Extract the P, U and I shocks
*
compute shockpui=%xcol(fsigmad,3)~%xcol(fsigmad,5)~%xcol(fsigmad,6)
impulse(noprint,model=varmodel,factor=shockpui,$
flatten=%%responses(draw),steps=nstep) nvar
impulse(noprint,model=varmodel,factor=fsigmad,$
flatten=%%responses(draw),steps=nstep) nvar
The CVMODEL is using the maximum posterior rather than the maximum likelihood so there is no likelihood ratio test available. You can do the same CVMODEL without the DMATRIX=MARGINALIZED to get a LR test.sanjeev wrote: B) my second query is regarding command "CVMODEL". Since here SVAR is overidentified, so when I apply "CVMODEL" command in Rats, I should get log likelihood statistics both for restricted and unrestricted model. I want these values in order to compare whether over-restrictions are statistically justified or not. However, using the command given in the file " MONTESVAR.RPF", I am not getting these values. Can you please help how to get these values?.
If you want to accumulate all nine, then yes, it would be the first.sanjeev wrote: C) This query is regarding accumulated impulse responses. Suppose I have nine variables in SVAR model. Then What would be the command for accumulated response. Would that be Accum=||1,2,3,4,5,6,7,8,9|| or Accum=||1,2|| ???
Re: Query over MONTESVAR.RPF
Thank you so much Sir.
Just need few clarifications:
1. Sir, I tried to run CVMODEL without the DMATRIX=MARGINALIZED but I am still not getting LR test. Can you please check?.
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.
3. In the user guide for Rats, it is mentioned that @MCGraphIRF command displays percentile bands, not standard errors. If you want standard error bands instead, you
can use the STDDEV option. Can you please tell me how to use STDDEV option?.
Thanks and Regards
Just need few clarifications:
1. Sir, I tried to run CVMODEL without the DMATRIX=MARGINALIZED but I am still not getting LR test. Can you please check?.
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.
3. In the user guide for Rats, it is mentioned that @MCGraphIRF command displays percentile bands, not standard errors. If you want standard error bands instead, you
can use the STDDEV option. Can you please tell me how to use STDDEV option?.
Thanks and Regards
Re: Query over MONTESVAR.RPF
If your model is just identified (I'm guessing it is from this behavior), there is nothing to test.sanjeev wrote:Thank you so much Sir.
Just need few clarifications:
1. Sir, I tried to run CVMODEL without the DMATRIX=MARGINALIZED but I am still not getting LR test. Can you please check?.
@MCGRAPHIRF doesn't (at this point) have options for accumulating responses. I'm working on a revision that will do that.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.
Use STDDEV=1 for one standard deviation, STDDEV=2 is for two standard deviations, etc.sanjeev wrote:3. In the user guide for Rats, it is mentioned that @MCGraphIRF command displays percentile bands, not standard errors. If you want standard error bands instead, you
can use the STDDEV option. Can you please tell me how to use STDDEV option?.
Re: Query over MONTESVAR.RPF
Actually Sir, my model is overidentified. Therefore, I want to do LR test. Is it possible to do LR test with monte carlo simulation using CVMODEL command??? If yes, please suggest me the required command.
Re: Query over MONTESVAR.RPF
The MC simulation has nothing to do with that---the LR test is done based upon the point estimates. You would have to post the program and data file for me to see why you're not getting the LR test.sanjeev wrote:Actually Sir, my model is overidentified. Therefore, I want to do LR test. Is it possible to do LR test with monte carlo simulation using CVMODEL command??? If yes, please suggest me the required command.
Re: Query over MONTESVAR.RPF
Hi Sir
1. I was applying following command of CVMODEL for Monte Carlo Simulation: cvmodel(parmset=simszha,dfc=ncoef,pdf=delta,dmatrix=marginalized,method=bfgs) vmat afrml. Using this command, I was not getting LR test.
2. And when I apply above command without option dmatrix=marginalized i.e. if I apply cvmodel(parmset=simszha,dfc=ncoef,pdf=delta,method=bfgs) vmat afrml , I am getting LR test.
However, when I apply this second command i.e. when I apply CVMODEL without option dmatrix=marginalized , my entire earlier results have got distorted. Can you please tell me why this is happening??. Am I making some mistake in defining this second command?? if yes, then how can I improve my results??
Basically, I am getting quite different results from two commands. So I was wondering to know which CVMODEL command to follow.
Thanks and Regards
1. I was applying following command of CVMODEL for Monte Carlo Simulation: cvmodel(parmset=simszha,dfc=ncoef,pdf=delta,dmatrix=marginalized,method=bfgs) vmat afrml. Using this command, I was not getting LR test.
2. And when I apply above command without option dmatrix=marginalized i.e. if I apply cvmodel(parmset=simszha,dfc=ncoef,pdf=delta,method=bfgs) vmat afrml , I am getting LR test.
However, when I apply this second command i.e. when I apply CVMODEL without option dmatrix=marginalized , my entire earlier results have got distorted. Can you please tell me why this is happening??. Am I making some mistake in defining this second command?? if yes, then how can I improve my results??
Basically, I am getting quite different results from two commands. So I was wondering to know which CVMODEL command to follow.
Thanks and Regards
Re: Query over MONTESVAR.RPF
If the results are very different, then your model is probably not well-estimated since the maximum log posterior and maximum likelihood should be similar with a weak prior like this.
ML would generally be reported as the "estimates", but the likelihood can't be used as the basis for the MC integration because it doesn't invert to a proper density function for this model.
ML would generally be reported as the "estimates", but the likelihood can't be used as the basis for the MC integration because it doesn't invert to a proper density function for this model.
Re: Query over MONTESVAR.RPF
Thank you so much for the reply Sir.
Few Clarifications:
1. According to you, I should use ML for parameter estimates of SVAR (I am using overidentified SVAR) but for monte carlo simulation, I should use maximum log posterior,
Is this what you are trying to say?
Actually, I have a overidentified SVAR model which I want to estimate using Monte Carlo simulation. Since it is an overidentified model, so I am also interested in doing LR test along with monte carlo simulation. This is my main objective.
So please suggest me what should be done?. What kind of CVMODEL command or any other command should I be using?.
2. Moreover, can you please tell me how to do diagnostics testing in this scenario (i.e. in case of overidentified SVAR with monte carlo simulation)? To be specific, I want to test for autocorrelation (preferably LM test), normality test and stability test in my overidentified SVAR model with monte carlo simulation. Please suggest me how I can do these tests. Please suggest me required command.
Thanks and Regards
Few Clarifications:
1. According to you, I should use ML for parameter estimates of SVAR (I am using overidentified SVAR) but for monte carlo simulation, I should use maximum log posterior,
Is this what you are trying to say?
Actually, I have a overidentified SVAR model which I want to estimate using Monte Carlo simulation. Since it is an overidentified model, so I am also interested in doing LR test along with monte carlo simulation. This is my main objective.
So please suggest me what should be done?. What kind of CVMODEL command or any other command should I be using?.
2. Moreover, can you please tell me how to do diagnostics testing in this scenario (i.e. in case of overidentified SVAR with monte carlo simulation)? To be specific, I want to test for autocorrelation (preferably LM test), normality test and stability test in my overidentified SVAR model with monte carlo simulation. Please suggest me how I can do these tests. Please suggest me required command.
Thanks and Regards
Re: Query over MONTESVAR.RPF
Yessanjeev wrote:Thank you so much for the reply Sir.
Few Clarifications:
1. According to you, I should use ML for parameter estimates of SVAR (I am using overidentified SVAR) but for monte carlo simulation, I should use maximum log posterior,
Is this what you are trying to say?
I believe that's already been covered above, and you already said you got the LR test.sanjeev wrote: Actually, I have a overidentified SVAR model which I want to estimate using Monte Carlo simulation. Since it is an overidentified model, so I am also interested in doing LR test along with monte carlo simulation. This is my main objective.
So please suggest me what should be done?. What kind of CVMODEL command or any other command should I be using?.
The simulations are used for one thing and one thing only---for error bands on impulse response functions. The autocorrelation, normality and stability tests are all done based upon the OLS estimates of the lag coefficients---the structural model doesn't even enter into this.sanjeev wrote: 2. Moreover, can you please tell me how to do diagnostics testing in this scenario (i.e. in case of overidentified SVAR with monte carlo simulation)? To be specific, I want to test for autocorrelation (preferably LM test), normality test and stability test in my overidentified SVAR model with monte carlo simulation. Please suggest me how I can do these tests. Please suggest me required command.
Re: Query over MONTESVAR.RPF
Thank you so much Sir
And I am sorry because my second question was not appropriately asked.
1. Actually Sir, I want to choose appropriate lag length for my SVAR model. Therefore, I applied lag length criteria (AIC, SBC, HQ, GTOS). However, I am getting different lag length from different lag length criteria [ for example AIC=3, SBC=2, HQ=1, GTOS=10]. Therefore, I was wondering whether I can apply LM test for autocorrelation (before running monte carlo simulation) to choose appropriate lag length.
So please suggest what I should do to select appropriate lag length. Which criteria should I use?. Or whether I can apply LM test for auto-correlation to choose appropriate lag length before running my SVAR model, if yes, then what is the required command for LM test in this case?
2. I want to get impulse response of only one variable when there is shock to all other variables in the SVAR model on each page i.e. each page should include impulse response of only one variable when there is shock to all other variables in the model. Please suggest me how to define @MCGraphIRF command to get this. I tried to do this by including option page=byvariable but it did not give me any result.
To be specific, i applied following command: @MCGraphIRF(model=varmodel,center=mean,stddev=2,page=byvariables,weights=weights,footer="95% Monte Carlo bands") to get response of each variable to all shocks on each page but I am not getting impulse responses (it says program has stopped working). I am attaching the commands below. Please check why I am not getting required impulse responses.
If there is something wrong, then please suggest me appropriate changes.
Thanks and Regards
And I am sorry because my second question was not appropriately asked.
1. Actually Sir, I want to choose appropriate lag length for my SVAR model. Therefore, I applied lag length criteria (AIC, SBC, HQ, GTOS). However, I am getting different lag length from different lag length criteria [ for example AIC=3, SBC=2, HQ=1, GTOS=10]. Therefore, I was wondering whether I can apply LM test for autocorrelation (before running monte carlo simulation) to choose appropriate lag length.
So please suggest what I should do to select appropriate lag length. Which criteria should I use?. Or whether I can apply LM test for auto-correlation to choose appropriate lag length before running my SVAR model, if yes, then what is the required command for LM test in this case?
2. I want to get impulse response of only one variable when there is shock to all other variables in the SVAR model on each page i.e. each page should include impulse response of only one variable when there is shock to all other variables in the model. Please suggest me how to define @MCGraphIRF command to get this. I tried to do this by including option page=byvariable but it did not give me any result.
To be specific, i applied following command: @MCGraphIRF(model=varmodel,center=mean,stddev=2,page=byvariables,weights=weights,footer="95% Monte Carlo bands") to get response of each variable to all shocks on each page but I am not getting impulse responses (it says program has stopped working). I am attaching the commands below. Please check why I am not getting required impulse responses.
If there is something wrong, then please suggest me appropriate changes.
Thanks and Regards
- Attachments
-
- MonteSVAR.RPF
- Monte Commands
- (5.44 KiB) Downloaded 995 times
Re: Query over MONTESVAR.RPF
Don't use GTOS to pick the lag length for a VAR. You probably have HQ and SBC backwards, since SBC can't pick a larger number than HQ. Given what you have and how you're using it, I would probably pick 4 lags. There's no real point to using LM tests since if there were significant autocorrelation left by any of the criteria, the lag length would have been higher.sanjeev wrote:Thank you so much Sir
And I am sorry because my second question was not appropriately asked.
1. Actually Sir, I want to choose appropriate lag length for my SVAR model. Therefore, I applied lag length criteria (AIC, SBC, HQ, GTOS). However, I am getting different lag length from different lag length criteria [ for example AIC=3, SBC=2, HQ=1, GTOS=10]. Therefore, I was wondering whether I can apply LM test for autocorrelation (before running monte carlo simulation) to choose appropriate lag length.
So please suggest what I should do to select appropriate lag length. Which criteria should I use?. Or whether I can apply LM test for auto-correlation to choose appropriate lag length before running my SVAR model, if yes, then what is the required command for LM test in this case?
What you posted is only a slight modification on the example program, it works fine and it does exactly what you want regarding the graph organization.sanjeev wrote: 2. I want to get impulse response of only one variable when there is shock to all other variables in the SVAR model on each page i.e. each page should include impulse response of only one variable when there is shock to all other variables in the model. Please suggest me how to define @MCGraphIRF command to get this. I tried to do this by including option page=byvariable but it did not give me any result.
To be specific, i applied following command: @MCGraphIRF(model=varmodel,center=mean,stddev=2,page=byvariables,weights=weights,footer="95% Monte Carlo bands") to get response of each variable to all shocks on each page but I am not getting impulse responses (it says program has stopped working). I am attaching the commands below. Please check why I am not getting required impulse responses.
If there is something wrong, then please suggest me appropriate changes.
I would very strongly recommend that you get the VAR e-course. Most of your questions are covered in detail in that.
Re: Query over MONTESVAR.RPF
I dont know why I am not getting required impulse responses. Whenever I run the previous file in Rats, I get error message i.e. ratsv8_std.exe has stopped working. Anyways Sir, thank you so much for help. There may be some software problem; i will try to fix it.
Last edited by sanjeev on Wed Jul 08, 2015 1:24 am, edited 2 times in total.
Re: Query over MONTESVAR.RPF
Before you worry about the "Structural" part of the SVAR (which itself looks like it might be a problem because of all the simultaneity), you need to get the basic VAR part fixed up. From what I can tell, you have GDP in levels (should be in logs), EXRATE in levels (should be in logs), SMI (whatever that is) in levels when it appears it should be in logs and NPCF (whatever that is) needs to somehow be deflated to have any value in a dynamic model with the other series.
Re: Query over MONTESVAR.RPF
Dear Sir
I have taken all my variables (apart from interest rates: LIBOR and INT_RATE) in logs 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
I have taken all my variables (apart from interest rates: LIBOR and INT_RATE) in logs 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
Last edited by sanjeev on Fri Jul 10, 2015 4:05 am, edited 5 times in total.