# Comparing model with real data

**URL:** <https://forum.dynare.org/t/comparing-model-with-real-data/11221>\
**Category:** General DSGE Modeling\
**Created:** [16 January 2018 01:36 UTC](https://forum.dynare.org/t/comparing-model-with-real-data/11221 "2018-01-16T01:36:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![samuelsbf](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/ecae2f/32.png) [@samuelsbf](https://forum.dynare.org/u/samuelsbf)\
**Post date:** [16 January 2018 01:36 UTC](https://forum.dynare.org/t/comparing-model-with-real-data/11221/1 "2018-01-16T01:36:53Z")

</div>

Hello, I am trying to check the fit of my model to data. I calibrated a dsge model and I run it without log-linearizing the equations. As for the real data I quadratically detrended it after taking logs of the series and then I calculated the cycle as percent desviation from the trend. So I would like to know how to compare the moments of these series with the theoretical moments showed by the model, particularly the standard desviation.

Thanks in advance.

---

<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:** [16 January 2018 22:30 UTC](https://forum.dynare.org/t/comparing-model-with-real-data/11221/2 "2018-01-16T22:30:41Z")

</div>

That is a matter of taste. Some people compare the model objects directly to the preprocessed data, thereby taking the position that their stationary model has to explain all the frequency components left in the filtered data.

I personally prefer to treat the model variables exactly as the data for comparisons. As you are working with theoretical moments, you do not need to worry about deterministic trends as they are not there in the model. You only need to make sure you are comparing logged model variables to logged data.

---

<div class="post-metadata">

**Author:** ![samuelsbf](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/ecae2f/32.png) [@samuelsbf](https://forum.dynare.org/u/samuelsbf)\
**Post date:** [17 January 2018 01:07 UTC](https://forum.dynare.org/t/comparing-model-with-real-data/11221/3 "2018-01-17T01:07:03Z")

</div>

Dear jpfeifer, thank you for your explanation.

I still have two more questions (I am a beginner with dsge):

1. As I didn’t log-linearized my model the mean of the variables are not zeros (as expected). So should I divide the standard desviation by the mean to have it in percent in order to compare with the standard desviation of data?

2. Should I interpret the irf as percent desviation from steady-state values?

Thanks again.

---

<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:** [17 January 2018 14:23 UTC](https://forum.dynare.org/t/comparing-model-with-real-data/11221/4 "2018-01-17T14:23:12Z")

</div>

No. Variables not in logs are usually not in percent and thus cannot be interpreted as percentage deviations. There are several ways out. I would suggest option 3 in

> [@Question about understanding irfs in dynare](https://forum.dynare.org/t/question-about-understanding-irfs-in-dynare/10622/4):
>
> To be more precise: it depends on how the variables in your model are measured. As @stepan-a says, Dynare conducts a linearization. If you for example have a nonlinear model and your model variable is simply the level of output, the IRF will measure the difference between the variable and its steady state (or its mean at higher order). This is the case with [https://github.com/DynareTeam/dynare/blob/master/examples/example1.mod](https://github.com/DynareTeam/dynare/blob/master/examples/example1.mod) In contrast, if your model variable already measures percentage…
