distributions.Pareto

Single-parameter Pareto: P(X > x) = (t / x) ** alpha for x >= t,

Usage

distributions.Pareto()

optionally truncated (conditioned on X < truncation).

Parameters

t: float

Threshold; finite and positive.

alpha: float

Pareto alpha; finite and positive.

truncation: float
Truncation point above t.

Raises

ValueError
If a parameter is out of range.

Examples

>>> from prospicio.distributions import Pareto
>>> p = Pareto(500.0, 2.0)
>>> round(p.layer(4000.0, 1000.0), 9)

200.0

Attributes

Name Description
alpha Pareto alpha.
t Threshold t.
truncation Truncation point, or None.

alpha

Pareto alpha.

alpha: float


t

Threshold t.

t: float


truncation

Truncation point, or None.

truncation: float | None

Methods

Name Description
cdf() Distribution function P(X <= x).
fit() Maximum likelihood fit of the alpha to large losses at or above
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)].
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

fit()

Maximum likelihood fit of the alpha to large losses at or above

Usage

fit(
    losses,
    t,
    reporting_thresholds=None,
    censored=None,
    weights=None,
    truncation=None
)

t.

Parameters
losses: list of float
t: float

Threshold of the fitted Pareto.

reporting_thresholds: list of float = None

Per-loss thresholds below which a loss would not have been reported; raised to t.

censored: list of bool = None

True where a loss was capped by a policy limit.

weights: list of float = None
truncation: float = None
Returns
Pareto
Examples
>>> from prospicio.distributions import Pareto
>>> round(Pareto.fit([1500.0, 2500.0, 4000.0], 1000.0).alpha, 6)

1.10524


layer()

Expected loss to the layer limit xs attachment.

Usage

layer(limit, attachment)
Parameters
limit: float

inf for 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: float
attachment: float
Returns
float

layer_variance()

Variance of the loss to the layer limit xs attachment.

Usage

layer_variance(limit, attachment)
Parameters
limit: float
attachment: float
Returns
float

lev()

Limited expected value E[min(X, limit)].

Usage

lev(limit)
Parameters
limit: 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: int
seed: int
stream: 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