Skip to content
Snippets Groups Projects
Commit 16968cbf authored by Stéphane Adjemian's avatar Stéphane Adjemian Committed by Sébastien Villemot
Browse files

Fixed bug with option cova_compute.

(cherry picked from commit bd012c45)
parent ae994c38
No related branches found
No related tags found
No related merge requests found
......@@ -409,8 +409,6 @@ if ~isequal(options_.mode_compute,0) && ~options_.mh_posterior_mode_estimation
else
hh = reshape(hessian('DsgeVarLikelihood',xparam1,options_.gstep,gend),nx,nx);
end
else
nn = repmat(NaN,length(xparam1),length(xparam1))
end
end
parameter_names = bayestopt_.name;
......@@ -422,10 +420,10 @@ if ~isequal(options_.mode_compute,0) && ~options_.mh_posterior_mode_estimation
end
if options_.cova_compute == 0
hh = repmat(NaN,length(xparam1),length(xparam1));
hh = NaN(length(xparam1),length(xparam1));
end
if ~options_.mh_posterior_mode_estimation
if ~options_.mh_posterior_mode_estimation && options_.cova_compute
try
chol(hh);
catch
......@@ -439,11 +437,11 @@ if ~options_.mh_posterior_mode_estimation
end
end
if options_.mode_check == 1 && ~options_.mh_posterior_mode_estimation
if options_.mode_check == 1 && ~options_.mh_posterior_mode_estimation && options_.cova_compute
mode_check(xparam1,0,hh,gend,data,lb,ub,data_index,number_of_observations,no_more_missing_observations);
end
if ~options_.mh_posterior_mode_estimation
if ~options_.mh_posterior_mode_estimation && options_.cova_compute
invhess = inv(hh);
stdh = sqrt(diag(invhess));
else
......@@ -457,6 +455,9 @@ else
xparam1 = transpose(xparam1);
end
if ~options_.cova_compute
stdh = NaN(length(xparam1),1);
end
if any(bayestopt_.pshape > 0) && ~options_.mh_posterior_mode_estimation
disp(' ')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment