Moment matching in borrower/saver DSGE model

I am trying to perform moment matching in a simple borrower/saver DSGE model (a replication of Rubio and Carrasco Gallego (2014)), but although I believed I followed all the steps explained in the manual (and here: Method of Moments (GMM and SMM) Estimation in Dynare 4.7 and 5 - YouTube), the result does not look great.

Data for the estimation is fed to the .mod file through RCC_data.mat, whose calculations are in data_manipulation.m: real gdp per capita is logged and filtered, gross inflation is the log difference of CPI +1 and the quarterly gross nominal interest rate is the fed funds rate de-annualized.

As my model is non-linear, in the.mod file I also added an observation equation to link real output to real output observed (which has mean =0 since it is filtered).

Am I missing something?
Many thanks

data_manipulation.m (728 Bytes)
one_sided_hp_filter_kalman.m (5.4 KB)
RCC_data.mat (10.4 KB)
RCG_2014.mod (4.0 KB)
RCG_2014_steadystate.m (2.1 KB)
A939RX0Q048SBEA.csv (5.7 KB)
BOGZ1FL072052006Q.csv (4.3 KB)
CPALTT01USQ661S.csv (6.9 KB)

The problem with the one-sided HP filter is that it only results in approximately mean 0 variables. That is a problem, because to explain the non-zero mean you will need a unit root in the shock processes. Simply removing the mean with the prefilter=1 option seems to return rather sensible results.
RCG_2014.mod (4.1 KB)

Many thanks for your help.

I am still struggling to understand what was the issue though. My variable y_obs corresponded to output log-linearized, therefore its mean value already was zero.

Also, I still seem to get some counter-intuitive results (e.g., the response coefficient of the policy rate to output is negative) and the s.d. and t-stat of the parameter estimates show as NaN.

Is it something that may have to do with the number of moments to be matched?

  1. I got rather normal looking results:
         Estimate    s.d. t-stat

rhoa       0.9125 136.0079  0.0067 
phipie     1.7941 396.2968  0.0045 
rho        0.6996 168.7107  0.0041 
psi        0.4839 57.5950  0.0084 
phiy       1.0078 1039.0112  0.0010 
rhou       0.7786  6.6186  0.1176 
stdeva     0.0036  3.2428  0.0011 
stdevj     5.1079 2022.7524  0.0025 
  1. See One-sided HP filter - #4 by jpfeifer
    Thus, your data mean is close to but not exactly zero. Similarly, you were matching other mean moments, but without estimating parameters that control these means. That does typically not work.
1 Like

This may sound a bit weird, but running the same code I get different results:


could you please repost the code you are running? Thanks

It’S the code I posted above in Dynare 5.4. Here is the log-file:
RCG_2014.log (85.2 KB)

It is quite weird. I am running it in Dynare 5.4 too, and this is what I get:

RCG_2014.log (47.4 KB)

This may be due to different Matlab versions. Our estimates converge to different minima. You may want to play around with different optimizers and settings, e.g. increasing max_fun_evals.

1 Like