Added the possibility to initialize the estimated parameters to the prior mode instead of the (default) prior mean.

time-shift
Stéphane Adjemian (Sedna) 2011-05-06 12:42:12 +02:00 committed by Stéphane Adjemian (Scylla)
parent 6ea8dd4935
commit 50e9422c34
2 changed files with 12 additions and 1 deletions

View File

@ -212,6 +212,7 @@ end
options_.filter_covariance = 0;
options_.filter_decomposition = 0;
options_.selected_variables_only = 0;
options_.initialize_estimated_parameters_with_the_prior_mode = 0;
% Misc
options_.conf_sig = 0.6;
oo_.exo_simul = [];

View File

@ -249,7 +249,17 @@ for i=1:length(k)
end
k = find(isnan(xparam1));
xparam1(k) = bayestopt_.p1(k);
if ~isempty(k)
xparam1(k) = bayestopt_.p1(k);
end
if options_.initialize_estimated_parameters_with_the_prior_mode
xparam1 = bayestopt_.p5;
k = find(isnan(xparam1));% Because the uniform density do not have a mode!
if ~isempty(k)
xparam1(k) = bayestopt_.p1(k);
end
end
% I create subfolder M_.dname/prior if needed.
CheckPath('prior');