Skip to content
Snippets Groups Projects
Commit 88858a1f authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Cosmetic change.

Use logicals instead of 0/1.
parent dc1df095
Branches
Tags
No related merge requests found
function pdraw = prior_draw(init,uniform) % --*-- Unitary tests --*-- function pdraw = prior_draw(init,uniform) % --*-- Unitary tests --*--
% This function generate one draw from the joint prior distribution and % This function generate one draw from the joint prior distribution and
% allows sampling uniformly from the prior support (uniform==1 when called with init==1) % allows sampling uniformly from the prior support (uniform==1 when called with init==1)
% %
...@@ -62,45 +63,45 @@ if nargin>0 && init ...@@ -62,45 +63,45 @@ if nargin>0 && init
end end
beta_index = find(prior_shape==1); beta_index = find(prior_shape==1);
if isempty(beta_index) if isempty(beta_index)
beta_draws = 0; beta_draws = false;
else else
beta_draws = 1; beta_draws = true;
end end
gamma_index = find(prior_shape==2); gamma_index = find(prior_shape==2);
if isempty(gamma_index) if isempty(gamma_index)
gamma_draws = 0; gamma_draws = false;
else else
gamma_draws = 1; gamma_draws = true;
end end
gaussian_index = find(prior_shape==3); gaussian_index = find(prior_shape==3);
if isempty(gaussian_index) if isempty(gaussian_index)
gaussian_draws = 0; gaussian_draws = false;
else else
gaussian_draws = 1; gaussian_draws = true;
end end
inverse_gamma_1_index = find(prior_shape==4); inverse_gamma_1_index = find(prior_shape==4);
if isempty(inverse_gamma_1_index) if isempty(inverse_gamma_1_index)
inverse_gamma_1_draws = 0; inverse_gamma_1_draws = false;
else else
inverse_gamma_1_draws = 1; inverse_gamma_1_draws = true;
end end
uniform_index = find(prior_shape==5); uniform_index = find(prior_shape==5);
if isempty(uniform_index) if isempty(uniform_index)
uniform_draws = 0; uniform_draws = false;
else else
uniform_draws = 1; uniform_draws = true;
end end
inverse_gamma_2_index = find(prior_shape==6); inverse_gamma_2_index = find(prior_shape==6);
if isempty(inverse_gamma_2_index) if isempty(inverse_gamma_2_index)
inverse_gamma_2_draws = 0; inverse_gamma_2_draws = false;
else else
inverse_gamma_2_draws = 1; inverse_gamma_2_draws = true;
end end
weibull_index = find(prior_shape==8); weibull_index = find(prior_shape==8);
if isempty(weibull_index) if isempty(weibull_index)
weibull_draws = 0; weibull_draws = false;
else else
weibull_draws = 1; weibull_draws = true;
end end
pdraw = NaN(number_of_estimated_parameters,1); pdraw = NaN(number_of_estimated_parameters,1);
return return
...@@ -173,9 +174,6 @@ if weibull_draws ...@@ -173,9 +174,6 @@ if weibull_draws
end end
end end
%@test:1 %@test:1
%$ %% Initialize required structures %$ %% Initialize required structures
%$ options_.prior_trunc=0; %$ options_.prior_trunc=0;
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment