# Kalman filter and version 4.1.2

**URL:** <https://forum.dynare.org/t/kalman-filter-and-version-4-1-2/1558>\
**Category:** Dynare help (legacy posts)\
**Created:** [23 July 2010 21:44 UTC](https://forum.dynare.org/t/kalman-filter-and-version-4-1-2/1558 "2010-07-23T21:44:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![manuel.gonzalez](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/c57346/32.png) [@manuel.gonzalez](https://forum.dynare.org/u/manuel.gonzalez)\
**Post date:** [23 July 2010 21:44 UTC](https://forum.dynare.org/t/kalman-filter-and-version-4-1-2/1558/1 "2010-07-23T21:44:58Z")

</div>

I was estimating a NK model using version 4.1.1 and got the message that led to fixing the bug in the Kalman filter code ([Bug in kalman\_filter.m](https://forum.dynare.org/t/bug-in-kalman-filter-m/1486/1)).

Now I am running version 4.1.2 and the bug seems to be fixed, however now I get the following error message:

> > dynare base\_est.mod

Configuring Dynare …  
[mex] Generalized QZ.  
[mex] Sylvester equation solution.  
[mex] Kronecker products.  
[mex] Sparse kronecker products.  
[mex] Bytecode evaluation.  
[mex] k-order perturbation solver.  
[mex] k-order solution simulation.

Starting Dynare (version 4.1.2).  
Starting preprocessing of the model file …  
Found 10 equation(s).  
Evaluating expressions…done  
Computing static model derivatives:

- order 1  
Computing dynamic model derivatives:
- order 1
- order 2  
Processing outputs …done  
Preprocessing completed.  
Starting MATLAB/Octave computing.

STEADY-STATE RESULTS:

ygr 0.4  
infl 7  
int 9.64957  
y 0  
yst 0  
r 0  
p 0  
u 0  
g 0  
v 0

EIGENVALUES:  
Modulus Real Imaginary

```
           0 0 0
      0.1863 0.1863 0
         0.2 0.2 0
         0.6 0.6 0
         0.8 0.8 0
       1.281 1.281 0
         2.1 2.1 0
         Inf -Inf 0

```

There are 3 eigenvalue(s) larger than 1 in modulus  
for 3 forward-looking variable(s)

The rank condition is verified.

You did not declare endogenous variables after the estimation command.  
Loading 205 observations from qdatabaseest.xls

??? Error using ==\> kalman\_filter at 83  
The variance of the forecast error remains singular until the end of the sample

Error in ==\> DsgeLikelihood at 254  
LIK = kalman\_filter(T,R,Q,H,Pstar,Y,start,mf,kalman\_tol,riccati\_tol);

Error in ==\> initial\_estimation\_checks at 60  
[fval,cost\_flag,ys,trend\_coeff,info] =  
DsgeLikelihood(xparam1,gend,data,data\_index,number\_of\_observations,no\_more\_missing\_observations);

Error in ==\> dynare\_estimation\_1 at 334  
initial\_estimation\_checks(xparam1,gend,data,data\_index,number\_of\_observations,no\_more\_missing\_observations);

Error in ==\> dynare\_estimation at 62  
dynare\_estimation\_1(var\_list,varargin{:});

Error in ==\> base\_est at 176  
dynare\_estimation(var\_list\_);

Error in ==\> dynare at 132  
evalin(‘base’,fname) ;

> >

Why is that the matrix is singular?  
[qdatabaseest.xls](https://forum.dynare.org/uploads/default/original/1X/691cf06466c3847ce3c7e8a2e5f74f14e835a580.xls) (38.5 KB)  
[base\_est.mod](https://forum.dynare.org/uploads/default/original/1X/12f6cef5d440106d12ac628490ba8370aeee262f.mod) (1.47 KB)

---

<div class="post-metadata">

**Author:** ![MichelJuillard](https://forum.dynare.org/user_avatar/forum.dynare.org/micheljuillard/32/5318_2.png) [@MichelJuillard](https://forum.dynare.org/u/MichelJuillard)\
**Post date:** [28 July 2010 13:35 UTC](https://forum.dynare.org/t/kalman-filter-and-version-4-1-2/1558/2 "2010-07-28T13:35:20Z")

</div>

Dear Manuel,

the size of the standard deviation of the shocks is not specified in your \*.mod file. As you have put estimated parameters in front of eu, ev and eg, there variance is obviously 1, but you need to specify it in a SHOCKS block.

Best

Michel
