# Historical and smoothed variables plot

**URL:** <https://forum.dynare.org/t/historical-and-smoothed-variables-plot/10531>\
**Category:** Estimation\
**Created:** [8 August 2017 20:16 UTC](https://forum.dynare.org/t/historical-and-smoothed-variables-plot/10531 "2017-08-08T20:16:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![peter](https://forum.dynare.org/letter_avatar_proxy/v4/letter/p/278dde/32.png) [@peter](https://forum.dynare.org/u/peter)\
**Post date:** [8 August 2017 20:16 UTC](https://forum.dynare.org/t/historical-and-smoothed-variables-plot/10531/1 "2017-08-08T20:16:23Z")

</div>

Hi everyone

I have a question related to the Historical and smoothed variables

I have 14 obs. variables, in the figure 27 and 28 [figure27.pdf](https://forum.dynare.org/uploads/default/original/2X/2/25681590f4c2b7e30aa0d2396e423417ba79416a.pdf) (12.5 KB)  
[figure28.pdf](https://forum.dynare.org/uploads/default/original/2X/6/675a9c117e7176417cd3cf6168cc2c2829a53ac0.pdf) (8.1 KB)  
I know that  
The dotted black line depicts the actually observed data, while the red line depicts the estimate of the smoothed variable (“best guess for the observed variable given all observations”), derived from the Kalman smoother at posterior mean (Bayesian estimation) (because I use the Bayesian method). In both figures 27 and 28 , both series are identical and no measurement error,

So my 2 questions are

1. what happen if these two line are different, I mean there exists measurement error?
2. Can we use this figure 27 and 28 to evaluate the fit of data to theoretical model? I mean what is the purpose to plot this figure?

With best regards

---

<div class="post-metadata">

**Author:** ![stepan-a](https://forum.dynare.org/user_avatar/forum.dynare.org/stepan-a/32/6652_2.png) [@stepan-a](https://forum.dynare.org/u/stepan-a)\
**Post date:** [8 August 2017 22:47 UTC](https://forum.dynare.org/t/historical-and-smoothed-variables-plot/10531/2 "2017-08-08T22:47:56Z")

</div>

Dear Peter,

It is up to you to decide if your model has measurement errors. If you decide to add measurement errors, then you will observe gaps between historical data and smoothed variables. The smaller are these differences the better is the fit. Obviously this comparison does not make sense if you do not have measurement errors (see also this related recent [topic](https://forum.dynare.org/t/moments-comparison/10520)).

It may happen that, even without measurement errors, you observe differences between historical and smoothed variables (typically different means). This may reflect a problem in the specification of your measurement equations (missing constant)… Or a bug in Dynare itself.

Best,  
Stéphane.

---

<div class="post-metadata">

**Author:** ![peter](https://forum.dynare.org/letter_avatar_proxy/v4/letter/p/278dde/32.png) [@peter](https://forum.dynare.org/u/peter)\
**Post date:** [9 August 2017 13:45 UTC](https://forum.dynare.org/t/historical-and-smoothed-variables-plot/10531/3 "2017-08-09T13:45:36Z")

</div>

Dear @stepan-a

Thank you so much for your detailed explanation

Best regards

---

<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 August 2017 14:49 UTC](https://forum.dynare.org/t/historical-and-smoothed-variables-plot/10531/4 "2017-08-09T14:49:34Z")

</div>

You can also get a gap between observed variables and smoothed variables in case of stochastic singularity. This could particularly occur before Dynare 4.5 as the `use_univariate_filters_if_singularity_is_detected` option was enabled by default.
