model_comparison: Do not issue warning if all prior densities are 1

If the user specifies nothing, this is the default, which should not result in a warning
time-shift
Johannes Pfeifer 2015-08-06 11:01:39 +02:00
parent a072294cab
commit 6e93c83b69
1 changed files with 4 additions and 2 deletions

View File

@ -47,8 +47,10 @@ else % The prior density has to sum up to one.
prior_flag = 1;
improper = abs(sum(ModelPriors)-1)>1e-6;
if improper
disp('model_comparison:: The user supplied prior distribution over models is improper...')
disp('model_comparison:: The distribution is automatically rescaled!')
if ~all(ModelPriors==1)
disp('model_comparison:: The user supplied prior distribution over models is improper...')
disp('model_comparison:: The distribution is automatically rescaled!')
end
ModelPriors=ModelPriors/sum(ModelPriors);
end
end