distributions.Burr
Usage
distributions.Burr()and scale theta: P(X > x) = (1 + (x / theta)**gamma)**(-alpha), as SciPy’s burr12(c=gamma, d=alpha, scale=theta). With alpha = 1 it is the Loglogistic; with gamma = 1, the Lomax. Moments exist below alpha * gamma; limited and layer moments always do.
Parameters
alpha: floatgamma: floatscale: float
Raises
ValueError- If a parameter is not finite and positive.
Examples
>>> from prospicio.distributions import Burr
>>> round(Burr(3.0, 1.0, 2000.0).survival(2000.0), 12)0.125
Attributes
| Name | Description |
|---|---|
| alpha | Tail shape alpha. |
| gamma | Power gamma. |
| scale | Scale theta. |
alpha
Tail shape alpha.
alpha: float
gamma
Power gamma.
gamma: float
scale
Scale theta.
scale: float
Methods
| Name | Description |
|---|---|
| cdf() |
Distribution function P(X <= x).
|
| layer() | Expected loss to the layer limit xs attachment. |
| layer_second_moment() | Second moment of the loss to the layer limit xs |
| layer_third_moment() | Third moment of the loss to the layer limit xs attachment, |
| 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.
|
| tvar() |
Tail value at risk at p in [0, 1), the mean of the worst
|
| var() | Value at risk, the lower quantile at p: the same as quantile. |
| 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
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_third_moment()
Third moment of the loss to the layer limit xs attachment,
Usage
layer_third_moment(limit, attachment)E[min(max(X - a, 0), l)^3], by quadrature of the survival function (relative accuracy about 1e-10); limit = inf for the unlimited layer, attachment = 0 for the limited third moment.
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
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
tvar()
Tail value at risk at p in [0, 1), the mean of the worst
Usage
tvar(p)1 - p: VaR(p) + E[(X - VaR(p))+] / (1 - p); inf where the mean is.
Parameters
p: float
Returns
float
var()
Usage
var(p)Parameters
p: float
Returns
float
variance()
Variance of the distribution (inf if it does not exist).
Usage
variance()Returns
float