!!!Boost: Lévy distribution#

The following functions return the pdf, cdf, qtf or boost class of the Lévy distribution with location \(a \in \mathbb{R}\), scale \(b > 0\) and the support interval \((a, +\infty)\).

See also Wikipedia [1276], Ehrhardt [309] (3.9.16).

Ctx.levy_pdf(x, a=0, b=1)#

where Ctx is Math53 or CtxBoost.

Returns \(\text{pdf}(x)\), the value of the probability density function (Pdf) of the Lévy distribution:

\[\text{pdf}(x) = \sqrt{\frac{b}{2\pi}} \frac{e^ {-\frac{b}{2(x-a)}}}{(x-a)^{3/2}}.\]

The following example shows both forms of the syntax:

>>> from mpfebnet import *
>>> a = 0; b = 1; t = 0.3; x = 0.6;
>>> print ("LevyPdf(x, a, b): ", LevyPdf(x, a, b))
>>> print ("dist_levy(a, b).pdf(x): ", dist_levy(a, b).pdf(x))
6.3563523462564525615615615614561356E+00

Ctx.levy_cdf(x, a=0, b=1)#

where Ctx is Math53 or CtxBoost.

Returns \(\text{cdf}(x)\), the value of the cumulative distribution function (Cdf) of the Lévy distribution:

\[\text{cdf}(x) = \text{erfc} \left( \sqrt{\frac{b}{2(x-a)}} \right).\]

The following example shows both forms of the syntax:

>>> from mpfebnet import *
>>> a = 0; b = 1; t = 0.3; x = 0.6;
>>> print ("LevyCdf(x, a, b): ", LevyCdf(x, a, b))
>>> print ("dist_levy(a, b).cdf(x): ", dist_levy(a, b).cdf(x))
6.3563523462564525615615615614561356E+00

Ctx.levy_qtf(q, a=0, b=1)#

where Ctx is Math53 or CtxBoost.

Returns \(\text{qtf}(q)\), the value of the quantile function (Qtf) of the Lévy distribution:

\[\text{qtf}(q) = a + \frac{b}{2 (\text{erfc}^{-1}(q))^2}.\]

The following example shows both forms of the syntax:

>>> from mpfebnet import *
>>> a = 0; b = 1; t = 0.3; q = 0.6;
>>> print ("LevyQtf(q, a, b): ", LevyQtf(q, a, b))
>>> print ("dist_levy(a, b).qtf(q): ", dist_levy(a, b).qtf(q))
6.3563523462564525615615615614561356E+00

class ctx.dist_levy(a, b)#

where ctx is fpm, mpm, ipm, dec, gmp or apm.

The Lévy distribution is a continuous probability distribution with location \(a \in \mathbb{R}\), scale \(b > 0\) and the support interval \((a, +\infty)\). See also Wikipedia [1276], MathWorld [903].

dist_levy.pdf(x)#

Returns \(\text{pdf}_X(x)\), the probability density function (pdf) of a random variable \(X\), following a Lévy distribution:

\[\text{pdf}_X(x) = \sqrt{\frac{b}{2\pi}} \frac{e^ {-\frac{b}{2(x-a)}}}{(x-a)^{3/2}}.\]
>>> from mpfunlab import *
>>> mp.dps = 30
>>> mu = 0; sigma = 1; x = 3;
>>> print ("pdf: ", levy(mu, sigma).pdf(x))
6.3563523462564525615615615614561356E-20

dist_levy.cdf(x)#

Returns \(\text{cdf}_X(x)\), the cumulative distribution function (cdf) of a random variable \(X\), following a Lévy distribution:

\[\text{cdf}_X(x) = \text{erfc} \left( \sqrt{\frac{b}{2(x-a)}} \right).\]
>>> from mpfunlab import *
>>> mp.dps = 30
>>> mu = 0; sigma = 1; x = 3;
>>> print ("cdf: ", levy(mu, sigma).pdf(x))
6.3563523462564525615615615614561356E-20

dist_levy.sf(x)#

Returns \(\text{sf}_X(x)\), the survival function function (sf) of a random variable \(X\), following a Lévy distribution:

\[\text{sf}_X(x) = \text{erf} \left( \sqrt{\frac{b}{2(x-a)}} \right).\]
>>> from mpfunlab import *
>>> mp.dps = 30
>>> mu = 0; sigma = 1; x = 3;
>>> print (" sf: ", levy(mu, sigma).pdf(x))
sf: 6.3563523462564525615615615614561356E-20

dist_levy.qtf(q)#

Returns \(\text{qtf}_X(x)\), the quantile function function (qtf) of a random variable \(X\), following a Lévy distribution:

\[\text{qtf}_X(q) = a + \frac{b}{2 (\text{erfc}^{-1}(q))^2}.\]

where \(\text{erfc}(\cdot)\) and \(\text{erfc}^{-1}(\cdot)\) denote the complementary error function and its functional inverse, respectively.

>>> from mpfunlab import *
>>> mp.dps = 30
>>> mu = 0; sigma = 1; q = 0.3;
>>> print ("qtf: ", levy(mu, sigma).qtf(q))
qtf: 6.3563523462564525615615615614561356E+00

dist_levy.isf(q)#

Returns \(\text{isf}_X(q)\), the inverse survival function function (isf) of a random variable \(X\), following a Lévy distribution:

\[\text{isf}_X(q) = a + \frac{b}{2 (\text{erf}^{-1}(q))^2}.\]

where \(\text{erfc}(\cdot)\) and \(\text{erfc}^{-1}(\cdot)\) denote the complementary error function and its functional inverse, respectively.

>>> from mpfunlab import *
>>> mp.dps = 30
>>> mu = 0; sigma = 1; q = 0.3;
>>> print ("isf: ", levy(mu, sigma).isf(q))
6.3563523462564525615615615614561356E+00

dist_levy.c_x(t)#

Returns \(C_X(t)\), the characteristic function of a random variable \(X\), following a Lévy distribution:

\[C_X(t) = e^{i \mu t - \sqrt{-2 i ct}}.\]
>>> from mpfunlab import *
>>> mp.dps = 30
>>> mu = 0; sigma = 1; t = 0.3;
>>> print ("c_x: ", levy(mu, sigma).c_x(t))
6.3563523462564525615615615614561356E+00

dist_levy.m_x(t)#

Returns NaN, since the moment generating function does not exist.

dist_levy.k_x(t, k=0)#

Returns NaN, since the cumulant generating function does not exist.

dist_levy.moments(k)#

Returns NaN, since moments do not exist.

dist_levy.cumulants(k)#

Returns NaN, since cumulants do not exist.