[rand.dist.bern.negbin] negative_binomial_distribution has unclear specification for p == 1 LWG 3402 #3606
Labels
lwg
Issue must be reviewed by LWG.
not-editorial
Issue is not deemed editorial; the editorial issue is kept open for tracking.
Latter parameter of std::negative_binomial_distribution ([rand.dist.bern.negbin]) is required by the constructor to be less or equal to 1. However a note before says that the mathematical expression "is undefined when p == 1". This leaves it unclear what p == 1 should mean for the program.
Why this is a problem?
Using the distribution with wrong parameters can result to UB (e.g. application termination), so it's essential to know what parameters can be used.
Questions to clarify:
The note about P(i|k,p) being undefined has been added by LWG2406, but creating this issue as editorial as LWG2406 resulted only to change in non-normative text. It's also worth noting that both premises in LWG2406 seem untrue:
-As mentioned above, 0^0 can be considered to be 1 in this context.
-p == 1 is and was accepted even in Wikipedia in 2014. [3]
References:
[1] https://reference.wolfram.com/language/ref/NegativeBinomialDistribution.html
[2] https://en.wikipedia.org/w/index.php?title=Negative_binomial_distribution&oldid=931222356 (2019-12-17)
[3] https://en.wikipedia.org/w/index.php?title=Negative_binomial_distribution&oldid=611204120 (2014-06-02)
[4] https://se.mathworks.com/help/stats/prob.negativebinomialdistribution.html
[5] http://search.r-project.org/R/library/stats/html/NegBinomial.html
The text was updated successfully, but these errors were encountered: