Historical and smoothed variables

I cannot find in the User Guide where it explains within context of the Bayesian estimation methods how to interpret the graph of Historical and Smoothed Variables. This should definitely be included in the User’s Guide (or I might simply not be looking hard enough).



From a soon to be published documentation:

[quote]Historical and smoothed variables:
Historical and smoothed variables plot generated by the estimation-command when either maximum likelihood estimation (ML) is used or Bayesian estimation without the smoother-option. It is stored in the main folder. 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 the posterior mode (ML) or posterior mean (Bayesian estimation). In case of no measurement error, both series are identical.[/quote]

Hi everyone

I have a following up question to this post:

Does this mean that in the presence of measurement errors, the historical and smoothed variables ought not to be the same?

I am asking because of the following problem: Currently, I am working on a limited heterogeneity model. I estimate the model. To avoid the problem of stochastic singularity I include a measurement error on the gini coefficient on consumption. Estimation seems to work properly (Convergence diagnostics, identification etc. looks ok). However, besides the measurement error (e1), the historical and smoothed gini coefficient seem to be identical (see figure 1 in the attachment). On top of that, the measurement error is far away from being white noise (see figure 2). Does this imply that my model is just incapable of generating the dynamics in the gini coefficient or what could be the problem here?

I am using here interpolated annual data for the gini coefficient. I thought that this might be the problem, therefore I constructed a quarterly measure. In this case, the historical and smoothed series still seem to be identical (see figure 3). The smoothed measurement error seems to be closer to white noise. However, it seems just to mirror the dynamics of the gini coefficient (one can clearly see this by comparing figure 3 and 4). Any ideas what the problem could be?

Thanks a lot for your help!


figure4.pdf (9.56 KB)
figure3.pdf (9.37 KB)
figure2.pdf (9.24 KB)
figure1.pdf (8.98 KB)

In general, the difference between the smoothed and the historical series is the measurement error. Thus, if measurement error is important, the two will deviate. What is strange is that the scale of the measurement error and the gini do not at all match. How exactly do you enter the measurement error? And which Dynare version are you using.

With interpolated data, your measurement error will always look more persistent and there are very good reasons for not interpolating, see [Data transformation for estimation). Moreover, all models are misspecified in some dimensions. This will often show up in measurement error. It being non-white noise is to be expected. It is the degree of this that matters.

Dear Johannes

Many thanks for your enlightening answers. I am using Dynare 4.4.3 together with Matlab R2015a. I have entered the measurement error as follows:



and I have estimated the standard error by imputting


var e1; stderr 1;


sige1, inv_gamma_pdf, 0.01, inf;


I think the problem with the scale you mentioned was related to the way I imputted the standard error. If I imput it this way:



stderr e1, inv_gamma_pdf, 0.01, inf;


the scale seems to be consistent. However, the smoothed series is still equal to the observed (see figure 1+2). Last but not least, I specified the measurement error like this:



stderr gini_obs, inv_gamma_pdf, 0.01, inf;


In this case the observable and the smoothed series deviate and the deviation seems to match the measurement error (see figure 3+4) as it should be.

Accordingly, the historical and smoothed variables plot seems to be only correctly produced when using the last approach (Note, the estimated parameters are identical in all three approaches of specifying the measurement error). Is this because with the first two approaches dynare doesn’t know that this shock is a measurement error (i.e. a disturbance in the observation and not in the state equation of the state space representation)?

Best regards,

fig4.pdf (10.3 KB)
fig3.pdf (10.3 KB)
fig2.pdf (9.39 KB)
fig1.pdf (12.4 KB)

Exactly, in one case, Dynare takes the measurement error to really be just that: measurement error. It then plots the inferred/smoothed underlying variable without measurement error. If you specify the measurement error as a structural shock instead, Dynare does not know this and simply plots the data series.