distributions.LogAffinePareto
Log-affine local Pareto: the local alpha
Usage
distributions.LogAffinePareto()alpha0 * (1 + gamma * ln(x / t)) rises linearly in the log of the amount, so P(X > x) = exp(-alpha0 L - alpha0 gamma L**2 / 2) with L = ln(x / t).
Parameters
t: float-
Threshold; finite and positive.
alpha0: float-
Local alpha at t; finite and positive.
gamma: float- Non-negative; 0 gives the Pareto.
Examples
>>> from prospicio.distributions import LogAffinePareto
>>> d = LogAffinePareto.from_delta(1e6, 1.5, 0.5)
>>> round(d.local_alpha(2e6), 12)2.0
Attributes
| Name | Description |
|---|---|
| alpha0 | Local alpha at the threshold. |
| delta |
delta = alpha0 * gamma * ln 2.
|
| gamma | gamma. |
| t | Threshold t. |
alpha0
Local alpha at the threshold.
alpha0: float
delta
delta = alpha0 * gamma * ln 2.
delta: float
gamma
gamma: float
t
Threshold t.
t: float
Methods
| Name | Description |
|---|---|
| cdf() |
Distribution function P(X <= x).
|
| from_delta() |
The distribution from delta = alpha0 * gamma * ln 2, the rise
|
| layer() | Expected loss to the layer limit xs attachment. |
| layer_second_moment() | Second moment of the loss to the layer limit xs |
| layer_variance() | Variance of the loss to the layer limit xs attachment. |
| lev() |
Limited expected value E[min(X, limit)].
|
| local_alpha() |
The local Pareto alpha -x S'(x) / S(x) at x.
|
| mean() |
Mean of the distribution (inf if it does not exist).
|
| quantile() |
Quantile: the smallest x with P(X <= x) >= p.
|
| sample() |
n draws from stream stream of the generator keyed by
|
| std() | Standard deviation of the distribution. |
| stop_loss() |
Expected excess over a retention, E[max(X - retention, 0)].
|
| survival() |
Survival function P(X > x), accurate far into the tail.
|
| variance() |
Variance of the distribution (inf if it does not exist).
|
cdf()
Distribution function P(X <= x).
Usage
cdf(x)Parameters
x: float
Returns
float
from_delta()
The distribution from delta = alpha0 * gamma * ln 2, the rise
Usage
from_delta(t, alpha0, delta)in the local alpha each time the amount doubles.
Parameters
t: floatalpha0: floatdelta: float
Returns
LogAffinePareto
layer()
Expected loss to the layer limit xs attachment.
Usage
layer(limit, attachment)Parameters
limit: float-
inffor an unlimited layer. attachment: float
Returns
float
layer_second_moment()
Second moment of the loss to the layer limit xs
Usage
layer_second_moment(limit, attachment)Parameters
limit: floatattachment: float
Returns
float
layer_variance()
Variance of the loss to the layer limit xs attachment.
Usage
layer_variance(limit, attachment)Parameters
limit: floatattachment: float
Returns
float
lev()
Limited expected value E[min(X, limit)].
Usage
lev(limit)Parameters
limit: float
Returns
float
local_alpha()
The local Pareto alpha -x S'(x) / S(x) at x.
Usage
local_alpha(x)Parameters
x: float
Returns
float
mean()
Mean of the distribution (inf if it does not exist).
Usage
mean()Returns
float
quantile()
Quantile: the smallest x with P(X <= x) >= p.
Usage
quantile(p)Parameters
p: float-
Probability in
[0, 1].
Returns
float
Raises
ValueError-
If p is outside
[0, 1].
sample()
n draws from stream stream of the generator keyed by
Usage
sample(n, seed, stream=0)seed.
Parameters
n: intseed: intstream: int = 0
Returns
list of float
std()
Standard deviation of the distribution.
Usage
std()Returns
float
stop_loss()
Expected excess over a retention, E[max(X - retention, 0)].
Usage
stop_loss(retention)Parameters
retention: float
Returns
float
survival()
Survival function P(X > x), accurate far into the tail.
Usage
survival(x)Parameters
x: float
Returns
float
variance()
Variance of the distribution (inf if it does not exist).
Usage
variance()Returns
float