GMM/SMM Estimation of Models with Explicitly Specified Trend

Hello Professor,

I am currently trying to replicate the GMM estimation from Aguiar & Gopinath (2007, JPE), where the model features an explicit stochastic trend in productivity (I(1) technology process).

I have successfully set up the stationary version of the model in Dynare by normalizing the trending variables with the stochastic trend (e.g., y^​t​=Yt​/Γt−1​) and writing the equilibrium conditions in terms of these stationary variables and the growth rate of the trend, gt​. I also have an analytical steady-state block for this stationary model.

My confusion is about the next step: using the method_of_moments command to match the empirical moments, which are based on the original, non-stationary data.

The moments used in the papers are a mix of transformations:

  • Moments of HP-filtered variables (e.g., variance of HP-filtered log output).

  • Moments of unfiltered growth rates (e.g., variance of log-differences of output).

  • Moments of filtered ratios (e.g., variance of HP-filtered Net Exports/GDP).

My core questions are:

  1. How does Dynare bridge the gap? Given that Dynare’s solver works with the stationary model, how does it analytically compute the theoretical moments for these transformed, non-stationary variables? I have read the authors’ 2004 NBER working paper and their 2007 program notes, which detail the complex matrix algebra required to derive these moments analytically. Does Dynare’s method_of_moments command automate this entire procedure “under the hood”?

  2. Can the matched_moments block handle this directly? Can I simply specify the observable variables in varobs as the non-stationary series (e.g., Y,C,I,NX) and then write expressions like variance of hp filtered log y or autocovariance of hp filtered logy with its first lag directly inside the matched_moments block? Or is an external MATLAB helper function still required to pre-calculate these moments? If yes, then what’s the best way to proceed?

  3. Is SMM a valid alternative for this case? As a potential alternative, I was considering Simulated Method of Moments (SMM). If I were to use SMM, would the correct procedure be to:

    • Simulate the stationary model variables (y^​t​, c^t​, etc.) and the trend growth (gt​).

    • Use these simulations to reconstruct the non-stationary series (Yt​=y^​t​Γt−1​).

    • Apply the same data transformations (logs, HP-filter, ratios) to the simulated non-stationary series.

    • Finally, compute the moments from this processed simulated data to match with the empirical moments?

I’m trying to replicate this using modern Dynare’s capabilities as cleanly as possible. Any clarification on the correct workflow would be incredibly helpful.

Thank you for your time and expertise!

Dear Professor,

I found your replication code for the same paper. There you had detailed on how to rebuild the entire series and compute the moments. Since I am new to estimation in Dynare, I would be grateful if you could elaborate on the next steps: 1. Since, for any given parameters, the mod file computes the corresponding 11 moments, how to do GMM/SMM estimation here?

  1. My next confusion is what should the mat file (for data) contain exactly, and what can I define my varobs to be?
  2. If step 2 is sorted, can I directly do GMM/SMM in dynare itself? Or would I need any external helper?

I have been investing considerable time in understanding this framework and would deeply appreciate your guidance at this stage.

Thank you very much for your time and help.

Thank you