diff --git a/matlab/PosteriorIRF_core1.m b/matlab/PosteriorIRF_core1.m
index cbfe2ee317bcb671665432d283c31787030b9761..5213637b922a898943fd8ed91ab577765088f0b5 100644
--- a/matlab/PosteriorIRF_core1.m
+++ b/matlab/PosteriorIRF_core1.m
@@ -77,7 +77,7 @@ if options_.dsge_var
NumberOfLagsTimesNvobs = myinputs.NumberOfLagsTimesNvobs;
Companion_matrix = myinputs.Companion_matrix;
stock_irf_bvardsge = zeros(options_.irf,nvobs,M_.exo_nbr,MAX_nirfs_dsgevar);
- bounds = prior_bounds(bayestopt_,options_);
+ bounds = prior_bounds(bayestopt_,options_.prior_trunc);
end
diff --git a/matlab/dynare_estimation_1.m b/matlab/dynare_estimation_1.m
index 55b40654cc3a388e240b86e14ac09963e1e151a8..58ee4fef466c2ca46dd8cf11fdc98d2cec48f6be 100644
--- a/matlab/dynare_estimation_1.m
+++ b/matlab/dynare_estimation_1.m
@@ -427,7 +427,7 @@ end
if (any(bayestopt_.pshape >0 ) && options_.mh_replic) || ...
(any(bayestopt_.pshape >0 ) && options_.load_mh_file) %% not ML estimation
- bounds = prior_bounds(bayestopt_,options_);
+ bounds = prior_bounds(bayestopt_, options_.prior_trunc);
outside_bound_pars=find(xparam1 < bounds.lb | xparam1 > bounds.ub);
if ~isempty(outside_bound_pars)
for ii=1:length(outside_bound_pars)
diff --git a/matlab/dynare_estimation_init.m b/matlab/dynare_estimation_init.m
index 8aac9ef33ac0af12e77139d527ff7ca486a86740..81e0b7e04f10b0fccf6124b30a4c749d810a2b9f 100644
--- a/matlab/dynare_estimation_init.m
+++ b/matlab/dynare_estimation_init.m
@@ -315,7 +315,7 @@ if ~isempty(estim_params_) && ~all(strcmp(fieldnames(estim_params_),'full_calibr
plot_priors(bayestopt_,M_,estim_params_,options_)
end
% Set prior bounds
- bounds = prior_bounds(bayestopt_,options_);
+ bounds = prior_bounds(bayestopt_, options_.prior_trunc);
bounds.lb = max(bounds.lb,lb);
bounds.ub = min(bounds.ub,ub);
else % estimated parameters but no declared priors
diff --git a/matlab/evaluate_likelihood.m b/matlab/evaluate_likelihood.m
index 7e6c1f087b71c646c5ec5a0585b02213385f8324..39affdc5ec9b0fd18402c8bcf0fd6669ebb84858 100644
--- a/matlab/evaluate_likelihood.m
+++ b/matlab/evaluate_likelihood.m
@@ -70,6 +70,6 @@ if isempty(dataset)
[dataset, dataset_info] = makedataset(options_);
end
-llik = -dsge_likelihood(parameters,dataset,dataset_info,options_,M_,estim_params_,bayestopt_,prior_bounds(bayestopt_,options_),oo_);
+llik = -dsge_likelihood(parameters,dataset,dataset_info,options_,M_,estim_params_,bayestopt_,prior_bounds(bayestopt_,options_.prior_trunc),oo_);
ldens = evaluate_prior(parameters);
llik = llik - ldens;
\ No newline at end of file
diff --git a/matlab/gsa/prior_draw_gsa.m b/matlab/gsa/prior_draw_gsa.m
index 5dc30b79ff3e24ee54ae80a7738c5b0506c3e928..cbde56e5d6129f30b95930886219d8004c248c44 100644
--- a/matlab/gsa/prior_draw_gsa.m
+++ b/matlab/gsa/prior_draw_gsa.m
@@ -58,7 +58,7 @@ if init
[junk1,junk2,junk3,lb,ub,junk4] = set_prior(estim_params_,M_,options_); %Prepare bounds
if ~isempty(bayestopt_) && any(bayestopt_.pshape > 0)
% Set prior bounds
- bounds = prior_bounds(bayestopt_,options_);
+ bounds = prior_bounds(bayestopt_, options_.prior_trunc);
bounds.lb = max(bounds.lb,lb);
bounds.ub = min(bounds.ub,ub);
else % estimated parameters but no declared priors
diff --git a/matlab/gsa/redform_map.m b/matlab/gsa/redform_map.m
index 448b1a634d0ab96706aa239efc3adc431c338d82..1bb76f401f5c4098e5eeb48ba8596cd9d3983e0d 100644
--- a/matlab/gsa/redform_map.m
+++ b/matlab/gsa/redform_map.m
@@ -56,7 +56,7 @@ pvalue_corr = options_gsa_.alpha2_redform;
pnames = M_.param_names(estim_params_.param_vals(:,1),:);
fname_ = M_.fname;
-bounds = prior_bounds(bayestopt_,options_);
+bounds = prior_bounds(bayestopt_, options_.prior_trunc);
if nargin==0,
dirname='';
diff --git a/matlab/gsa/stab_map_.m b/matlab/gsa/stab_map_.m
index c52b381e4886f69f7c97877ea592322b9216b96d..767d82fa636f0aa843d466fe24187286bd6a2ce8 100644
--- a/matlab/gsa/stab_map_.m
+++ b/matlab/gsa/stab_map_.m
@@ -99,7 +99,7 @@ p4 = bayestopt_.p4(nshock+1:end);
[junk1,junk2,junk3,lb,ub,junk4] = set_prior(estim_params_,M_,options_); %Prepare bounds
if ~isempty(bayestopt_) && any(bayestopt_.pshape > 0)
% Set prior bounds
- bounds = prior_bounds(bayestopt_,options_);
+ bounds = prior_bounds(bayestopt_, options_.trunc);
bounds.lb = max(bounds.lb,lb);
bounds.ub = min(bounds.ub,ub);
else % estimated parameters but no declared priors
diff --git a/matlab/identification_analysis.m b/matlab/identification_analysis.m
index 7eac2d1999225e9117005cf2bc9de92be52d2935..b948d91a10064a5f36f5a5f467bce8171915a058 100644
--- a/matlab/identification_analysis.m
+++ b/matlab/identification_analysis.m
@@ -147,7 +147,7 @@ if info(1)==0,
info = stoch_simul(char(options_.varobs));
dataset_ = dseries(oo_.endo_simul(options_.varobs_id,100+1:end)',dates('1Q1'), options_.varobs);
derivatives_info.no_DLIK=1;
- bounds = prior_bounds(bayestopt_,options_);
+ bounds = prior_bounds(bayestopt_, options_.prior_trunc);
[fval,DLIK,AHess,cost_flag,ys,trend_coeff,info,M_,options_,bayestopt_,oo_] = dsge_likelihood(params',dataset_,dataset_info,options_,M_,estim_params_,bayestopt_,bounds,oo_,derivatives_info);
% fval = DsgeLikelihood(xparam1,data_info,options_,M_,estim_params_,bayestopt_,oo_);
options_.analytic_derivation = analytic_derivation;
diff --git a/matlab/print_table_prior.m b/matlab/print_table_prior.m
index 26e60fc4bf88b153d4e594c019ced08c042eef2c..605adfabf7ff8aad771e4b829711a7a998b63b61 100644
--- a/matlab/print_table_prior.m
+++ b/matlab/print_table_prior.m
@@ -38,7 +38,7 @@ T2 = strvcat(T2, l2);
prior_trunc_backup = DynareOptions.prior_trunc ;
DynareOptions.prior_trunc = (1-DynareOptions.prior_interval)/2 ;
-PriorIntervals = prior_bounds(BayesInfo,DynareOptions) ;
+PriorIntervals = prior_bounds(BayesInfo, DynareOptions.prior_trunc) ;
DynareOptions.prior_trunc = prior_trunc_backup ;
RESIZE = false;
diff --git a/matlab/prior_bounds.m b/matlab/prior_bounds.m
index 66baf8494398452821cf6d621f40d4aed0d5591e..c9f302b553c68743eca2d8f6139eac789a55f56b 100644
--- a/matlab/prior_bounds.m
+++ b/matlab/prior_bounds.m
@@ -1,4 +1,4 @@
-function bounds = prior_bounds(bayestopt,options)
+function bounds = prior_bounds(bayestopt, prior_trunc)
%@info:
%! @deftypefn {Function File} {@var{bounds} =} prior_bounds (@var{bayesopt},@var{option})
@@ -69,7 +69,6 @@ p3 = bayestopt.p3;
p4 = bayestopt.p4;
p6 = bayestopt.p6;
p7 = bayestopt.p7;
-prior_trunc = options.prior_trunc;
bounds.lb = zeros(length(p6),1);
bounds.ub = zeros(length(p6),1);
diff --git a/matlab/prior_draw.m b/matlab/prior_draw.m
index 1436406c0f748edf7cf10298b1af494e724b6072..600e6881f2ab3cbc362e1bed0ed14224e643ec2d 100644
--- a/matlab/prior_draw.m
+++ b/matlab/prior_draw.m
@@ -51,7 +51,7 @@ if nargin>0 && init
p7 = evalin('base', 'bayestopt_.p7');
p3 = evalin('base', 'bayestopt_.p3');
p4 = evalin('base', 'bayestopt_.p4');
- bounds = evalin('base', 'prior_bounds(bayestopt_,options_)');
+ bounds = evalin('base', 'prior_bounds(bayestopt_, options_.prior_trunc)');
lb = bounds.lb;
ub = bounds.ub;
number_of_estimated_parameters = length(p6);
@@ -173,6 +173,9 @@ if weibull_draws
end
end
+
+
+
%@test:1
%$ %% Initialize required structures
%$ options_.prior_trunc=0;
@@ -190,17 +193,17 @@ end
%$ estim_params_.param_vals = [1, NaN, (-Inf), Inf, 1, 0.356, 0.02, NaN, NaN, NaN ];
%$
%$ %% beta
-%$ estim_params_.param_vals(1,3)= -Inf;%LB
-%$ estim_params_.param_vals(1,4)= +Inf;%UB
-%$ estim_params_.param_vals(1,5)= 1;%Shape
+%$ estim_params_.param_vals(1,3)= -Inf; % LB
+%$ estim_params_.param_vals(1,4)= +Inf; % UB
+%$ estim_params_.param_vals(1,5)= 1; % Shape
%$ estim_params_.param_vals(1,6)=0.5;
%$ estim_params_.param_vals(1,7)=0.01;
%$ estim_params_.param_vals(1,8)=NaN;
%$ estim_params_.param_vals(1,9)=NaN;
%$
-%$ [xparam1, estim_params_, bayestopt_, lb, ub, M_]=set_prior(estim_params_, M_, options_);
-%$
-%$ pdraw = prior_draw(1,0);
+%$ [xparam1, estim_params_, bayestopt_, lb, ub, M_]=set_prior(estim_params_, M_, options_)
+%$
+%$ pdraw = prior_draw(1,0); pdraw
%$ pdraw_vec=NaN(ndraws,1);
%$ for ii=1:ndraws
%$ pdraw_vec(ii)=prior_draw(0,0);
@@ -437,7 +440,7 @@ end
%$ estim_params_.param_vals(1,9)=3;
%$
%$ [xparam1, estim_params_, bayestopt_, lb, ub, M_]=set_prior(estim_params_, M_, options_);
-%$ bounds = prior_bounds(bayestopt_,options_)';
+%$ bounds = prior_bounds(bayestopt_,options_.prior_trunc)';
%$
%$ pdraw = prior_draw(1,0);
%$ pdraw_vec=NaN(ndraws,1);
@@ -459,7 +462,7 @@ end
%$ estim_params_.param_vals(1,9)=NaN;
%$
%$ [xparam1, estim_params_, bayestopt_, lb, ub, M_]=set_prior(estim_params_, M_, options_);
-%$ bounds = prior_bounds(bayestopt_,options_)';
+%$ bounds = prior_bounds(bayestopt_,options_.prior_trunc)';
%$
%$ pdraw = prior_draw(1,0);
%$ pdraw_vec=NaN(ndraws,1);
@@ -481,7 +484,7 @@ end
%$ estim_params_.param_vals(1,9)=NaN;
%$
%$ [xparam1, estim_params_, bayestopt_, lb, ub, M_]=set_prior(estim_params_, M_, options_);
-%$ bounds = prior_bounds(bayestopt_,options_)';
+%$ bounds = prior_bounds(bayestopt_,options_.prior_trunc)';
%$
%$ pdraw = prior_draw(1,0);
%$ pdraw_vec=NaN(ndraws,1);
@@ -503,7 +506,7 @@ end
%$ estim_params_.param_vals(1,9)=NaN;
%$
%$ [xparam1, estim_params_, bayestopt_, lb, ub, M_]=set_prior(estim_params_, M_, options_);
-%$ bounds = prior_bounds(bayestopt_,options_)';
+%$ bounds = prior_bounds(bayestopt_,options_.prior_trunc)';
%$
%$ pdraw = prior_draw(1,0);
%$ pdraw_vec=NaN(ndraws,1);
@@ -526,7 +529,7 @@ end
%$ estim_params_.param_vals(1,9)=NaN;
%$
%$ [xparam1, estim_params_, bayestopt_, lb, ub, M_]=set_prior(estim_params_, M_, options_);
-%$ bounds = prior_bounds(bayestopt_,options_)';
+%$ bounds = prior_bounds(bayestopt_,options_.prior_trunc)';
%$
%$ pdraw = prior_draw(1,0);
%$ pdraw_vec=NaN(ndraws,1);