pub enum PanjerClass {
Binomial(Binomial),
Poisson(Poisson),
NegativeBinomial(NegativeBinomial),
}Expand description
A claim count in the Panjer class chosen by its dispersion
Var[N] / E[N]: binomial below 1, Poisson at 1, negative binomial
above 1. The usual way to state frequency uncertainty in treaty
pricing (see docs/design/pareto.md).
use prospicio_prob::{Counting, PanjerClass};
let n = PanjerClass::from_mean_dispersion(4.0, 2.5).unwrap();
assert!(matches!(n, PanjerClass::NegativeBinomial(_)));
assert!((n.variance() - 10.0).abs() < 1e-12);Variants§
Implementations§
Source§impl PanjerClass
impl PanjerClass
Sourcepub fn from_mean_dispersion(mean: f64, dispersion: f64) -> Result<Self>
pub fn from_mean_dispersion(mean: f64, dispersion: f64) -> Result<Self>
The claim count with this mean (finite, non-negative) and
dispersion (finite, positive).
A binomial must have a whole number of trials, so for dispersion
below 1 the number of trials is mean / (1 - dispersion) rounded up
and p = mean / n: the mean is kept exactly and the dispersion
becomes 1 - p, the nearest attainable value at or above the one
asked for. PanjerClass::dispersion reports it.
Sourcepub fn dispersion(&self) -> f64
pub fn dispersion(&self) -> f64
Var[N] / E[N] (1 for a zero mean).
Trait Implementations§
Source§impl Clone for PanjerClass
impl Clone for PanjerClass
Source§fn clone(&self) -> PanjerClass
fn clone(&self) -> PanjerClass
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PanjerClass
Source§impl Counting for PanjerClass
impl Counting for PanjerClass
Source§fn pgf(&self, z: f64) -> f64
fn pgf(&self, z: f64) -> f64
Probability generating function
E[z^N] for 0 ≤ z ≤ 1. Panjer’s
recursion starts from P(S = 0) = pgf(f_0).Source§impl Debug for PanjerClass
impl Debug for PanjerClass
Source§impl PartialEq for PanjerClass
impl PartialEq for PanjerClass
impl StructuralPartialEq for PanjerClass
Auto Trait Implementations§
impl Freeze for PanjerClass
impl RefUnwindSafe for PanjerClass
impl Send for PanjerClass
impl Sync for PanjerClass
impl Unpin for PanjerClass
impl UnsafeUnpin for PanjerClass
impl UnwindSafe for PanjerClass
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more