mack_diagnostics
Run three statistical tests and standardised-residual outlier detection to validate chain ladder model assumptions, including calendar-year, independence, and inflation effects.
Instructions
Mack (1994) assumption diagnostics — three statistical tests plus standardised-residual outlier detection. Use when the user asks "does the chain ladder look OK?", "are there any outliers?", or "should I be worried about [calendar-year / inflation / dependence] effects?".
Args:
triangle: As in compute_chain_ladder.
selected_factors: Length-(n_dev - 1) factor set.
excluded: Outlier exclusions to honour.
outlier_threshold: Absolute standardised-residual threshold for
flagging an outlier. Default 2.0 (the Tk app's default).
Returns:
- standardised_residuals: list[list[float | null]] — per-cell
residual r[i,j] = (C[i,j+1] − f_j·C[i,j]) / (σ_j·√C[i,j]);
null where the cell is excluded or the pair is unobserved
- outliers: list of {row: int, dev: int, residual: float} —
cells with |residual| > outlier_threshold
- calendar_year: {z: float, p_two_sided: float} — Tarbell
sign test for calendar-year effects (large |z| ⇒ suspect)
- independence: {z: float, p_two_sided: float} — Spearman
rank-correlation between adjacent development columns (large
|z| ⇒ link ratios are not independent)
- inflation: {slope: float, p_value: float} — OLS slope of
mean(ln link-ratio) on accident-year index (non-zero ⇒
accident-year trend in link ratios)
Verdict guidance for translating p-values to plain English: p < 0.005 → "strong evidence"; p < 0.05 → "significant"; p < 0.10 → "borderline"; p ≥ 0.10 → "no evidence".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| triangle | Yes | ||
| selected_factors | Yes | ||
| excluded | No | ||
| outlier_threshold | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||