logdBinomial

logdBinomial(n, p, k)

Logarithm of the probability distribution function of a binomial distribution.

Parameters:
nint, n>0

The number of trials.

pfloat, 0\leq p\leq 1

The success probability of each trial.

kint

The number of success.

Returns:
logpfloat

The natural logarithm of the probability to get k successes.

Notes

This method implements Loader’s algorithm, the fast and accurate method described in [loader2000], with the further improvements mentioned in [dimitriadis2016].

Examples

>>> import openturns as ot
>>> p = ot.DistFunc.logdBinomial(5, 0.2, 2)