Skip to contents

Project cumulative premium across the cohort x development grid with a chain ladder estimator. Two variance recursions are supported:

"ed" (default)

Additive recursion. Empirically more robust on long-projection premium triangles – the multiplicative scaling of the classical CL recursion can blow up under cohort-wise heterogeneity (regime changes in premium, channel changes, amendments). See dev/premium_projection.qmd.

"cl"

Mack (1993) multiplicative recursion. Point projection identical to ED; only the SE accumulation differs.

Both methods share the same point estimate – self-weighted ED on premium is mathematically equivalent to chain ladder on the same column (f_k = 1 + g_k). The only operational difference is how cumulative variance is propagated forward.

Usage

fit_premium(
  x,
  method = c("ed", "cl"),
  alpha = 1,
  regime = NULL,
  sigma_method = c("locf", "min_last2", "loglinear", "mack", "none"),
  recent = NULL,
  tail = FALSE,
  conf_level = 0.95,
  bootstrap = NULL,
  B = 999L,
  seed = NULL
)

Arguments

x

A "Triangle" object. The standardized "premium" column is used as the projection metric.

method

One of "ed" (default) or "cl".

alpha

Numeric scalar controlling the variance structure passed through to fit_ata(). Default 1.

regime

Optional regime specification (premium side). Accepts four input types:

NULL (default)

No regime filter.

Regime object

Use as-is. Typically built via detect_regime() or regime_at().

"auto"

Detect regime internally via detect_regime(x, loss = "ratio") on the input triangle.

Function / closure

A user-supplied function(tri) -> Regime for deferred custom-config detection.

Pre-change cohorts (cohorts before the resolved Regime's change date) are excluded from premium factor estimation.

sigma_method

Method used to extrapolate sigma for links where it cannot be estimated. One of "locf" (default), "min_last2", "loglinear", "mack", or "none". "mack" applies the Mack (1993, Appendix B) tail estimator to the last unestimated link only, falling back to LOCF for any earlier ones with a warning. "none" performs no extrapolation; sigma stays NA and downstream variance terms drop those links via finite-value guards. Passed to .extrapolate_sigma_ata().

recent

Optional positive integer; recent calendar-diagonal filter for the underlying ATA fit. Default NULL.

tail

Logical; whether to apply a tail factor. Default FALSE.

conf_level

Confidence level for analytical CI on the premium projection (premium_ci_lo, premium_ci_hi). Default 0.95.

bootstrap

Bootstrap configuration. Five forms accepted:

NULL (default)

Auto-resolved by method: bootstrap for "ed", analytical for "cl". Same behavior as the legacy bootstrap = NULL shape.

TRUE / FALSE

Back-compat with the legacy logical arg. TRUE triggers bootstrap = "auto"; FALSE disables.

"auto"

Internal bootstrap() call on the premium triangle with defaults (type = "analytical", process = "normal", target = "premium").

BootstrapTriangle

Pre-built object from bootstrap(). Must have meta$target == "premium".

Function function(tri) -> BootstrapTriangle

Lazy spec invoked on the input Triangle (leakage-safe for backtest()).

Regardless of method, the bootstrap path uses CL recursion – premium's self-anchor makes ED and CL algebraically equivalent (g_k = f_k - 1, sigma^2_g = sigma^2_f).

B

Integer number of bootstrap replicates. Used only when bootstrap resolves to "auto". Default 999L.

seed

Optional integer seed for reproducible bootstrap. Default NULL.

Value

An object of class "PremiumFit" (a list with the same structure as CLFit). Components: selected, full, data, plus attribute premium_method. The $full data.table uses role-specific column names (premium_obs, premium_proj, incr_premium_proj, premium_proc_se, premium_param_se, premium_total_se, premium_proc_cv, premium_param_cv, premium_total_cv, premium_ci_lo, premium_ci_hi). Under bootstrap = TRUE, premium_ci_lo / premium_ci_hi are bootstrap quantiles and premium_total_se / premium_total_cv are derived from the simulation SD; the analytical proc/param decomposition is retained as diagnostic.

Examples

if (FALSE) { # \dontrun{
data(experience)
tri <- as_triangle(
  experience[coverage == "surgery"],
  groups   = "coverage",
  cohort   = "uy_m",
  calendar = "cy_m",
  loss     = "incr_loss",
  premium  = "incr_premium"
)

# ED-additive recursion (default; robust on long projections)
pf <- fit_premium(tri)
summary(pf)

# CL-multiplicative recursion (Mack)
pf_cl <- fit_premium(tri, method = "cl")
} # }