# Dynare EstimationThe forecast error variance in the multivariate Kalman filter became singular

**URL:** https://forum.dynare.org/t/dynare-estimationthe-forecast-error-variance-in-the-multivariate-kalman-filter-became-singular/20394
**Category:** ML/Bayesian estimation
**Created:** [21 May 2022 08:39 UTC](https://forum.dynare.org/t/dynare-estimationthe-forecast-error-variance-in-the-multivariate-kalman-filter-became-singular/20394 "2022-05-21T08:39:46Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![eeee34](https://forum.dynare.org/letter_avatar_proxy/v4/letter/e/ac91a4/32.png) [@eeee34](https://forum.dynare.org/u/eeee34)
#### Post date: [21 May 2022 08:39 UTC](https://forum.dynare.org/t/dynare-estimationthe-forecast-error-variance-in-the-multivariate-kalman-filter-became-singular/20394/1 "2022-05-21T08:39:46Z")

</div>

Hi,  
Im trying to estimate the basic NK model Gali (2008). I have 3 observables variables, output gap, interest rate and CPI and 3 shocks. When I get to estimate the model using my data it shows me this errors:  
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.

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):

Hope someone helps me find out the mistake, thank you in advance.  
[dateNK.xlsx](https://forum.dynare.org/uploads/short-url/kObUfzwuTeDuRymA1nDzwSrsOhu.xlsx) (30.5 KB)  
[untitled3.mod](https://forum.dynare.org/uploads/short-url/diIEwhrfTsDN0lMkpOoykKOPyDP.mod) (1.5 KB)

---

<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: [23 May 2022 07:15 UTC](https://forum.dynare.org/t/dynare-estimationthe-forecast-error-variance-in-the-multivariate-kalman-filter-became-singular/20394/2 "2022-05-23T07:15:58Z")

</div>

The model implies an exact linear combination between these three variables. That will not work. See e.g.

> [@Issue with the Kalman filter](https://forum.dynare.org/t/issue-with-the-kalman-filter/18627/2):
>
> The problem is known as “stochastic singularity”, which happens if a linearized model implies an exact linear combination between observables. That in turn means that the density of observing that variables is either 1 (the exact linear combination in the model holds in the data; rarely the case) or 0 (the exact linear combination does not hold; the typical case). As you can imagine with a log density of minus infinity, estimation will not work. You have in your model exp(y\_tilde) = exp(k\_tild…
