Added error message when an infinite std. is used with a Gamma shaped prior.

time-shift
Stéphane Adjemian (Gpm) 2011-04-28 12:33:01 +02:00
parent 72c2a343b1
commit b15cac0047
1 changed files with 3 additions and 0 deletions

View File

@ -186,6 +186,9 @@ k2 = find(isnan(bayestopt_.p4(k)));
bayestopt_.p3(k(k1)) = zeros(length(k1),1);
bayestopt_.p4(k(k2)) = Inf(length(k2),1);
for i=1:length(k)
if isinf(bayestopt_.p2(k(i)))
error(['Infinite prior standard deviation for parameter ' bayestopt_.name{k(i)} ' is not allowed (Gamma prior)!'])
end
mu = bayestopt_.p1(k(i))-bayestopt_.p3(k(i));
bayestopt_.p7(k(i)) = bayestopt_.p2(k(i))^2/mu ;
bayestopt_.p6(k(i)) = mu/bayestopt_.p7(k(i)) ;