MixedSustitutionModelSet - division by 0

3 views
Skip to first unread message

Keren Halabi

unread,
Aug 12, 2020, 4:08:59 AM8/12/20
to Bio++ Usage Help Forum
Hi dear team,

I have encountered an issue of division by 0 in MixedSustitutionModelSet.cpp in the following lines:

248: the value of prob can be 0, leading to nan in this line
264: the value of h.getProbability() can be 0, leading to nan in this line

I am not sure I understand correctly, but in such case I don't think the probabilities need to be normalized so the division is not required. Am I correct to assume this? If yes, I can pull request a fix.

Many thanks!
Keren

Laurent Guéguen

unread,
Aug 12, 2020, 11:46:42 AM8/12/20
to Bio++ Usage Help Forum
Hi Keren,

this class should become obsolete in the next version of bpp-phyl, since the computation of mixed likelihoods
is completely different.

However, this division is due to the fact that in a subset of mixed models, the normalized rate should be 1,
and for this we need to compute the probabilities of the submodels inside this subset of mixed models.
And then at line 264 the real probabilities of the submodels (in the context of the whole set of models) is
computed, using for this the probability of the hypernode.

Indeed, when this probability is 0, there is a nan.

Cheers,
Laurent


Keren Halabi

unread,
Aug 12, 2020, 12:05:02 PM8/12/20
to Bio++ Usage Help Forum
Thank you for the quick and elaborated response!

If I understand correctly, this standardization is meant to assure that, given a sub-model in a mixed model set, the probabilities of the sub-sub models within it should sum up to 1.
However, in the case that the absolute probability of a sub-sub model is 0, I think there is no need to divide the probability within the sub-model by its absolute probability, as it is 0 to begin with. Is this indeed the case? If not, what would be the recommended fix in this case?

Many thanks again!
Keren
Reply all
Reply to author
Forward
0 new messages