pub struct AggregateLossDistribution {
pub step: f64,
pub pmf: Vec<f64>,
pub cdf: Vec<f64>,
pub total_mass: f64,
pub mean: f64,
pub variance: f64,
pub std_dev: f64,
pub exact_theoretical_mean: f64,
pub exact_theoretical_variance: f64,
}Expand description
Discretized aggregate loss distribution on the uniform lattice 0, step, 2*step, ....
Fields§
§step: f64Grid step size h > 0.
pmf: Vec<f64>Discrete aggregate PMF g_k = P(S = k * step) (length n_steps).
cdf: Vec<f64>Cumulative distribution function G_k = P(S <= k * step) (length n_steps).
total_mass: f64Total captured probability mass sum_k g_k (<= 1.0; < 1.0 reflects right truncation).
mean: f64Numerical mean sum_k (k * step) * g_k.
variance: f64Numerical variance sum_k (k * step - mean)^2 * g_k.
std_dev: f64Numerical standard deviation sqrt(variance).
exact_theoretical_mean: f64Exact compound theoretical mean E[N] * E[X] from the input severity PMF.
exact_theoretical_variance: f64Exact compound theoretical variance E[N] * Var(X) + Var(N) * E[X]^2.
Implementations§
Source§impl AggregateLossDistribution
impl AggregateLossDistribution
Sourcepub fn var(&self, alpha: f64) -> Result<f64, ValidationError>
pub fn var(&self, alpha: f64) -> Result<f64, ValidationError>
Discrete Value at Risk VaR_alpha(S) = inf { x : F_S(x) >= alpha }.
Sourcepub fn tvar(&self, alpha: f64) -> Result<f64, ValidationError>
pub fn tvar(&self, alpha: f64) -> Result<f64, ValidationError>
Exact coherent Tail Value at Risk TVaR_alpha(S) on the discrete lattice
((1 / (1 - alpha)) * int_alpha^1 F^-(u) du), normalized by total_mass.
Exact net stop-loss premium E[(S - retention)_+] = sum_k max(0, k*h - retention) * g_k.