GMM estimation of nonlinear rational expectation models

Use this forum to post questions about syntax problems or general programming issues. Questions on implementing a particular aspect of econometrics should go in "Econometrics Issues" below.
xin_zh
Posts: 14
Joined: Mon Feb 25, 2013 5:59 pm

GMM estimation of nonlinear rational expectation models

Unread post by xin_zh »

Dear Tom,

I need your help with my GMM estimation of a nonlinear rational expectation model. The paper that talks about this estimation method is Hansen & Singleton (1982). I am so glad to find the example in RATS User's Guide page 137. I followed the steps there. However, I could not have any results. There were no error message. It seemed there were no estimation going on. The model and other details are in the attached word document; the data are in the excel; I also attach my codes and results here. Thank you very much for any suggestions of my mistakes or corrections!

Code: Select all

calendar(q) 1986:1
open data "E:\00RESEARCH\1With Randy\Risk Premium\OnFarm1.xls"
*
data(format=xls,org=columns) 1986:1 2002:4 St Pr ProdC StC Sale PPIiv tiv
*
set temp1 = Pr*Sale*((Sale+2*St)/(Sale+St)^2)
set temp2 = (Pr*Sale)/(Sale+St)

*
nonlin Disct TrC RAa RAb
frml h = Disct*0.97*(Pr(t)-TrC*temp1(t))*exp(RAa*((Pr(t)-TrC*temp2(t))*sale(t)-ProdC(t)-StC(t))+RAb*((Pr(t)-TrC*temp2(t))*sale(t)-ProdC(t)-StC(t))^2)$
         -(Pr(t-1)-2*TrC*temp2(t-1)+0.09)*exp(RAa*((Pr(t-1)-TrC*temp2(t-1))*sale(t-1)-ProdC(t-1)-StC(t-1))+RAb*((Pr(t-1)-TrC*temp2(t-1))*sale(t-1)-ProdC(t-1)-StC(t-1))^2)
compute Disct = .99,TrC = 0.01,RAa = -1,RAb = -1
*

instruments constant PPIiv tiv Pr{1 to 4}
nlls(inst,frml=h,optimal) *

Code: Select all

Nonlinear Instrumental Variables - Estimation by Gauss-Newton
Convergence in     1 Iterations. Final criterion was  0.0000000 <=  0.0000100
Quarterly Data From 1987:01 To 2002:04
Usable Observations                        64
Degrees of Freedom                         60
J-Specification(6)                     0.0000
Significance Level of J             1.0000000

    Variable                        Coeff      Std Error      T-Stat      Signif
************************************************************************************
1.  DISCT                         0.990000000  0.000000000      0.00000  0.00000000
2.  TRC                           0.010000000  0.000000000      0.00000  0.00000000
3.  RAA                          -1.000000000  0.000000000      0.00000  0.00000000
4.  RAB                          -1.000000000  0.000000000      0.00000  0.00000000
Attachments
OnFarm1.xls
(33.5 KiB) Downloaded 767 times
GMM.docx
(25.05 KiB) Downloaded 855 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: GMM estimation of nonlinear rational expectation models

Unread post by TomDoan »

The scale on some of your data series are enormous:

Code: Select all

Series             Obs       Mean        Std Error      Minimum       Maximum
ST                    68  488974985.29  345575175.28   43600000.00 1240000000.00
PR                    68          5.77          1.02          4.15          8.26
PRODC                 68 3184737557.14 2004291950.91          0.00 6478371400.00
STC                   68   44007748.68   31101765.78    3924000.00  111600000.00
SALE                  68  553504046.76  523495996.34  130070000.00 1731192000.00
PPIIV                 68        100.71         17.71         74.53        144.07
TIV                   68         34.50         19.77          1.00         68.00
TEMP1                 68          4.36          1.15          2.41          7.21
TEMP2                 68          3.03          1.01          1.37          5.71

With PRODC and STC showing up in the exponents, you have very little chance of getting that formula to produce non-zero values under computer floating point arithmetic. (You're getting the non-answers because with the guess values, H evaluates to zero). The RAa and Rab parameters would have to be tiny values to give you even a chance. You might want to think about the scaling the data.
xin_zh
Posts: 14
Joined: Mon Feb 25, 2013 5:59 pm

Re: GMM estimation of nonlinear rational expectation models

Unread post by xin_zh »

Dear Tom,

Thank you so much for your quick response! I changed the scales of some of the variables, and I got results.

Have a nice day!
Yingzi
Post Reply