# Comparison of real and simulated moments

**URL:** <https://forum.dynare.org/t/comparison-of-real-and-simulated-moments/14110>\
**Category:** General DSGE Modeling\
**Created:** [7 July 2019 16:38 UTC](https://forum.dynare.org/t/comparison-of-real-and-simulated-moments/14110 "2019-07-07T16:38:10Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![eisamabodian](https://forum.dynare.org/user_avatar/forum.dynare.org/eisamabodian/32/12023_2.png) [@eisamabodian](https://forum.dynare.org/u/eisamabodian)\
**Post date:** [7 July 2019 16:38 UTC](https://forum.dynare.org/t/comparison-of-real-and-simulated-moments/14110/1 "2019-07-07T16:38:10Z")

</div>

Hi.

I solved and simulated an RBC model in non-linear form.Now,I want to compare simulated and real data moments( standard deviation).  
My question is that I solved and simulated the model in a non-linear form but not log-linear.

When I want to compare the simulated moments with real data moments, can I use logarithm of GDP and logarithm of Consumption?

I seasonally adjusted my real data, then I transformed them to Logarithm for example LogGDP or LogCONSUMPTION, then I derived cycle with HP filter and then I compared the standard deviation of these variables with standard deviation of simulated data in Dynare.

I want to know that my work is right or not?

I ask this question,because my model is not Log-Linear,but when I compare the standard deviations of simulated and real data, I use logarithm of real data such as GDP,Consumption,Investment

Thank you so much.

---

<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:** [9 July 2019 13:04 UTC](https://forum.dynare.org/t/comparison-of-real-and-simulated-moments/14110/2 "2019-07-09T13:04:50Z")

</div>

You need to compare log-data with the same filter. See e.g. [https://github.com/JohannesPfeifer/DSGE\_mod/blob/master/RBC\_baseline/RBC\_baseline.mod](https://github.com/JohannesPfeifer/DSGE_mod/blob/master/RBC_baseline/RBC_baseline.mod)

---

<div class="post-metadata">

**Author:** ![eisamabodian](https://forum.dynare.org/user_avatar/forum.dynare.org/eisamabodian/32/12023_2.png) [@eisamabodian](https://forum.dynare.org/u/eisamabodian)\
**Post date:** [9 July 2019 13:29 UTC](https://forum.dynare.org/t/comparison-of-real-and-simulated-moments/14110/3 "2019-07-09T13:29:53Z")

</div>

Thank you much.I saw your RBC codes but you adjusted your model in Dynare to be solved in log-linear form, and not in linear form.I have written the model only in non-linear form in Dynare and Dynare solve it in linear form not Log-Linear form. According to the aforementioned point my work is right or not?

I did not transformed the model to log-linear form because we have not strictly positive steady state values in the model.

---

<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:** [10 July 2019 08:33 UTC](https://forum.dynare.org/t/comparison-of-real-and-simulated-moments/14110/4 "2019-07-10T08:33:44Z")

</div>

No, I did not do log-linearize. The model is completely nonlinear. I simply appended the logged variables of interest.

---

<div class="post-metadata">

**Author:** ![eisamabodian](https://forum.dynare.org/user_avatar/forum.dynare.org/eisamabodian/32/12023_2.png) [@eisamabodian](https://forum.dynare.org/u/eisamabodian)\
**Post date:** [10 July 2019 08:50 UTC](https://forum.dynare.org/t/comparison-of-real-and-simulated-moments/14110/5 "2019-07-10T08:50:40Z")

</div>

Thank you so much professor.

---

<div class="post-metadata">

**Author:** ![HEIDARZ](https://forum.dynare.org/letter_avatar_proxy/v4/letter/h/d9b06d/32.png) [@HEIDARZ](https://forum.dynare.org/u/HEIDARZ)\
**Post date:** [30 June 2020 05:17 UTC](https://forum.dynare.org/t/comparison-of-real-and-simulated-moments/14110/6 "2020-06-30T05:17:31Z")

</div>

Hi  
When we add for example log(y) to the non linear code should we compare the theoretical moments of this variable with empirical moments computed based on log (y)-hp filter(logy) ? is it correct?  
Thanks

---

<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:** [30 June 2020 08:20 UTC](https://forum.dynare.org/t/comparison-of-real-and-simulated-moments/14110/7 "2020-06-30T08:20:16Z")

</div>

That always depends what you are trying to do. But usually, you compare filtered data moments to model data filtered in exactly the same way.
