Balke(2000) Threshold VAR
Balke(2000) Threshold VAR
This is a replication file for Balke(2000), "Credit and Economic Activity: Credit Regimes and Nonlinear Propagation of Shocks," Review of Economics and Statistics, vol 82, 344-349. One program finds the optimal threshold and the second computes the non-linear IRF's as described in the paper, averaging responses across all observed periods in a given regime. (This is set for doing the upper regime; changing upper=1 to upper=0 in the initial part will switch this).
This is covered in detail as part of the 2nd Edition of the Structural Breaks and Switching Models course.
Zip with programs/data
Detailed description
This is covered in detail as part of the 2nd Edition of the Structural Breaks and Switching Models course.
Zip with programs/data
Detailed description
-
kathywangyan
- Posts: 2
- Joined: Sun Feb 08, 2015 4:24 am
Re: Balke(2000) Threshold VAR
Dear Tom,
I have some questions about the codes given.
Taking into account the nonlinear characteristic of TVAR model, how should i modify the irf codes to obtain the response of y to one unit or 1% GDP shock? In the codes given, the shock are 1 or 2 SD, and it will be wrong if i just rescaled the response of y to 1 SD shock, in order to obtain the response of y to 1% GDP shock. How should i modify the irf part of the codes if i want the shock to be fixed at 1% GDP or other value?
Thank you very much for your help!
sincerely yours
yan wang
I have some questions about the codes given.
Taking into account the nonlinear characteristic of TVAR model, how should i modify the irf codes to obtain the response of y to one unit or 1% GDP shock? In the codes given, the shock are 1 or 2 SD, and it will be wrong if i just rescaled the response of y to 1 SD shock, in order to obtain the response of y to 1% GDP shock. How should i modify the irf part of the codes if i want the shock to be fixed at 1% GDP or other value?
Thank you very much for your help!
sincerely yours
yan wang
- Attachments
-
- question about tvar irf.RPF
- (756 Bytes) Downloaded 1638 times
Last edited by kathywangyan on Mon Feb 09, 2015 7:16 pm, edited 1 time in total.
Re: Balke(2000) Threshold VAR
Balke's model and, in particular, his bootstrap method doesn't really lend itself to that because the covariance matrix switches as well, so everything needs to be standardized to unit standard deviations.
-
kathywangyan
- Posts: 2
- Joined: Sun Feb 08, 2015 4:24 am
Re: Balke(2000) Threshold VAR
Thank you very much. So it is possible to fixed the shock to be equal to 1% GDP using other simulate methods, for example the MCMC method in paper "state-dependent effects of fiscal policy"(Fazzari et at 2014), am i right?TomDoan wrote:Balke's model and, in particular, his bootstrap method doesn't really lend itself to that because the covariance matrix switches as well, so everything needs to be standardized to unit standard deviations.
Another question
Re: Balke(2000) Threshold VAR
That's correct. The MCMC procedure takes the data as given, which avoids the problem of having to re-flate standardized residuals.kathywangyan wrote:Thank you very much. So it is possible to fixed the shock to be equal to 1% GDP using other simulate methods, for example the MCMC method in paper "state-dependent effects of fiscal policy"(Fazzari et at 2014), am i right?TomDoan wrote:Balke's model and, in particular, his bootstrap method doesn't really lend itself to that because the covariance matrix switches as well, so everything needs to be standardized to unit standard deviations.
TVAR_IRF is basically doing that, though it does the added step of averaging across initial conditions rather than just going with one. It generates simulated processes and switches regimes based upon the simulated values. That's what's happening with:kathywangyan wrote: Another question. In the RATS codes given, for the whole forecast horizon ( irf horizon) the forecast model would be fixed (either upper regime or lower regime), is it possible to modify the codes so that for certain initial start (either upper or lower), the forecast model could switch according to the forecast value of the endogenous credit variable which is also the threshold variable. Actually, as a result of the shock, the forecast value of credit variable could become larger or smaller and then may also switch the model to the other.
do i=1,nvar
frml tvarf(i) depvars(i) = %if(thrfrml{d}>thresh,$
fitud(&i,1)+%dot(%xrow(sup,&i),bootres),$
fitud(&i,2)+%dot(%xrow(sdn,&i),bootres))
end do i-
Darth Nisis
- Posts: 6
- Joined: Wed Oct 07, 2015 7:39 am
Re: Balke(2000) Threshold VAR
Hi Tom
I´m trying to modify this code in order to estimate a multiple breaks TVAR model. In order to do so, first i need to calculate the appropriate thresholds values.
Suppose I wish to calculate simultaneously two thresholds values, for two different threshold variables, so that observations of the model will be grouped in four different regimes:
Regime 1: Threshold variable "A" above Threshold vale "a" + Threshold variable "B" above Threshold value "b".
Regime 2: Threshold variable "A" above Threshold vale "a" + Threshold variable "B" below Threshold value "b".
Regime 3: Threshold variable "A" below Threshold vale "a" + Threshold variable "B" above Threshold value "b".
Regime 4: Threshold variable "A" below Threshold vale "a" + Threshold variable "B" below Threshold value "b".
I attach you my modified code. Although the code runs ok, I´m not sure if its actually doing what i want it to do.
Best Regards!
Juan
I´m trying to modify this code in order to estimate a multiple breaks TVAR model. In order to do so, first i need to calculate the appropriate thresholds values.
Suppose I wish to calculate simultaneously two thresholds values, for two different threshold variables, so that observations of the model will be grouped in four different regimes:
Regime 1: Threshold variable "A" above Threshold vale "a" + Threshold variable "B" above Threshold value "b".
Regime 2: Threshold variable "A" above Threshold vale "a" + Threshold variable "B" below Threshold value "b".
Regime 3: Threshold variable "A" below Threshold vale "a" + Threshold variable "B" above Threshold value "b".
Regime 4: Threshold variable "A" below Threshold vale "a" + Threshold variable "B" below Threshold value "b".
I attach you my modified code. Although the code runs ok, I´m not sure if its actually doing what i want it to do.
Best Regards!
Juan
- Attachments
-
- tvar_pass_through.RPF
- (3.29 KiB) Downloaded 1461 times
Re: Balke(2000) Threshold VAR
This won't work:
sweep(var=hetero,group=(yma{d}<thresh1)+(xma{d}<thresh2)) rstart rend
You need to multiply one of the two test criteria (doesn't really matter which) by 2 to get a "binary representation" of the regime, i.e.
sweep(var=hetero,group=(yma{d}<thresh1)+2*(xma{d}<thresh2)) rstart rend
which will have group value 0 for both less, group value 1 for y<thresh1, x>thresh2, group value 2 for y>thresh1 and x<thresh2 and group value 3 for both >. Also, as you have that written, both the thresholds move together. If you want those chosen completely independently, then you need a double nested loop (over pientry and pientryx for instance).
sweep(var=hetero,group=(yma{d}<thresh1)+(xma{d}<thresh2)) rstart rend
You need to multiply one of the two test criteria (doesn't really matter which) by 2 to get a "binary representation" of the regime, i.e.
sweep(var=hetero,group=(yma{d}<thresh1)+2*(xma{d}<thresh2)) rstart rend
which will have group value 0 for both less, group value 1 for y<thresh1, x>thresh2, group value 2 for y>thresh1 and x<thresh2 and group value 3 for both >. Also, as you have that written, both the thresholds move together. If you want those chosen completely independently, then you need a double nested loop (over pientry and pientryx for instance).
-
Darth Nisis
- Posts: 6
- Joined: Wed Oct 07, 2015 7:39 am
Re: Balke(2000) Threshold VAR
Dear TomTomDoan wrote:This won't work:
sweep(var=hetero,group=(yma{d}<thresh1)+(xma{d}<thresh2)) rstart rend
You need to multiply one of the two test criteria (doesn't really matter which) by 2 to get a "binary representation" of the regime, i.e.
sweep(var=hetero,group=(yma{d}<thresh1)+2*(xma{d}<thresh2)) rstart rend
which will have group value 0 for both less, group value 1 for y<thresh1, x>thresh2, group value 2 for y>thresh1 and x<thresh2 and group value 3 for both >. Also, as you have that written, both the thresholds move together. If you want those chosen completely independently, then you need a double nested loop (over pientry and pientryx for instance).
Thanks for your response, it was very helpful. I find the threshold values that i needed, and using the same logic you suggested, I was able to adapt the other code and estimate a multiple threasholds TVAR model. I attach the program for any fellow RATS user that wish to try it (in the code i attach, there are essentially 3 regimes, not 4, because now I´m using the exact same threshold variable, with two different breaks, for the final estimation).
- Attachments
-
- tvar_pass_through_irf_2breaksinfla.RPF
- (13.9 KiB) Downloaded 1569 times
-
Darth Nisis
- Posts: 6
- Joined: Wed Oct 07, 2015 7:39 am
Re: Balke(2000) Threshold VAR
Dear TomTomDoan wrote:Balke's model and, in particular, his bootstrap method doesn't really lend itself to that because the covariance matrix switches as well, so everything needs to be standardized to unit standard deviations.
One more question. In Balke´s model, a 1 SD shock in variable X for a given regime, corresponds to the 1 SD for such variable for the whole model, or only for the specific regime? In other words, a 1 SD shock has the same size across regimes, or its different?
Best Regards,
Juan
Re: Balke(2000) Threshold VAR
Hi Tom.
I have used the RATS code you created for the following paper "Credit and Economic Activity: Credit Regimes and Nonlinear Propagation of Shocks," Review of Economics and Statistics, vol 82, 344-349 for my research. Thank you so much. I have been trying to find the critical values for the threshold value. As I read Balke (2000) I think he is replicating the critical values using Bruce Hansen's procedure. I can find the Hansen procedure from the forum but they are for TAR. Since in the above paper it uses a TVAR, how do we obtain the critical values? I will sincerely appreciate your thoughts on this.
Thanks
I have used the RATS code you created for the following paper "Credit and Economic Activity: Credit Regimes and Nonlinear Propagation of Shocks," Review of Economics and Statistics, vol 82, 344-349 for my research. Thank you so much. I have been trying to find the critical values for the threshold value. As I read Balke (2000) I think he is replicating the critical values using Bruce Hansen's procedure. I can find the Hansen procedure from the forum but they are for TAR. Since in the above paper it uses a TVAR, how do we obtain the critical values? I will sincerely appreciate your thoughts on this.
Thanks
Re: Balke(2000) Threshold VAR
The tvar_test.rpf program does a fixed regressor bootstrap, which is Hansen's procedure. While the specific example in Hansen's paper is for a TAR, the idea extends to multivariate models as well. For instance, Hansen-Seo(2002) uses that for threshold cointegration.
Re: Balke(2000) Threshold VAR
Hi Tom.
Thanks once again. I am a bit confused from your response. Is there a procedure in RATS tvar_test.rpf which does the simulation of the critical values? I could not find it. I can find for a single equation case. Please advice.
Thanks
Haydory Akbar Ahmed
Thanks once again. I am a bit confused from your response. Is there a procedure in RATS tvar_test.rpf which does the simulation of the critical values? I could not find it. I can find for a single equation case. Please advice.
Thanks
Haydory Akbar Ahmed
Re: Balke(2000) Threshold VAR
Starting at the comment line that says "Fixed regressor bootstrap" it does the fixed regressor bootstrap for the TVAR model being studied.
-
Darth Nisis
- Posts: 6
- Joined: Wed Oct 07, 2015 7:39 am
Re: Balke(2000) Threshold VAR
Hi Tom
Would it be possible to adapt the code ir order to estimate the model with non-Gaussian errors? Would it be necessary to use of maximize instruction?
Thanks,
Juan
Would it be possible to adapt the code ir order to estimate the model with non-Gaussian errors? Would it be necessary to use of maximize instruction?
Thanks,
Juan
Re: Balke(2000) Threshold VAR
Since it's a multivariate regression, there aren't really all that many options for non-Gaussian distributions and there are no simple algorithms for doing the estimation---it's a full-scale likelihood maximization across all the parameters of the (two branches) of the VAR. Plus, I would doubt that you would end up with a threshold itself being much different if you did.