Commit e637319b authored by Marco Ratto's avatar Marco Ratto
Browse files

bug fix. the diffuse filter should simply penalize the likelihood with the NaN...

bug fix. the diffuse filter should simply penalize the likelihood with the NaN without breaking the estimation (this is in line with missing_observations_kalman_filter_d.m).
parent c74b1d1b
......@@ -427,6 +427,13 @@ switch DynareOptions.lik_init
T,R,Q,H1,Z,mmm,pp,rr);
diffuse_periods = length(dlik);
end
if isnan(dLIK),
fval=dLIK;
info = 45;
exit_flag = 0;
return
end
case 4% Start from the solution of the Riccati equation.
if kalman_algo ~= 2
kalman_algo = 1;
......
......@@ -155,8 +155,8 @@ while newRank && (t<=last)
end
if (t>last)
error(['univariate_diffuse_kalman_filter:: There isn''t enough information to estimate the initial conditions of the nonstationary variables']);
LIK = NaN;
warning(['univariate_diffuse_kalman_filter:: There isn''t enough information to estimate the initial conditions of the nonstationary variables']);
dLIK = NaN;
return
end
......
Supports Markdown
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