Skip to content
Snippets Groups Projects
Commit 468c5a35 authored by Stéphane Adjemian's avatar Stéphane Adjemian Committed by Stéphane Adjemian (Scylla)
Browse files

Added an error message when the declared mean of beta shaped priors is outside...

Added an error message when the declared mean of beta shaped priors is outside the domain of the beta density.
(cherry picked from commit 83a3456eca3495e4a75d2495c5810e28b530d6d4)
parent 0b640cb2
No related branches found
Tags
No related merge requests found
......@@ -166,6 +166,9 @@ bayestopt_.p3(k(k1)) = zeros(length(k1),1);
k1 = find(isnan(bayestopt_.p4(k)));
bayestopt_.p4(k(k1)) = ones(length(k1),1);
for i=1:length(k)
if (bayestopt_.p1(k(i))<bayestopt_.p3(k(i))) || (bayestopt_.p1(k(i))>bayestopt_.p4(k(i)))
error(['The prior mean of ' bayestopt_.name{k(i)} ' has to be between the lower (' num2str(bayestopt_.p3(k(i))) ') and upper (' num2str(bayestopt_.p4(k(i))) ') bounds of the beta prior density!']);
end
mu = (bayestopt_.p1(k(i))-bayestopt_.p3(k(i)))/(bayestopt_.p4(k(i))-bayestopt_.p3(k(i)));
stdd = bayestopt_.p2(k(i))/(bayestopt_.p4(k(i))-bayestopt_.p3(k(i)));
bayestopt_.p6(k(i)) = (1-mu)*mu^2/stdd^2 - mu ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment