Fixed bugs (initialization of the Kalman filter with the fixed point of the Riccatti equation).
parent
0caaeddb46
commit
3cbd702b3e
|
@ -475,9 +475,9 @@ switch DynareOptions.lik_init
|
||||||
kalman_algo = 1;
|
kalman_algo = 1;
|
||||||
end
|
end
|
||||||
if isequal(H,0)
|
if isequal(H,0)
|
||||||
[err,Pstar] = kalman_steady_state(transpose(T),R*Q*transpose(R),transpose(build_selection_matrix(Z,np,length(Z))));
|
[err,Pstar] = kalman_steady_state(transpose(T),R*Q*transpose(R),transpose(build_selection_matrix(Z,mm,length(Z))));
|
||||||
else
|
else
|
||||||
[err,Pstar] = kalman_steady_state(transpose(T),R*Q*transpose(R),transpose(build_selection_matrix(Z,np,length(Z))),H);
|
[err,Pstar] = kalman_steady_state(transpose(T),R*Q*transpose(R),transpose(build_selection_matrix(Z,mm,length(Z))),H);
|
||||||
end
|
end
|
||||||
if err
|
if err
|
||||||
disp(['dsge_likelihood:: I am not able to solve the Riccati equation, so I switch to lik_init=1!']);
|
disp(['dsge_likelihood:: I am not able to solve the Riccati equation, so I switch to lik_init=1!']);
|
||||||
|
@ -485,6 +485,8 @@ switch DynareOptions.lik_init
|
||||||
Pstar = lyapunov_symm(T,R*Q*R',DynareOptions.qz_criterium,DynareOptions.lyapunov_complex_threshold);
|
Pstar = lyapunov_symm(T,R*Q*R',DynareOptions.qz_criterium,DynareOptions.lyapunov_complex_threshold);
|
||||||
end
|
end
|
||||||
Pinf = [];
|
Pinf = [];
|
||||||
|
a = zeros(mm,1);
|
||||||
|
Zflag = 0;
|
||||||
otherwise
|
otherwise
|
||||||
error('dsge_likelihood:: Unknown initialization approach for the Kalman filter!')
|
error('dsge_likelihood:: Unknown initialization approach for the Kalman filter!')
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue