Expand description
Triangle helpers: cumulative ↔ incremental conversion, latest-diagonal extraction, individual age-to-age ratios.
All functions treat NaN as the unobserved sentinel and assume the input
has been validated (see crate::validate).
Functions§
- age_
to_ age - Individual age-to-age ratio
C_{i, j+1} / C_{i, j}. ReturnsNaNwhere the ratio is undefined (pair unobserved or denominator ≤ 0). - cumulative_
to_ incremental - Convert cumulative to incremental in-place semantics: returns a new
triangle-shaped
Vec<f64>whose observed cells are period deltas. Cell(i, 0)is copied as-is; cell(i, j)withj > 0isC_{i,j} − C_{i,j−1}. Unobserved cells becomeNaN. - incremental_
to_ cumulative - Convert incremental to cumulative. Mirror of
cumulative_to_incremental. - latest_
diagonal - Extract the latest-observed cumulative value for each origin.
- link_
count - Number of origins with both
(i, j)and(i, j+1)observed (i.e. the count that feeds a development-j → j+1LDF).