algorithm for calculating CDF (default: BinomialAlgo.direct)
algorithm for poisson approximation (default: PoissonAlgo.direct)
assert(0.15.binomialInvCDF(6, 2.0 / 3) == 3); // For large values of `n` with `p` not too extreme, can approximate with normal distribution assert(0.5.binomialInvCDF!"approxNormal"(1_000_000, 0.55) == 550_000); // Or closer with continuity correction assert(0.500401.binomialInvCDF!"approxNormalContinuityCorrection"(1_000_000, 0.55) == 550_000); // Poisson approximation is better when `p` is low assert(0.5026596.binomialInvCDF!"approxPoisson"(1_000_000, 0.01) == 10_000);
Computes the binomial inverse cumulative distribution function (InvCDF).
Additional algorithms may be provided for calculating InvCDF that allow trading off time and accuracy. If approxPoisson is provided, the default is PoissonAlgo.direct, which is different from binomialPMF and binomialCDF PoissonAlgo.gamma is not supported.