I have successfully run my model with 7 shocks and 7 measurement equations. However, when it comes to estimation, Dynare encounters a problem of stochastic singularity. The error message is the following:
Blockquote initial_estimation_checks:: The forecast error variance in the multivariate Kalman filter became singular.
initial_estimation_checks:: This is often a sign of stochastic singularity, but can also sometimes happen by chance
initial_estimation_checks:: for a particular combination of parameters and data realizations.
initial_estimation_checks:: If you think the latter is the case, you should try with different initial values for the estimated parameters.
Blockquote ESTIMATION_CHECKS: There was an error in computing the likelihood for initial parameter values.
ESTIMATION_CHECKS: If this is not a problem with the setting of options (check the error message below),
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):
In the forum, Prof. Pfeifer mentioned that this usually occurs when the model implies at least one observable to be an exact linear combination of the other ones. But as far as I can see, this does not seem to be the problem in my model.
Also looking at the suggestions in the forum, I read that it is a good idea to run the code with just one varobs; i tried to do so by just including devlnY and indeed it is working fine.
I would like to ask you if there is any way I can include also the other variables in my database as observable.
Thank you for your help.
model_rev37.mod (16.2 KB) model_rev37_steadystate.m (3.0 KB) data_1.mat (5.8 KB)
Thank you very much for your answer.
- I am not fully aware of where the problem is coming from. Is it related to my good market clearing?
- It works indeed, but the Bayesian estimation looks really unsatisfactory and imprecise. Wouldn’t it be improved if I add more observables? Or is it better to define more carefully moments and distribution of the parameters?
Ok, sorry if I am tedious, but just to have a confirmation. Leaving A and Y should be sufficient to solve both problems in point 1 and 2, as parameters will update based on the estimated and not on some observed ones?
Thank you very much for your help!
No. Point 1 has nothing to do with the observables, but rather the fact that you hard-code dependent objects like
Ibar = Kbar*(1-(1-delta)/Gama); % long-run investment rate
instead of having them as model-local variables.
I guess there was a mistake in the comment… Ibar is actually not the long-run investment rate, but the l-r investment share, so it does not need to be updated… in this sense, there should be no parameter dependence, right?
It depends on delta. If you change delta during estimation, this dependence will not be taken into account. Even if you do not estimate delta, this is bad practice and very error-prone.
I am very sorry to bother you again.
I did what you suggested, that is to fix the problem with parameter dependence by making Ibar a model-local variable, but unfortunately this has not solved the problem.
Even before estimating the model, I simulated from the priors to see what the prior mass is, and the prior simulate; command yields the following:
Prior mass = 5e-05
BK indeterminacy share = 0
BK unstability share = 0.00315
BK singularity share = 0
Complex jacobian share = 0
mjdgges crash share = 0
Steady state problem share = 0
Complex steady state share = 0
Analytical steady state problem share = 0.9968
As far as I understand, this implies that in 99.68% of the cases the solver could not find the steady state because of problems with the model. Is that correct?
Please find attached my mod and steady state file.
Thank you in advance for your help.
model_rev41_steadystate.m (3.1 KB)
model_rev41.mod (16.2 KB)
Yes, you still don’t have a proper steady state file