Page 1 of 1

2-step GMM estimation of the Phillips curve

Posted: Fri Jul 25, 2014 5:09 pm
by asmith05
Hi,

I am trying to replicate the GMM estimates of Ravenna and Walsh, 2006 JME, "Optimal monetary policy with the cost channel." I am not able to exactly replicate their results (which could be partly due to data differences including gdp revisions and so on). But one aspect I think may be a source of the difference is my current inability to specify to RATS to perform 2-step GMM estimation vs recursive GMM.

This is the code I have:

Code: Select all

CALENDAR(Q) 1960:1
DATA(FORMAT=XLSX,ORG=COLUMNS) 1960:01 2001:01 rulc hpog gdpdefinfl pcomminfl termspread hrcompinfl gs3m  log_labor_income_share eff_ff
$$
set rulc = log(rulc)
set termspread = termspread/400
set gs3m       = gs3m/400
set eff_ff     = eff_ff/400
$$
compute mean_rulc      = %AVG(rulc)
compute mean_hpog      = %AVG(hpog)
compute mean_gdpdefinfl= %AVG(gdpdefinfl)
compute mean_pcomminfl = %AVG(pcomminfl)
compute mean_termspread= %AVG(termspread)
compute mean_hrcompinfl= %AVG(hrcompinfl)
compute mean_gs3m      = %AVG(gs3m)
compute mean_log_labor_income_share = %AVG(log_labor_income_share)
compute mean_eff_ff    = %AVG(eff_ff)
$$
set rulc       = rulc - mean_rulc
set hpog       = hpog - mean_hpog
set gdpdefinfl = gdpdefinfl - mean_gdpdefinfl
set pcomminfl  = pcomminfl  - mean_pcomminfl
set termspread = termspread - mean_termspread
set hrcompinfl = hrcompinfl - mean_hrcompinfl
set gs3m       = gs3m       - mean_gs3m
set log_labor_income_share = log_labor_income_share - mean_log_labor_income_share
set eff_ff     = eff_ff - mean_eff_ff
$$
compute alpha_k = 0.66667
compute theta   = 11
compute tau     = (1-alpha_k)/(1+alpha_k*(theta-1))
$$
nonlin omega beta alpha
frml h = omega*gdpdefinfl(t) - ((1-omega)*(1-beta*omega)*tau)*(log_labor_income_share(t) + alpha*gs3m(t)) - omega*beta*gdpdefinfl(t+1)
compute omega = 0.543, beta = 0.85, alpha =1.276 
$$
$$ ESTIMATE THE MODEL WITH 4 LAGS OF:
$$
instruments rulc{1 to 4} hpog{1 to 4} gdpdefinfl{1 to 4} pcomminfl{1 to 4} termspread{1 to 4} hrcompinfl{1 to 4} gs3m{1 to 4}
nlls(inst,piters=1000,iters=1000,frml=h,optimalweights,lwindow=newey,lags=3) *


I couldn't find in the manual where it specified whether this is going to perform a recursive GMM estimation or a 2-step. Could you please clarify this for me and also explain how I would specify whether I wanted the 2-step GMM estimators or the recursive estimator?

If you're curious about replicating the results, I would be happy to post the data file that I generated as well. FYI: I'm using RATS 8.3 if that is relevant.

Thanks!

Re: 2-step GMM estimation of the Phillips curve

Posted: Sat Jul 26, 2014 12:05 pm
by TomDoan
Two-step GMM for a non-linear model is a somewhat odd procedure, since you have to iterate to convergence a model with the "wrong" weight matrix, then change the weight matrix and do it all over again. Do NLLS with INSTRUMENTS, do an MCOV instruction with the instruments and the residuals and your LWINDOW options, then a second NLLS with INSTRUMENTS and WMATRIX=inv(%cmom). See Hayashi example HAYP250.RPF. (That's a LINREG rather than NLLS, but the idea is the same).

Re: 2-step GMM estimation of the Phillips curve

Posted: Wed Jul 30, 2014 1:43 pm
by asmith05
Hi Tom,

Thanks for the fast reply. Here is what I have now:

Code: Select all

CALENDAR(Q) 1959:1
DATA(FORMAT=XLSX,ORG=COLUMNS) 1959:01 2001:01 rulc labor_share hpog gdpdefinfl pcomminfl hrcompinfl termspread $
 gs3m fed_funds
$$
compute alpha_k = 1.0/3.0
compute theta   = 11
compute tau     = (1-alpha_k)/(1+alpha_k*(theta-1))
$$
$$
nonlin omega beta alpha
frml h = omega*gdpdefinfl(t) - ((1-omega)*(1-beta*omega)*tau)*(labor_share(t) + alpha*gs3m(t)) - omega*beta*gdpdefinfl(t+1)
compute omega = 0.4, beta = 0.98, alpha =0.5
$$
$$ ESTIMATE THE MODEL WITH 4 LAGS OF:
$$
instruments rulc{1 to 4} hpog{1 to 4} gdpdefinfl{1 to 4} pcomminfl{1 to 4} termspread{1 to 4} hrcompinfl{1 to 4} gs3m{1 to 4}
$$
$$ FIRST STAGE GMM: GET CONSISTENT BUT INEFFICIENT ESTIMATES
$$
nlls(instruments,frml=h) * /res0
$$
$$ SECOND STAGE GMM: USE THESE ESTIMATES TO CONSTRUCT NEWEY-WEST COVARIANCE/WEIGHT MATRIX TO FIND EFFICIENT ESTIMATES
$$
mcov(instruments,lwindow=newey,lags=3) /res0
compute wmat = inv(%CMOM)
nlls(inst,wmatrix=wmat,frml=h,robusterrors,lwindow=newey,lags=3) * 1960:01 *
Just to clarify, by default when using the optimalweights options, RATS updates the weighting matrix at each iteration of the optimization routine and therefore this gives the recursive GMM estimates? I am gathering this from your comment about 2-step GMM for a non-linear model being somewhat odd.

Thanks for your help!

Lee

Re: 2-step GMM estimation of the Phillips curve

Posted: Wed Jul 30, 2014 2:42 pm
by TomDoan
That's correct. OPTIMALWEIGHTS for NLLS redoes the weights after each iteration, so if there's a fixed point where beta-->weights-->same beta, it should find it. It's possible they wanted to do the two step for the non-linear model if they also did GMM with a linear model, where the two-step estimator is the most common.