Add comments to make clear distinction between generalized distribution and user-imposed bound

time-shift
Johannes Pfeifer 2014-01-28 18:41:07 +01:00
parent 0ec62c6360
commit d5446e734a
3 changed files with 16 additions and 16 deletions

View File

@ -5,8 +5,8 @@ function [ldens,Dldens,D2ldens] = lpdfgbeta(x,a,b,aa,bb);
% x [double] m*n matrix of loactions,
% a [double] m*n matrix of First BETA distribution parameters,
% b [double] m*n matrix of Second BETA distribution parameters,
% aa [double] m*n matrix of lower bounds,
% bb [double] m*n matrix of upper bounds.
% aa [double] m*n matrix of lower bounds for (generalized) distribution,
% bb [double] m*n matrix of upper bounds for (generalized) distribution
%
% OUTPUTS
% ldens [double] m*n matrix of logged (generalized) BETA densities.

View File

@ -6,8 +6,8 @@ function [logged_prior_density, dlprior, d2lprior] = priordens(x, pshape, p6, p7
% pshape [integer] vector with n elements (bayestopt_.pshape).
% p6: [double] vector with n elements, first parameter of the prior distribution (bayestopt_.p6).
% p7: [double] vector with n elements, second parameter of the prior distribution (bayestopt_.p7).
% p3: [double] vector with n elements, lower bounds.
% p4: [double] vector with n elements, upper bound.
% p3: [double] vector with n elements, lower bounds of the untruncated standard or generalized distribution
% p4: [double] vector with n elements, upper bound of the untruncated standard or generalized distribution
% initialization [integer] if 1: initialize persistent variables
%
% OUTPUTS

View File

@ -53,8 +53,8 @@ lb = [];
bayestopt_.pshape = [];
bayestopt_.p1 = []; % prior mean
bayestopt_.p2 = []; % prior standard deviation
bayestopt_.p3 = []; % lower bound
bayestopt_.p4 = []; % upper bound
bayestopt_.p3 = []; % lower bound of the distribution, only considering whether a generalized distribution is used, not when the prior is truncated
bayestopt_.p4 = []; % upper bound of the distribution, only considering whether a generalized distribution is used, not when the prior is truncated
bayestopt_.p5 = zeros(nvx+nvn+ncx+ncn+np,1); % prior mode
bayestopt_.p6 = []; % first hyper-parameter (\alpha for the BETA and GAMMA distributions, s for the INVERSE GAMMAs, expectation for the GAUSSIAN distribution, lower bound for the UNIFORM distribution).
bayestopt_.p7 = []; % second hyper-parameter (\beta for the BETA and GAMMA distributions, \nu for the INVERSE GAMMAs, standard deviation for the GAUSSIAN distribution, upper bound for the UNIFORM distribution).
@ -68,8 +68,8 @@ if nvx
bayestopt_.pshape = estim_params_.var_exo(:,5);
bayestopt_.p1 = estim_params_.var_exo(:,6);
bayestopt_.p2 = estim_params_.var_exo(:,7);
bayestopt_.p3 = estim_params_.var_exo(:,8);
bayestopt_.p4 = estim_params_.var_exo(:,9);
bayestopt_.p3 = estim_params_.var_exo(:,8); %take generalized distribution into account
bayestopt_.p4 = estim_params_.var_exo(:,9); %take generalized distribution into account
bayestopt_.jscale = estim_params_.var_exo(:,10);
bayestopt_.name = cellstr(M_.exo_names(estim_params_.var_exo(:,1),:));
end
@ -93,8 +93,8 @@ if nvn
bayestopt_.pshape = [ bayestopt_.pshape; estim_params_.var_endo(:,5)];
bayestopt_.p1 = [ bayestopt_.p1; estim_params_.var_endo(:,6)];
bayestopt_.p2 = [ bayestopt_.p2; estim_params_.var_endo(:,7)];
bayestopt_.p3 = [ bayestopt_.p3; estim_params_.var_endo(:,8)];
bayestopt_.p4 = [ bayestopt_.p4; estim_params_.var_endo(:,9)];
bayestopt_.p3 = [ bayestopt_.p3; estim_params_.var_endo(:,8)]; %take generalized distribution into account
bayestopt_.p4 = [ bayestopt_.p4; estim_params_.var_endo(:,9)]; %take generalized distribution into account
bayestopt_.jscale = [ bayestopt_.jscale; estim_params_.var_endo(:,10)];
bayestopt_.name = [ bayestopt_.name; cellstr(options_.varobs(estim_params_.nvn_observable_correspondence,:))];
end
@ -105,8 +105,8 @@ if ncx
bayestopt_.pshape = [ bayestopt_.pshape; estim_params_.corrx(:,6)];
bayestopt_.p1 = [ bayestopt_.p1; estim_params_.corrx(:,7)];
bayestopt_.p2 = [ bayestopt_.p2; estim_params_.corrx(:,8)];
bayestopt_.p3 = [ bayestopt_.p3; estim_params_.corrx(:,9)];
bayestopt_.p4 = [ bayestopt_.p4; estim_params_.corrx(:,10)];
bayestopt_.p3 = [ bayestopt_.p3; estim_params_.corrx(:,9)]; %take generalized distribution into account
bayestopt_.p4 = [ bayestopt_.p4; estim_params_.corrx(:,10)]; %take generalized distribution into account
bayestopt_.jscale = [ bayestopt_.jscale; estim_params_.corrx(:,11)];
bayestopt_.name = [bayestopt_.name; cellstr([repmat('corr ',ncx,1)...
deblank(M_.exo_names(estim_params_.corrx(:,1),:)) ...
@ -125,8 +125,8 @@ if ncn
bayestopt_.pshape = [ bayestopt_.pshape; estim_params_.corrn(:,6)];
bayestopt_.p1 = [ bayestopt_.p1; estim_params_.corrn(:,7)];
bayestopt_.p2 = [ bayestopt_.p2; estim_params_.corrn(:,8)];
bayestopt_.p3 = [ bayestopt_.p3; estim_params_.corrn(:,9)];
bayestopt_.p4 = [ bayestopt_.p4; estim_params_.corrn(:,10)];
bayestopt_.p3 = [ bayestopt_.p3; estim_params_.corrn(:,9)]; %take generalized distribution into account
bayestopt_.p4 = [ bayestopt_.p4; estim_params_.corrn(:,10)]; %take generalized distribution into account
bayestopt_.jscale = [ bayestopt_.jscale; estim_params_.corrn(:,11)];
bayestopt_.name = [bayestopt_.name; cellstr([repmat('corr ',ncn,1) ...
deblank(M_.endo_names(estim_params_.corrn(:,1),:)) ...
@ -146,8 +146,8 @@ if np
bayestopt_.pshape = [ bayestopt_.pshape; estim_params_.param_vals(:,5)];
bayestopt_.p1 = [ bayestopt_.p1; estim_params_.param_vals(:,6)];
bayestopt_.p2 = [ bayestopt_.p2; estim_params_.param_vals(:,7)];
bayestopt_.p3 = [ bayestopt_.p3; estim_params_.param_vals(:,8)];
bayestopt_.p4 = [ bayestopt_.p4; estim_params_.param_vals(:,9)];
bayestopt_.p3 = [ bayestopt_.p3; estim_params_.param_vals(:,8)]; %take generalized distribution into account
bayestopt_.p4 = [ bayestopt_.p4; estim_params_.param_vals(:,9)]; %take generalized distribution into account
bayestopt_.jscale = [ bayestopt_.jscale; estim_params_.param_vals(:,10)];
bayestopt_.name = [bayestopt_.name; cellstr(M_.param_names(estim_params_.param_vals(:,1),:))];
end