Commit 894b3d69 authored by Stéphane Adjemian's avatar Stéphane Adjemian

Added an option to decide if dsge_likelihood should call univariate filters...

Added an option to decide if dsge_likelihood should call univariate filters when the covariance matrix of
the prediction error is singular (default is yes).
parent 868afeb9
......@@ -614,7 +614,7 @@ if ((kalman_algo==1) || (kalman_algo==3))% Multivariate Kalman Filter
kalman_tol, DynareOptions.riccati_tol, ...
DynareOptions.presample, ...
T,Q,R,H,Z,mm,pp,rr,Zflag,diffuse_periods);
end;
end
end
if analytic_derivation,
LIK1=LIK;
......@@ -623,10 +623,19 @@ if ((kalman_algo==1) || (kalman_algo==3))% Multivariate Kalman Filter
lik=lik1{1};
end
if isinf(LIK)
if kalman_algo == 1
kalman_algo = 2;
if DynareOptions.use_univariate_filters_if_singularity_is_detected
if kalman_algo == 1
kalman_algo = 2;
else
kalman_algo = 4;
end
else
kalman_algo = 4;
if isinf(LIK)
info = 66;
fval = objective_function_penalty_base+1;
exit_flag = 0;
return
end
end
else
if DynareOptions.lik_init==3
......
......@@ -330,6 +330,7 @@ options_.filtered_vars = 0;
options_.first_obs = 1;
options_.kalman_algo = 0;
options_.kalman_tol = 1e-10;
options_.use_univariate_filters_if_singularity_is_detected = 1;
options_.riccati_tol = 1e-6;
options_.lik_algo = 1;
options_.lik_init = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment