logdBeta

logdBeta(p1, p2, x)

Logarithm of the probability density function of a Beta distribution on [0,1].

Parameters:
alphafloat, \alpha > 0

Parameter \alpha.

betafloat, \beta > 0

Parameter \beta.

xfloat

Location.

Returns:
logpfloat

The logarithm of the PDF at x.

Notes

The logarithm of the probability density function is defined as:

\log p(x) = -\log B(\alpha, \beta)
+ (\alpha - 1)\log(x) + (\beta - 1)\log(1 - x)
\quad x \in (0,1)

with \alpha, \beta > 0 and where \rm B denotes Euler’s beta function Beta().

Outside the open interval (0,1), the returned value is -\infty. This function avoids the underflow that may occur when evaluating the PDF directly.

Examples

>>> import openturns as ot
>>> logpdf = ot.DistFunc.logdBeta(2.5, 3.5, 0.9)