From 9c3c0d727f7fe336c02e580c57b13f5ab9f29314 Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Wed, 17 Sep 2014 20:06:57 +0200 Subject: [PATCH] Add check for point priors and force user to fix this parameter. Traps Inf-prior --- matlab/set_prior.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/matlab/set_prior.m b/matlab/set_prior.m index 7bc3cc83d..a72a6204d 100644 --- a/matlab/set_prior.m +++ b/matlab/set_prior.m @@ -155,6 +155,12 @@ end bayestopt_.p6 = NaN(size(bayestopt_.p1)) ; bayestopt_.p7 = bayestopt_.p6 ; +%% check for point priors and disallow them as they do not work with MCMC +if any(bayestopt_.p2 ==0) + error(sprintf(['Error in prior for %s: you cannot use a point prior in estimation. Either increase the prior standard deviation',... + ' or fix the parameter completely.'], bayestopt_.name{bayestopt_.p2 ==0})) +end + % generalized location parameters by default for beta distribution k = find(bayestopt_.pshape == 1); k1 = find(isnan(bayestopt_.p3(k)));