distributions.Stable
An alpha-stable law S(alpha, beta, scale, loc) for invert_chf.
Usage
distributions.Stable()With beta 1 or -1 its one power tail is inverted along a tilted line; with |beta| < 1 it is split into its two totally skewed halves, each inverted along its own tilted line and convolved. At alpha = 2 it is the normal with variance 2 scale ** 2.
Laws with a common alpha add (x + y), and c * x, x + b, -x and t @ x (t independent copies) are stable too; each operand is an independent copy, so x + x is 2 @ x, not 2 * x.
Parameters
alpha: float-
The index of stability, in
(0, 2]. beta: float-
The skewness, in
[-1, 1]. scale: float = 1-
Positive.
loc: float = 0-
The location, read in
parameterization. parameterization: (S1, S0) = "S1"- Nolan’s S1 (scipy’s default) or S0.
Raises
ValueError- If a parameter is out of range.
Examples
>>> from prospicio.distributions import Stable
>>> s = Stable(1.5, 1.0, 2.0)
>>> round(s.tail_constant, 6), round(s.loc0, 12)(1.128379, -2.0)
Attributes
| Name | Description |
|---|---|
| alpha | The index of stability. |
| beta | The skewness. |
| left_tail_constant |
B in P(X < -x) ~ B x ** -alpha.
|
| loc | The S1 location. |
| loc0 | The S0 location. |
| mean |
The mean: loc for alpha > 1, else infinite or nan.
|
| prob_above_loc |
P(X > loc) in closed form; nan at alpha = 1 unless
|
| scale | The scale. |
| tail_constant |
A in P(X > x) ~ A x ** -alpha.
|
alpha
The index of stability.
alpha: float
beta
The skewness.
beta: float
left_tail_constant
B in P(X < -x) ~ B x ** -alpha.
left_tail_constant: float
loc
The S1 location.
loc: float
loc0
The S0 location.
loc0: float
mean
The mean: loc for alpha > 1, else infinite or nan.
mean: float
prob_above_loc
P(X > loc) in closed form; nan at alpha = 1 unless
prob_above_loc: float
beta = 0.
scale
The scale.
scale: float
tail_constant
A in P(X > x) ~ A x ** -alpha.
tail_constant: float
Methods
| Name | Description |
|---|---|
| __add__() |
X + Y for an independent stable Y with the same alpha,
|
| __mul__() |
c * X for a real c != 0.
|
| __rmatmul__() |
t @ X, as copies().
|
| __sub__() |
X - Y (an independent copy) or X - b.
|
| copies() |
The sum of t > 0 independent copies, t @ X: scale
|
| from_compound_pareto() | The stable limit of a Poisson compound with a Pareto tail (the |
__add__()
Usage
__add__(other)or X + b for a number.
__mul__()
c * X for a real c != 0.
Usage
__mul__(c)__rmatmul__()
t @ X, as copies().
Usage
__rmatmul__(t)__sub__()
X - Y (an independent copy) or X - b.
Usage
__sub__(other)copies()
The sum of t > 0 independent copies, t @ X: scale
Usage
copies(t)t ** (1 / alpha) * scale, location t * loc.
Parameters
t: float
Returns
Stable
from_compound_pareto()
The stable limit of a Poisson compound with a Pareto tail (the
Usage
from_compound_pareto(frequency, alpha, theta, sev_mean)generalized central limit theorem): S(alpha, 1, gamma, frequency * sev_mean) with gamma ** alpha = frequency * theta ** alpha * Gamma(1 - alpha) * cos(pi alpha / 2), the compound’s mean and right tail.
Parameters
frequency: float-
The expected claim count.
alpha: float-
The severity’s tail index, strictly between 1 and 2.
theta: float-
The severity’s tail scale,
P(X > x) ~ (theta / x) ** alpha. sev_mean: float- The severity’s mean.
Returns
Stable
Examples
>>> from prospicio.distributions import Stable
>>> s = Stable.from_compound_pareto(50.0, 1.6, 3.0, 12.0)
>>> s.loc, round(s.tail_constant / (50 * 3.0 ** 1.6), 12)(600.0, 1.0)