mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[probability] Add comment for future improvement in Binomial law
computation
This commit is contained in:
committed by
LeaNumworks
parent
0ee32e15be
commit
84a78c8a9b
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user