From b15cac0047ea5343139c6e40ae554bfd47747875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Gpm=29?= Date: Thu, 28 Apr 2011 12:33:01 +0200 Subject: [PATCH] Added error message when an infinite std. is used with a Gamma shaped prior. --- matlab/set_prior.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/matlab/set_prior.m b/matlab/set_prior.m index 12c142d7f..c2e388d9a 100644 --- a/matlab/set_prior.m +++ b/matlab/set_prior.m @@ -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)) ;