Page 1 of 1

Estimation with diffuse_filter and missing data

PostPosted: Thu May 14, 2015 2:13 am
by mmyy56
Hello everyone,

I am tring to estimate the Smets-Wouters model using diffuse_filter . I mix quarterly and yearly data. I continuously got this wrong message, even after I use use_calibration option. But the stochastic simulation is OK.
Can anyone give some suggestions?
Thank you in advance.


OSTERIOR KERNEL OPTIMIZATION PROBLEM!
(minus) the hessian matrix at the "mode" is not positive definite!
=> posterior variance of the estimated parameters are not positive.
You should try to change the initial values of the parameters using
the estimated_params_init block, or use another optimization routine.
Warning: The results below are most likely wrong!
> In dynare_estimation_1 at 694
In dynare_estimation at 89
In cee at 753
In dynare at 180
Log data density [Laplace approximation] is 1632.140485.
??? Error using ==> chol
Matrix must be positive definite.
Error in ==> <a href="matlab: opentoline('C:\dynare\4.4.3\matlab\metropolis_hastings_initialization.m',68,0)">metropolis_hastings_initialization at 68</a>
d = chol(vv);

Error in computing likelihood for initial parameter values
ESTIMATION_CHECKS: There was an error in computing the likelihood for initial parameter values.
ESTIMATION_CHECKS: You should try using the calibrated version of the model as starting values. To do
ESTIMATION_CHECKS: this, add an empty estimated_params_init-block with use_calibration option immediately before the estimation
ESTIMATION_CHECKS: command (and after the estimated_params-block so that it does not get overwritten):

Re: Estimation with diffuse_filter and missing data

PostPosted: Mon May 18, 2015 11:36 am
by jpfeifer
I am not sure your observation equations are correct. Try doing this more systematically. You are telling Dynare that the observed variables have trends that need to be taken out. At the same time, you specify observation equations that seem to suggest the trend is still there. Moreover, there are some bugs related to trends and prefiltering/loglinear in Dynare, see https://github.com/DynareTeam/dynare/pull/852
For now, I would start with a stripped down version of your file without the loglinear version (explicitly specify the variables you are interested in as the logs of the model variables), using demeaned growth rates, i.e. fixing the mean growth rates at their sample mean. If that works, move towards estimating the growth rates.

Re: Estimation with diffuse_filter and missing data

PostPosted: Wed May 20, 2015 11:43 pm
by mmyy56
Thank you, pfeifer . I think the problem comes from diffuse_filter.
With missing data, it is imporssible to transform the level data to QoQ growth rate. And I do not want to take stand on how to detrend the data. That is why I use level variable and diffuse_filter.
I transform the level variable with missing data to YoY growth rate. Now it runs smoothly.
But I have no idea how it influences the parameter identification. That is, stationarize level data by defining new observable variables of YoY growth rate

Re: Estimation with diffuse_filter and missing data

PostPosted: Sat May 23, 2015 2:04 pm
by jpfeifer
Using year on year (YoY) growth rates should work as well. If with identification you mean that suddenly some parameters are not identified anymore, that should not be the case. Your current approach might even be observationally equivalent.

Re: Estimation with diffuse_filter and missing data

PostPosted: Sun May 24, 2015 11:07 pm
by costa
I was about to ask about this. So it is ok to use the fourth difference , or YoY of GDP instead of the traditional first difference in estimation?

Re: Estimation with diffuse_filter and missing data

PostPosted: Wed May 27, 2015 5:24 pm
by jpfeifer
Of course. Apart from the fact that you may be missing some observations at the beginning of the sample for the YoY growth rates, their information content exactly the same as you could infer one from the other (if there are no missing data of course.)