Skip to content
Snippets Groups Projects
Commit 39e7c392 authored by Johannes Pfeifer's avatar Johannes Pfeifer Committed by Stéphane Adjemian
Browse files

Filter out infinite likelihoods

parent 818befd4
No related branches found
No related tags found
No related merge requests found
......@@ -660,7 +660,7 @@ end
%------------------------------------------------------------------------------
singularity_has_been_detected = false;
% First test multivariate filter if specified; potentially abort and use univariate filter instead
if ((kalman_algo==1) || (kalman_algo==3))% Multivariate Kalman Filter
if no_missing_data_flag
if DynareOptions.block
......@@ -824,6 +824,14 @@ if imag(LIK)~=0
return
end
if isinf(LIK)~=0
fval = Inf;
info(1) = 50;
info(4) = 0.1;
exit_flag = 0;
return
end
likelihood = LIK;
% ------------------------------------------------------------------------------
......
......@@ -308,6 +308,14 @@ if imag(fval)~=0
return
end
if isinf(fval)~=0
fval = Inf;
info(1) = 50;
info(4) = 0.1;
exit_flag = 0;
return
end
if (nargout >= 10)
if isinf(dsge_prior_weight)
iXX = iGXX;
......
......@@ -367,3 +367,12 @@ if imag(fval)~=0
exit_flag = 0;
return
end
if isinf(LIK)~=0
fval = Inf;
info(1) = 50;
info(4) = 0.1;
exit_flag = 0;
return
end
......@@ -116,6 +116,8 @@ if ~noprint
error('Prior density is a complex number');
case 49
error('The model violates one (many) endogenous prior restriction(s)')
case 50
error('Likelihood is Inf')
case 51
fprintf('\n The dsge_prior_weight is dsge_var=%5.4f, but must be at least %5.4f for the prior to be proper.\n',info(2),info(3));
error('You are estimating a DSGE-VAR model, but the value of the dsge prior weight is too low!')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment