[probability] Add comment for future improvement in Binomial law

computation
This commit is contained in:
Émilie Feral
2018-05-23 09:59:41 +02:00
committed by LeaNumworks
parent 0ee32e15be
commit 84a78c8a9b

View File

@@ -70,6 +70,13 @@ float BinomialLaw::yMax() {
bool BinomialLaw::authorizedValueAtIndex(float x, int index) const {
if (index == 0) {
/* As the cumulative probability are computed by looping over all discrete
* abscissa within the interesting range, the complexity of the cumulative
* probability is linear with the size of the range. Here we cap the maximal
* size of the range to 10000. If one day we want to increase or get rid of
* this cap, we should implement the explicite formula of the cumulative
* probability (which depends on an incomplete beta function) to make the
* comlexity O(1). */
if (x != (int)x || x < 0.0f || x > 9999.0f) {
return false;
}