Skip to main content

TriangleView

Struct TriangleView 

Source
pub struct TriangleView<'a> {
    pub n_origins: usize,
    pub n_devs: usize,
    pub data: &'a [f64],
}
Expand description

A non-owning view over a triangle’s row-major buffer.

Fields§

§n_origins: usize

Number of origin periods.

§n_devs: usize

Number of development periods.

§data: &'a [f64]

Row-major buffer.

Implementations§

Source§

impl TriangleView<'_>

Source

pub fn get(&self, i: usize, j: usize) -> f64

Cumulative value at origin i, development j. NaN if unobserved.

Source

pub fn is_scheduled_observed(&self, i: usize, j: usize) -> bool

true iff cell (i, j) is scheduled to be observed under the upper-triangular square-triangle convention (i + j < n).

Source

pub fn is_valid_observed(&self, i: usize, j: usize) -> bool

true iff cell (i, j) is scheduled observed and holds a finite value.

Source

pub fn is_observed(&self, i: usize, j: usize) -> bool

true iff cell (i, j) is scheduled observed and holds a finite value.

This preserves the original hot-path predicate. Use Self::is_scheduled_observed when validation needs to distinguish triangle geometry from numeric validity.

Source

pub fn ldfs(&self, tail: f64) -> Result<DevelopmentFactors, ValidationError>

Volume-weighted development factors and CDFs (tail = 1.0 for fully developed).

Source

pub fn chain_ladder( &self, tail: f64, ) -> Result<ChainLadderProjection, ValidationError>

Volume-weighted Chain-Ladder projection (tail = 1.0 for fully developed).

Source

pub fn mack(&self, tail: f64) -> Result<Mack, ValidationError>

Mack (1993) distribution-free chain-ladder reserve & standard error analysis.

Source

pub fn mack_with_policy( &self, tail: f64, policy: MonotonicityPolicy, ) -> Result<Mack, ValidationError>

Mack (1993) analysis under an explicit MonotonicityPolicy.

Source

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

Merz & Wüthrich (2008) 1-year Solvency II Claims Development Result (CDR) MSEP.

Source

pub fn bf( &self, expected_ultimate: &[f64], tail: f64, ) -> Result<BornhuetterFergusonProjection, ValidationError>

Bornhuetter–Ferguson projection using volume-weighted LDFs.

Source

pub fn cape_cod( &self, premium: &[f64], tail: f64, ) -> Result<CapeCodProjection, ValidationError>

Cape Cod projection using volume-weighted LDFs.

Source

pub fn bootstrap_odp( &self, tail: f64, options: OdpBootstrapOptions, ) -> Result<OdpBootstrapResult, ValidationError>

Run England & Verrall / Shapland ODP bootstrap reserve simulation.

Source

pub fn exhibit( &self, premium: Option<&[f64]>, expected_ultimate: Option<&[f64]>, tail: f64, ) -> Result<ExhibitBundle, ValidationError>

Build a complete JSON-serializable reserving exhibit bundle.

Source

pub fn benktander( &self, expected_ultimate: &[f64], iterations: usize, tail: f64, ) -> Result<BenktanderProjection, ValidationError>

Benktander (1976) / Hovinen credibility projection using volume-weighted LDFs.

Source

pub fn generalized_cape_cod( &self, premium: &[f64], decay: f64, tail: f64, ) -> Result<GeneralizedCapeCodProjection, ValidationError>

Generalized Cape Cod (Gluck 1997) decay-weighted projection.

Source

pub fn brosius(&self, tail: f64) -> Result<Brosius, ValidationError>

Brosius (1993) OLS credibility development projection.

Source

pub fn fit_odp(&self, tail: f64) -> Result<OdpFit, ValidationError>

Fit the Over-Dispersed Poisson GLM (fit_odp) with strict monotonicity.

Source

pub fn glm( &self, options: &GlmOptions, ) -> Result<GlmReservingResult, ValidationError>

Fit a reserving GLM (Odp, Gamma, Tweedie, or LogNormal) via Householder QR IRLS.

Source

pub fn clark_ldf( &self, options: &ClarkOptions, ) -> Result<ClarkMleResult, ValidationError>

Fit Clark (2003) LDF parametric growth-curve MLE.

Source

pub fn clark_cape_cod( &self, premium: &[f64], options: &ClarkOptions, ) -> Result<ClarkMleResult, ValidationError>

Fit Clark (2003) Cape Cod parametric growth-curve MLE.

Source

pub fn ptf(&self, options: &PtfOptions) -> Result<PtfResult, ValidationError>

Fit Barnett & Zehnwirth (2000) Probabilistic Trend Family log-linear regression.

Source

pub fn diagnostics(&self) -> TriangleDiagnostics

Structural triangle diagnostics (observed/missing counts, monotonicity, zero latest).

Trait Implementations§

Source§

impl<'a> Clone for TriangleView<'a>

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<'a> Copy for TriangleView<'a>

Source§

impl<'a> Debug for TriangleView<'a>

Source§

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

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

impl Display for TriangleView<'_>

Source§

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

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

impl<'a> PartialEq for TriangleView<'a>

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<'a> StructuralPartialEq for TriangleView<'a>

Auto Trait Implementations§

§

impl<'a> Forget for TriangleView<'a>

§

impl<'a> Freeze for TriangleView<'a>

§

impl<'a> Move for TriangleView<'a>

§

impl<'a> RefUnwindSafe for TriangleView<'a>

§

impl<'a> Send for TriangleView<'a>

§

impl<'a> Sync for TriangleView<'a>

§

impl<'a> Unpin for TriangleView<'a>

§

impl<'a> UnsafeUnpin for TriangleView<'a>

§

impl<'a> UnwindSafe for TriangleView<'a>

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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.