Skip to main content

SeverityDistribution

Enum SeverityDistribution 

Source
pub enum SeverityDistribution {
    Lognormal {
        mu: f64,
        sigma: f64,
    },
    Pareto {
        alpha: f64,
        theta: f64,
    },
    SingleParameterPareto {
        alpha: f64,
        theta: f64,
    },
    Exponential {
        mean: f64,
    },
    MixedExponential {
        weights: Vec<f64>,
        means: Vec<f64>,
    },
    GeneralizedPareto {
        xi: f64,
        beta: f64,
    },
}
Expand description

Parametric P&C claim severity distributions with exact closed-form Limited Expected Values E[X ∧ L], survival functions, layer losses, and excess ratios.

Variants§

§

Lognormal

Lognormal ln(X) ~ N(mu, sigma^2) (sigma > 0).

Fields

§mu: f64

Log-scale location parameter μ.

§sigma: f64

Log-scale standard deviation σ > 0.

§

Pareto

Two-parameter Pareto (Type II / Lomax): S(x) = (θ / (x + θ))^α for x >= 0 (α > 0, θ > 0).

Fields

§alpha: f64

Tail shape parameter α > 0.

§theta: f64

Scale parameter θ > 0.

§

SingleParameterPareto

Single-parameter Pareto: S(x) = (θ / x)^α for x >= θ (α > 0, θ > 0).

Fields

§alpha: f64

Tail shape parameter α > 0.

§theta: f64

Threshold scale parameter θ > 0.

§

Exponential

Exponential with mean θ > 0: S(x) = exp(-x / θ).

Fields

§mean: f64

Mean severity θ > 0.

§

MixedExponential

Mixed Exponential (Keatinge 1999; ISO ILF standard): S(x) = Σ_k w_k · exp(-x / θ_k) with w_k > 0, Σ w_k = 1, θ_k > 0.

Fields

§weights: Vec<f64>

Positive mixture weights summing to 1.0.

§means: Vec<f64>

Positive component exponential means θ_k.

§

GeneralizedPareto

Generalized Pareto Distribution (GPD, Peaks-Over-Threshold): S(x) = (1 + ξ · x / β)^{-1/ξ} (β > 0, ξ >= 0 heavy/exponential tail).

Fields

§xi: f64

Shape parameter ξ (ξ = 0 is exponential; ξ > 0 is heavy-tailed).

§beta: f64

Scale parameter β > 0.

Implementations§

Source§

impl SeverityDistribution

Source

pub const fn lognormal(mu: f64, sigma: f64) -> Self

Construct a Lognormal severity ln(X) ~ N(mu, sigma^2).

Source

pub const fn pareto(alpha: f64, theta: f64) -> Self

Construct a two-parameter Pareto Type II (Lomax) severity.

Source

pub const fn single_parameter_pareto(alpha: f64, theta: f64) -> Self

Construct a single-parameter Pareto severity (x >= theta).

Source

pub const fn exponential(mean: f64) -> Self

Construct an Exponential severity with given mean.

Source

pub fn mixed_exponential( weights: impl Into<Vec<f64>>, means: impl Into<Vec<f64>>, ) -> Self

Construct a Mixed Exponential severity from weights and component means.

Source

pub const fn gpd(xi: f64, beta: f64) -> Self

Construct a Generalized Pareto (GPD) severity with shape xi and scale beta.

Source

pub fn discretize_rounding( &self, step: f64, max_index: usize, capture_upper_tail: bool, ) -> Result<Vec<f64>, ValidationError>

Discretize onto 0, step, ..., max_index * step via the Method of Rounding.

Source

pub fn discretize_mean_preserving( &self, step: f64, max_index: usize, ) -> Result<Vec<f64>, ValidationError>

Discretize onto 0, step, ..., max_index * step via mean-preserving LEV local moment matching.

Source

pub fn lognormal_from_mean_cv( mean: f64, cv: f64, ) -> Result<Self, ValidationError>

Construct a Lognormal distribution from ground-up mean and coefficient of variation cv = sd / mean > 0.

Source

pub fn validate(&self) -> Result<(), ValidationError>

Validate distribution parameters.

Source

pub fn survival(&self, x: f64) -> f64

Survival probability S(x) = P(X > x).

Source

pub fn cdf(&self, x: f64) -> f64

Cumulative distribution function F(x) = P(X <= x).

Source

pub fn pdf(&self, x: f64) -> f64

Probability density function f(x).

Source

pub fn unbounded_mean(&self) -> Option<f64>

Ground-up unlimited mean E[X], or None when the first moment diverges (Pareto alpha <= 1 or GPD xi >= 1).

Source

pub fn limited_expected_value(&self, limit: f64) -> Result<f64, ValidationError>

Exact closed-form Limited Expected Value E[X ∧ limit] (Klugman, Panjer & Willmot, Appendix A; Lee 1988).

Source

pub fn layer_expected_loss( &self, attachment: f64, limit: f64, ) -> Result<f64, ValidationError>

Expected loss in layer [attachment, attachment + limit]: E[min(max(X - attachment, 0), limit)] = E[X ∧ (a + w)] - E[X ∧ a].

Source

pub fn excess_ratio(&self, retention: f64) -> Result<f64, ValidationError>

Excess ratio R(retention) = E[(X - retention)_+] / E[X] = 1 - E[X ∧ retention] / E[X].

Trait Implementations§

Source§

impl Clone for SeverityDistribution

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SeverityDistribution

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for SeverityDistribution

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for SeverityDistribution

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for SeverityDistribution

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for SeverityDistribution

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.