# GMM estimation for shocks in RBC models

**URL:** <https://forum.dynare.org/t/gmm-estimation-for-shocks-in-rbc-models/19045>\
**Category:** SMM/GMM/IRF-Matching\
**Created:** [7 October 2021 16:13 UTC](https://forum.dynare.org/t/gmm-estimation-for-shocks-in-rbc-models/19045 "2021-10-07T16:13:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bkthn](https://forum.dynare.org/letter_avatar_proxy/v4/letter/b/8edcca/32.png) [@bkthn](https://forum.dynare.org/u/bkthn)\
**Post date:** [7 October 2021 16:13 UTC](https://forum.dynare.org/t/gmm-estimation-for-shocks-in-rbc-models/19045/1 "2021-10-07T16:13:48Z")

</div>

Hello,

I want to calculate the autocorrelation coefficients and standard deviations of trend growth shocks and transitory shocks (both are AR(1) processes) in a basic RBC model using GMM estimation. Can I do that in Dynare? Or should I write it in Matlab?

Thanks!

---

<div class="post-metadata">

**Author:** ![kofiemma](https://forum.dynare.org/letter_avatar_proxy/v4/letter/k/439d5e/32.png) [@kofiemma](https://forum.dynare.org/u/kofiemma)\
**Post date:** [7 October 2021 16:29 UTC](https://forum.dynare.org/t/gmm-estimation-for-shocks-in-rbc-models/19045/2 "2021-10-07T16:29:36Z")

</div>

According to this video, it is possible in dynare 4.7, thus, if the autocorrelation coefficients and standard deviations are parameters in your model, you can use GMM or SMM to estimate them.

[![](https://img.youtube.com/vi/gOcwxZJND2M/maxresdefault.jpg "Method of Moments (GMM and SMM) Estimation in Dynare 4.7 and 5") ](https://www.youtube.com/watch?v=gOcwxZJND2M)

---

<div class="post-metadata">

**Author:** ![bkthn](https://forum.dynare.org/letter_avatar_proxy/v4/letter/b/8edcca/32.png) [@bkthn](https://forum.dynare.org/u/bkthn)\
**Post date:** [7 October 2021 17:34 UTC](https://forum.dynare.org/t/gmm-estimation-for-shocks-in-rbc-models/19045/3 "2021-10-07T17:34:36Z")

</div>

Thank you very much. I watched the video before. I tried to manipulate the code to estimate “RHOA” with GMM but Dynare gives me an error “RHOA is not an endogenous variable”.

In the video, professor estimates consumption, investment and labor which are all endogenous. But, all the parameters I want to estimate are exogenous. Sorry, I am a bit new to RBC literature and Dynare as well. How should I manipulate the code so that I can estimate exogenous parameters?

---

<div class="post-metadata">

**Author:** ![kofiemma](https://forum.dynare.org/letter_avatar_proxy/v4/letter/k/439d5e/32.png) [@kofiemma](https://forum.dynare.org/u/kofiemma)\
**Post date:** [8 October 2021 01:15 UTC](https://forum.dynare.org/t/gmm-estimation-for-shocks-in-rbc-models/19045/4 "2021-10-08T01:15:01Z")

</div>

I don’t think I understand your point. Maybe watch the video again. You can not estimate consumption, labor, and investment. Check the `estimated_params;` block (in the dynare implementation part of the video)…something like below. In the video, he explicitly states that he estimates “the structural parameters and standard errors of the shock”. That is `RHOA` (autocorrelation coefficient of shock) and `stderr u_a` (standard deviations) of the shock…

```auto
estimated_params;
   %parameter, initial value, lower bound, upper bound, unifrom_pdf,,,,, tr
    DELTA, 0.025, 0, 1, uniform_pdf,,,,, 1;
    BETTA, 0.984, 0, 1, uniform_pdf,,,,, 1;
    RHOA, 0.979, 0, 1, uniform_pdf,,,,, 1;
    STDA, 0.0072, 0, 1, uniform_pdf,,,,, 1;
    stderr u_a, 0.01, 0, 10, uniform_pdf,,,,, 1;
end;

```

Btw, I think your terminologies may be wrong here. In any model, whether RBC/DSGE or linear regression, we have endogenous variables, exogenous variables and parameters, not exogenous parameters and endogenous parameters.

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [8 October 2021 06:53 UTC](https://forum.dynare.org/t/gmm-estimation-for-shocks-in-rbc-models/19045/5 "2021-10-08T06:53:25Z")

</div>

As @kofiemma correctly points out, estimation refers to backing out the most likely value of parameters, given the observed data. You only have moment restrictions on the observed data, not the parameters. So the moment restrictions need to specified for the observables, while the `estimated_params`-block stipulates which parameters are estimated.

---

<div class="post-metadata">

**Author:** ![bkthn](https://forum.dynare.org/letter_avatar_proxy/v4/letter/b/8edcca/32.png) [@bkthn](https://forum.dynare.org/u/bkthn)\
**Post date:** [9 October 2021 16:43 UTC](https://forum.dynare.org/t/gmm-estimation-for-shocks-in-rbc-models/19045/6 "2021-10-09T16:43:49Z")

</div>

Thank you very much professor and kofiemma. I understand now.
