Added an error message when the declared mean of beta shaped priors is outside the domain of the beta density.
parent
2ad8d2218f
commit
947ac4281a
|
@ -166,6 +166,9 @@ bayestopt_.p3(k(k1)) = zeros(length(k1),1);
|
||||||
k1 = find(isnan(bayestopt_.p4(k)));
|
k1 = find(isnan(bayestopt_.p4(k)));
|
||||||
bayestopt_.p4(k(k1)) = ones(length(k1),1);
|
bayestopt_.p4(k(k1)) = ones(length(k1),1);
|
||||||
for i=1:length(k)
|
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)));
|
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)));
|
stdd = bayestopt_.p2(k(i))/(bayestopt_.p4(k(i))-bayestopt_.p3(k(i)));
|
||||||
bayestopt_.p6(k(i)) = (1-mu)*mu^2/stdd^2 - mu ;
|
bayestopt_.p6(k(i)) = (1-mu)*mu^2/stdd^2 - mu ;
|
||||||
|
|
Loading…
Reference in New Issue