GMM Estimation with NKM

Hello to all,

I have been working on GMM estimation in a 3-equation New Keynesian model (the one described in https://sites.nd.edu/esims/files/2024/03/notes_new_keynesian_2024-1.pdf page 41), in order to match the data to the model I have followed the excellent guide https://drive.google.com/file/d/1r89OU5OE3CBa6tOlj6l3hNVWEaRH5Anv/view for obtaining the output gap, interest, and inflation rates. For all variables I have computed the log(var)-TREND, where the TREND is the one-sided HPF applied to the log series. For inflation var=Pt/(Pt-1) and for monetary policy rates var=(1+R/(4*100)).

Do you know why I could be getting these errors and very large values for some parameters when using the GMM procedure?

Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND =  1.100689e-20.

> In **\[mom.standard_errors\](matlab:matlab.lang.internal.introspective.errorDocCallback(‘mom.standard_errors’, ‘/Applications/Dynare/6.4-arm64/matlab/+mom/standard_errors.m’, 119))** (\[line 119\](matlab: opentoline(‘/Applications/Dynare/6.4-arm64/matlab/+mom/standard_errors.m’,119,0)))
> In **\[mom.run\](matlab:matlab.lang.internal.introspective.errorDocCallback(‘mom.run’, ‘/Applications/Dynare/6.4-arm64/matlab/+mom/run.m’, 588))** (\[line 588\](matlab: opentoline(‘/Applications/Dynare/6.4-arm64/matlab/+mom/run.m’,588,0)))
> In **\[Copy_of_NKMMM.driver\](matlab:matlab.lang.internal.introspective.errorDocCallback(‘Copy_of_NKMMM.driver’, ‘/Users/s/Documents/MacroCodesDynare/RBC_MoM/+Copy_of_NKMMM/driver.m’, 369))** (\[line 369\](matlab: opentoline(‘/Users/s/Documents/MacroCodesDynare/RBC_MoM/+Copy_of_NKMMM/driver.m’,369,0)))
> In **\[dynare\](matlab:matlab.lang.internal.introspective.errorDocCallback(‘dynare’, ‘/Applications/Dynare/6.4-arm64/matlab/dynare.m’, 308))** (\[line 308\](matlab: opentoline(‘/Applications/Dynare/6.4-arm64/matlab/dynare.m’,308,0)))

Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND =  1.100689e-20.

> In **\[mom.run\](matlab:matlab.lang.internal.introspective.errorDocCallback(‘mom.run’, ‘/Applications/Dynare/6.4-arm64/matlab/+mom/run.m’, 590))** (\[line 590\](matlab: opentoline(‘/Applications/Dynare/6.4-arm64/matlab/+mom/run.m’,590,0)))
> In **\[Copy_of_NKMMM.driver\](matlab:matlab.lang.internal.introspective.errorDocCallback(‘Copy_of_NKMMM.driver’, ‘/Users/s/Documents/MacroCodesDynare/RBC_MoM/+Copy_of_NKMMM/driver.m’, 369))** (\[line 369\](matlab: opentoline(‘/Users/s/Documents/MacroCodesDynare/RBC_MoM/+Copy_of_NKMMM/driver.m’,369,0)))
> In **\[dynare\](matlab:matlab.lang.internal.introspective.errorDocCallback(‘dynare’, ‘/Applications/Dynare/6.4-arm64/matlab/dynare.m’, 308))** (\[line 308\](matlab: opentoline(‘/Applications/Dynare/6.4-arm64/matlab/dynare.m’,308,0)))

RESULTS FROM GMM ESTIMATION
parameters
Estimate    s.d. t-stat

sigma       0.0781  0.0557  1.4020
rhou        0.0492  0.0714  0.6895
phiy     4317.6339 1032959.5307  0.0042
phipi    3837.7844 916518.6997  0.0042

standard deviation of shocks
          Estimate    s.d. t-stat

eps_r_f     0.0021  0.0005  4.6238 
eps_u       0.0057  0.0004 13.6162 
eps_v      78.3085 18726.3468  0.0042 

I will appreciate any comments. Thank you very much.

Copy_of_NKMMM.mod (948 Bytes)

mydata.mat (2.2 KB)

It seems your optimization got stuck in a corner solution. I got

RESULTS FROM GMM ESTIMATION
parameters
          Estimate    s.d. t-stat

sigma      -0.3415  0.1303  2.6203 
rhou        0.8769  0.0477 18.3785 
phiy       -0.1090  0.0324  3.3637 
phipi       0.0063  0.1481  0.0425 

standard deviation of shocks
          Estimate    s.d. t-stat

eps_r_f     0.0029  0.0003  9.8659 
eps_u       0.0007  0.0002  3.6226 
eps_v       0.0047  0.0007  6.7809 


Value of J-test statistic: 4.009296
p-value of J-test statistic: 0.548078


Comparison of matched data moments and model moments (GMM)
Moment                Data       Model
E[y*y]           0.0003834   0.0004233
E[i*i]           0.0000208   0.0000174
E[pi*pi]         0.0000536   0.0000271
E[y*pi]          0.0000631   0.0000578
E[y*i]           0.0000335   0.0000332
E[i*pi]          0.0000100   0.0000088
E[y*y(-1)]       0.0003031   0.0002843
E[pi*pi(-1)]     0.0000188   0.0000197
E[y*y(-3)]       0.0002119   0.0001542
E[pi*pi(-3)]     0.0000092   0.0000115
E[y*y(-5)]       0.0000372   0.0000987
E[pi*pi(-5)]    -0.0000032   0.0000073

You may need parameter bounds.