## distributions.Stable


An alpha-stable law `S(alpha, beta, scale, loc)` for [invert_chf](distributions.invert_chf.md#prospicio.distributions.invert_chf).


Usage

``` python
distributions.Stable()
```


With [beta](risk.Gpd.md#prospicio.risk.Gpd.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](models.ElasticNet.md#prospicio.models.ElasticNet.alpha) add (`x + y`), and `c * x`, `x + b`, `-x` and `t @ x` ([t](distributions.Pareto.md#prospicio.distributions.Pareto.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

``` python
>>> 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](#alpha) | The index of stability. |
| [beta](#beta) | The skewness. |
| [left_tail_constant](#left_tail_constant) | `B` in `P(X < -x) ~ B x ** -alpha`. |
| [loc](#loc) | The S1 location. |
| [loc0](#loc0) | The S0 location. |
| [mean](#mean) | The mean: [loc](distributions.Stable.md#prospicio.distributions.Stable.loc) for `alpha > 1`, else infinite or `nan`. |
| [prob_above_loc](#prob_above_loc) | `P(X > loc)` in closed form; `nan` at `alpha = 1` unless |
| [scale](#scale) | The scale. |
| [tail_constant](#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](distributions.Stable.md#prospicio.distributions.Stable.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__()](#__add__) | `X + Y` for an independent stable [Y](distributions.TemperedStable.md#prospicio.distributions.TemperedStable.Y) with the same [alpha](models.ElasticNet.md#prospicio.models.ElasticNet.alpha), |
| [__mul__()](#__mul__) | `c * X` for a real `c != 0`. |
| [__rmatmul__()](#__rmatmul__) | `t @ X`, as [copies()](distributions.Stable.md#prospicio.distributions.Stable.copies). |
| [__sub__()](#__sub__) | `X - Y` (an independent copy) or `X - b`. |
| [copies()](#copies) | The sum of `t > 0` independent copies, `t @ X`: scale |
| [from_compound_pareto()](#from_compound_pareto) | The stable limit of a Poisson compound with a Pareto tail (the |

------------------------------------------------------------------------


#### \_\_add\_\_()


`X + Y` for an independent stable [Y](distributions.TemperedStable.md#prospicio.distributions.TemperedStable.Y) with the same [alpha](models.ElasticNet.md#prospicio.models.ElasticNet.alpha),


Usage

``` python
__add__(other)
```


or `X + b` for a number.


------------------------------------------------------------------------


#### \_\_mul\_\_()


`c * X` for a real `c != 0`.


Usage

``` python
__mul__(c)
```


------------------------------------------------------------------------


#### \_\_rmatmul\_\_()


`t @ X`, as [copies()](distributions.Stable.md#prospicio.distributions.Stable.copies).


Usage

``` python
__rmatmul__(t)
```


------------------------------------------------------------------------


#### \_\_sub\_\_()


`X - Y` (an independent copy) or `X - b`.


Usage

``` python
__sub__(other)
```


------------------------------------------------------------------------


#### copies()


The sum of `t > 0` independent copies, `t @ X`: scale


Usage

``` python
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

``` python
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

``` python
>>> 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)
