# Singularity problem arises when posterior subdraws are taken

**URL:** <https://forum.dynare.org/t/singularity-problem-arises-when-posterior-subdraws-are-taken/16352>\
**Category:** ML/Bayesian estimation\
**Created:** [1 August 2020 07:48 UTC](https://forum.dynare.org/t/singularity-problem-arises-when-posterior-subdraws-are-taken/16352 "2020-08-01T07:48:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ceada](https://forum.dynare.org/letter_avatar_proxy/v4/letter/c/e274bd/32.png) [@Ceada](https://forum.dynare.org/u/Ceada)\
**Post date:** [1 August 2020 07:48 UTC](https://forum.dynare.org/t/singularity-problem-arises-when-posterior-subdraws-are-taken/16352/1 "2020-08-01T07:48:20Z")

</div>

Hi all, I tried to generate GDP forecasts by estimating a DSGE model using standard Bayesian methods, and **it ended up with the following message when posterior subdraws were taken** :

Error using print\_info (line 54) One of the eigenvalues is close to 0/0 (the absolute value of numerator and denominator is smaller than 1e-06! If you believe that the model has a unique solution you can try to reduce the value of qz\_zero\_threshold.

Following some suggestions from previous posts, I also ran `model_diagnostics(M_,options_,oo_)`, and it shows that:

MODEL\_DIAGNOSTICS: The Jacobian of the static model is singular

MODEL\_DIAGNOSTICS: there is 5 colinear relationships between the variables and the equations

My original estimation command was `estimation (smoother, order=1, prefilter=0, datafile=data, presample=4, mh_replic=1000000, mh_nblocks=1, mh_jscale=0.3, mh_drop=0.3, sub_draws=5000, forecast=40, mode_compute=6) gdp;`. Since the above singularity problem arises, I changed it to

`estimation (..., mh_replic=0, sub_draws=0, mode_compute=0, mode_file=corresponding_mode_file) gdp;`

or

`estimation (..., mh_replic=0, sub_draws=0, mode_compute=0, mode_file=corresponding_mh_mode_file) gdp;`

and both worked well.

So, my questions are:

1. Why the singularity problem only arises when posterior subdraws are taken?
2. How much does it change the estimations results and the forecasts?
3. Is it reasonable to just calculate the forecasts at the mode or mh\_mode, given that the model is a linear one?

And maybe a side issue: The forecasts I obtained by using the mode file and mh\_mode file are the same. Why would this happen and does this mean that there’s something wrong with the MH sampling process?

Thanks!

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [4 August 2020 11:47 UTC](https://forum.dynare.org/t/singularity-problem-arises-when-posterior-subdraws-are-taken/16352/2 "2020-08-04T11:47:56Z")

</div>

1. It happens because in this case the decision rules have to be recomputed. There were some small bugs we fixed recently. Could you try whether the same problem happens with the unstable version. If yes, please provide me with the files to replicate the issue.
2. If you are just interested in the point forecasts, then using the parameters at the mode should be fine.
3. Regarding your side issue: this suggests that your initial mode was not the true global mode. In that case, you need to carefully check convergence of your chain.
