GMM estimation of the LSTR model
GMM estimation of the LSTR model
Dear Tom,
I am trying to estimate a logistic smooth transition Taylor rule for Turkey using the attached code. Based on the modified codes of the user manual of Enders, I try to find the best threshold value and gamma with grid search. But the results are not as expected and nonlinear parameter estimates are not close to linear ones. I also attached the data file. I would really appreciate your help me to find what is wrong with the coding.
Regards
I am trying to estimate a logistic smooth transition Taylor rule for Turkey using the attached code. Based on the modified codes of the user manual of Enders, I try to find the best threshold value and gamma with grid search. But the results are not as expected and nonlinear parameter estimates are not close to linear ones. I also attached the data file. I would really appreciate your help me to find what is wrong with the coding.
Regards
- Attachments
-
- 2016_jan_19_tr_taylor_2002_fsi_june_14.xls
- excel_file
- (50.5 KiB) Downloaded 922 times
-
- tr_m2_fsi_2016_jan26_estima_sent_3.rpf
- rats file
- (1.65 KiB) Downloaded 990 times
Re: GMM estimation of the LSTR model
First of all, NLSYSTEM doesn't even define %RSS (since %RSS is a univariate measure and NLSYSTEM is by nature a multivariate instruction). But even if it did, why would you use the sum of squared residuals as a selection criterion for a model being estimated by instrumental variables?
Re: GMM estimation of the LSTR model
Is there any way to obtain optimum threshold value of the transition variable with IV estimation?
Re: GMM estimation of the LSTR model
Is this a new idea of yours, or did you get it from an existing paper?
Re: GMM estimation of the LSTR model
Actually there are several papers applying this LSTR GMM methodology. I e-mailed the following authors to request the codes of the following papers but do not get any response. Therefore I decided to write my own code.
Areosa, Waldyr, Michael McAleer and Marcelo C. Medeiros (2011). Moment Based Estimation of Smooth Transition Regression Models with Endogenous Variables, Journal of Econometrics.
Martin, C. and Milas, C., 2013. Financial crises and monetary policy:evidence from the UK. Journal of Financial Stability, 9 (4), pp. 654-661.
There is also another paper using a two-regime threshold GMM model not smooth transition. The codes of the paper written in RATS attached in the rar file. Is it possible to convert this code into smooth transition?
Taylor, Mark P. and Davradakis, Emmanuel. (2006) Interest rate setting and inflation targeting : evidence of a nonlinear Taylor rule for the United Kingdom. Studies in Nonlinear Dynamics & Econometrics, Vol.10 (No.4). ISSN 1558-3708
Areosa, Waldyr, Michael McAleer and Marcelo C. Medeiros (2011). Moment Based Estimation of Smooth Transition Regression Models with Endogenous Variables, Journal of Econometrics.
Martin, C. and Milas, C., 2013. Financial crises and monetary policy:evidence from the UK. Journal of Financial Stability, 9 (4), pp. 654-661.
There is also another paper using a two-regime threshold GMM model not smooth transition. The codes of the paper written in RATS attached in the rar file. Is it possible to convert this code into smooth transition?
Taylor, Mark P. and Davradakis, Emmanuel. (2006) Interest rate setting and inflation targeting : evidence of a nonlinear Taylor rule for the United Kingdom. Studies in Nonlinear Dynamics & Econometrics, Vol.10 (No.4). ISSN 1558-3708
- Attachments
-
- snde1359_supplementary_1 (3).zip
- rats codes
- (27.08 KiB) Downloaded 839 times
Re: GMM estimation of the LSTR model
The first of the three papers (I assume the others are similar) use the criterion function for 2SLS (equation (3) in that paper). That's the %UZWZU variable created by NLLS or NLSYSTEM. You do not want to use OPTIMALWEIGHTS on NLLS (that's the easier instruction for a single equation model) since that would give a different weight matrix for each value of the threshold and thus wouldn't give comparable criteria.
Re: GMM estimation of the LSTR model
Dear Tom,
I modified the code above as follows using nlls instuction. The results are not again as expected and the parameters of the model do not converge. What do you think?
I modified the code above as follows using nlls instuction. The results are not again as expected and the parameters of the model do not converge. What do you think?
Code: Select all
calendar 2002 1 12
allocate 2014:06
open data 2016_jan_19_tr_taylor_2002_fsi_june_14.xls
data(format=xls,org=cols)
table
*
set ly = log(y)
source(noecho) hpfilter.src
@hpfilter(lambda=14400.0) ly / smooth
set gap = 100*(ly - smooth)
*
graph(key=below, overlay=line) 2
# inf
# gap
*
instruments constant r{1 to 4} inf{1 to 4} gap{1 to 4} fsi{1 to 4}
*
com startd = 2006:01
com endd = 2014:06
linreg r
# r{1} inf{-3} gap
nonlin c1 c2 c3
compute c1=c2=c3=0.0
frml trule r = c1*r{1}+ c2*inf{-1} + c3*gap
nlsystem(instruments) / trule
stats(fractiles) fsi 2006:01 *
*
nonlin f1 f2 f3 g1 g2 g3 gamma c
linreg r startd endd
# r{1} inf{-3} gap
com f1 = %beta(1), f2 = %beta(2), f3 = %beta(3),g1 = 0, g2 = 0, g3 = 0
stats(fractile) fsi
com c=%mean, gamma=1.0/sqrt(%variance)
frml trule2 r = f1*r{1}+f2*inf{-3}+f3*gap+(g1*r{1} + g2*inf{-3}+g3*gap)*%logistic(gamma*(fsi{1}-c),1.0)
nlls(ins, frml=trule2,print) r startd endd
*
compute bestrss=%na
dofor c = %seqa(%fract10,(%fract90-%fract10)/19,20)
compute gamma=1.0/sqrt(%variance)
nlls(instruments, frml=trule) r startd endd
nlls(instruments, frml=trule2) r startd endd
if .not.%valid(bestrss).or.%rss<bestrss
compute bestrss=%rss,bestc=c,bestgamma=gamma
end dofor
*
disp "Grid choices" bestc bestgamma bestrss
*
nonlin f1 f2 f3 g1 g2 g3 gamma c
linreg r startd endd
# r{1} inf{-3} gap
com f1 = %beta(1), f2 = %beta(2), f3 = %beta(3),g1 = 0.8, g2 = 0.05, g3 = 0.04
compute c=bestc,gamma=bestgamma
frml trule2 r = f1*r{1}+f2*inf{-3}+f3*gap+(g1*r{1} + g2*inf{-3}+g3*gap)*%logistic(gamma*(fsi{1}-c),1.0)
nlls(instruments,print, iters=100000, frml=trule2) r startd endd
Re: GMM estimation of the LSTR model
You're still doing the grid search over %RSS values rather than %UZWZU.
Re: GMM estimation of the LSTR model
Dear Tom,
Thanks for your help. I modified grid search part of the code but there are still some problems about the convergence and significance of the parameters.
Thanks for your help. I modified grid search part of the code but there are still some problems about the convergence and significance of the parameters.
Code: Select all
calendar 2002 1 12
allocate 2014:06
open data 2016_jan_19_tr_taylor_2002_fsi_june_14.xls
data(format=xls,org=cols)
table
*
set ly = log(y)
source(noecho) hpfilter.src
@hpfilter(lambda=14400.0) ly / smooth
set gap = 100*(ly - smooth)
*
graph(key=below, overlay=line) 2
# inf
# gap
*
instruments constant r{1 to 6} inf{1 to 6} gap{1 to 6} fsi{1 to 6}
*
com startd = 2006:01
com endd = 2014:06
linreg r
# r{1} inf{-3} gap
nonlin c1 c2 c3
compute c1=c2=c3=0.0
frml trule r = c1*r{1}+ c2*inf{-1} + c3*gap
nlsystem(instruments) / trule
stats(fractiles) fsi 2006:01 *
*
nonlin f1 f2 f3 g1 g2 g3 gamma c
linreg r startd endd
# r{1} inf{-3} gap
com f1 = %beta(1), f2 = %beta(2), f3 = %beta(3),g1 = 0.10, g2 = 0.05, g3 = 0.05
stats(fractile) fsi
com c=%mean, gamma=1.0/sqrt(%variance)
frml trule2 r = f1*r{1}+f2*inf{-3}+f3*gap+(g1*r{1} + g2*inf{-3}+g3*gap)*%logistic(gamma*(fsi{1}-c),1.0)
nlls(ins, frml=trule2,print) r startd endd
*
compute bestwzu=%na
dofor c = %seqa(%fract25,(%fract75-%fract25)/19,20)
compute gamma=1.0/sqrt(%variance)
nlls(instruments, frml=trule) r startd endd
nlls(instruments, frml=trule2) r startd endd
if .not.%valid(bestwzu).or.%UZWZU<bestwzu
compute bestwzu=%UZWZU,bestc=c,bestgamma=gamma
end dofor
*
disp "Grid choices" bestc bestgamma bestwzu
*
nonlin f1 f2 f3 g1 g2 g3 gamma c
linreg r startd endd
# r{1} inf{-3} gap
com f1 = %beta(1), f2 = %beta(2), f3 = %beta(3),g1 = 0.1, g2 = 0.05, g3 = 0.05
compute c=bestc,gamma=bestgamma
frml trule2 r = f1*r{1}+f2*inf{-3}+f3*gap+(g1*r{1} + g2*inf{-3}+g3*gap)*%logistic(gamma*(fsi{1}-c),1.0)
nlls(instruments,print, iters=100000, frml=trule2) r startd endd
Re: GMM estimation of the LSTR model
Note that that would be completely explained if there aren't two regimes.
However, your initial loop is flawed. You still have C in the parameter set, so regardless of what your intentions are, it's trying to estimate transition point. You need to use a different PARMSET that leaves C out when you try to fix that. You also need to use the NOZUDEP option to make sure it doesn't recompute the weight matrices. However, you also need to accept the fact that the results may be telling you that the LSTR isn't necessary.
However, your initial loop is flawed. You still have C in the parameter set, so regardless of what your intentions are, it's trying to estimate transition point. You need to use a different PARMSET that leaves C out when you try to fix that. You also need to use the NOZUDEP option to make sure it doesn't recompute the weight matrices. However, you also need to accept the fact that the results may be telling you that the LSTR isn't necessary.
Re: GMM estimation of the LSTR model
Dear Tom,
I have another crucial question. The variables in the model above have different order of integration. Inflation and interest rate are non-stationary whereas output gap is I(0). I have to use GMM due to endogenity problem but I know from the literature GMM with nonstationary variables may yield inconsistent parameter estimates. But most of the Taylor rule studies ignore this fact and directly apply GMM to the level of the variables since the original paper is based on the levels of the variables. I found the following theoretical paper describing the application of Fully modified IV .
Kitamura Y. and Phillips P. C. B. 1994 "Fully Modified IV, GIVE and GMM Estimation with Possibly Non-Stationary Regressions and Instruments"JOURNAL OF ECONOMETRICS 80(1):85-123 · OCTOBER 1994.
available at http://cowles.yale.edu/sites/default/fi ... /d1082.pdf
Is it possible to apply fully modified IV with RATS I am using version 9.0
Best Regards
I have another crucial question. The variables in the model above have different order of integration. Inflation and interest rate are non-stationary whereas output gap is I(0). I have to use GMM due to endogenity problem but I know from the literature GMM with nonstationary variables may yield inconsistent parameter estimates. But most of the Taylor rule studies ignore this fact and directly apply GMM to the level of the variables since the original paper is based on the levels of the variables. I found the following theoretical paper describing the application of Fully modified IV .
Kitamura Y. and Phillips P. C. B. 1994 "Fully Modified IV, GIVE and GMM Estimation with Possibly Non-Stationary Regressions and Instruments"JOURNAL OF ECONOMETRICS 80(1):85-123 · OCTOBER 1994.
available at http://cowles.yale.edu/sites/default/fi ... /d1082.pdf
Is it possible to apply fully modified IV with RATS I am using version 9.0
Best Regards