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 ==> metropolis_hastings_initialization at 68
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):
datas1.xls (35.5 KB)
datapull1.m (128 Bytes)
cee_steadystate.m (1.83 KB)
cee.mod (12.5 KB)
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 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.
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
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.
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?
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.)