Hi,

there is obviously a bug in the file kalman_filter.m used in Dynare. The respective part is

```
while notsteady & t<smpl
t = t+1;
v = Y(:,t)-a(mf);
F = P(mf,mf) + H;
if rcond(F) < kalman_tol
if ~all(abs(F(:))<kalman_tol)
return
else
a = T*a;
P = T*P*transpose(T)+QQ;
end
else
F_singular = 0;
dF = det(F);
iF = inv(F);
lik(t) = log(dF)+transpose(v)*iF*v;
K = P(:,mf)*iF;
a = T*(a+K*v);
P = T*(P-K*P(mf,:))*transpose(T)+QQ;
end
notsteady = max(max(abs(K-oldK))) > riccati_tol;
oldK = K;
end
```

If

and

Dynare only sets the variables a and P. However, after the if-clause, K is used in

`max(max(abs(K-oldK))) `

But K was never defined, hence Dynare stops with an error.