Page 1 of 1
historical and smoothed variables
Posted:
Fri Apr 26, 2013 6:09 am
by timothy.hills
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).
Thanks
Timothy
Re: historical and smoothed variables
Posted:
Thu Aug 22, 2013 7:56 am
by jpfeifer
From a soon to be published documentation:
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.
Re: historical and smoothed variables
Posted:
Mon May 25, 2015 1:04 pm
by draoul
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!
Best,
Raoul
Re: historical and smoothed variables
Posted:
Tue May 26, 2015 5:27 pm
by jpfeifer
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
http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=6759. 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.
Re: historical and smoothed variables
Posted:
Thu May 28, 2015 11:46 am
by draoul
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:
model;
...
gini_obs=gini-ginis+sige1*e1;
end;
and I have estimated the standard error by imputting
shocks;
...
var e1; stderr 1;
end;
estimated_params;
...
sige1, inv_gamma_pdf, 0.01, inf;
...
end;
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:
model;
...
gini_obs=gini-ginis+e1;
end;
estimated_params;
...
stderr e1, inv_gamma_pdf, 0.01, inf;
...
end;
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:
model;
...
gini_obs=gini-ginis;
end;
estimated_params;
...
stderr gini_obs, inv_gamma_pdf, 0.01, inf;
...
end;
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,
Raoul
Re: historical and smoothed variables
Posted:
Fri May 29, 2015 2:35 pm
by jpfeifer
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.