Fit a Mack (1993) chain ladder projection from an object of class
"Triangle". The function works on long-form cumulative data and does
not require a complete triangle. Age-to-age factors are estimated
through as_link() and fit_ata(), then applied recursively. The
point forecast follows the standard recursion, and prediction
uncertainty is decomposed into process variance and parameter variance.
When weight is supplied (e.g. "premium"), age-to-age factors and
their variance are estimated using the supplied WLS weights.
Arguments
- x
An object of class
"Triangle".- method
One of
"mack". Default is"mack". The argument is retained for future extensibility.- loss
A single cumulative loss variable (column to project). Typical choices are
"loss","premium", or"ratio".- weight
An optional column name passed to
as_link()as the WLS weight variable. Typically"premium"whenloss = "ratio". Default isNULL.- alpha
Numeric scalar controlling the variance structure in
fit_ata(). Default is1.- sigma_method
Method used to extrapolate
sigmafor 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;sigmastaysNAand downstream variance terms drop those links via finite-value guards. Passed to.extrapolate_sigma_ata().- recent
Optional positive integer. When supplied, only the most recent
recentperiods are used for factor estimation. Default isNULL(use all periods).- regime
Optional regime specification for cohort cutoff. Accepts:
NULL(default – no filter), aRegimeobject (fromdetect_regime()orregime_at()), the string"auto"(internaldetect_regime(tri, loss = "ratio")call), or a functionfunction(tri) -> Regimefor deferred custom-config detection. When supplied, cohorts strictly before the resolved change date are excluded from factor estimation.- maturity
Maturity input forwarded to
fit_ata(). Accepts four forms:NULL(default)No maturity filtering.
MaturityobjectPre-built (e.g. from
detect_maturity()ormaturity_at()) – used as-is."auto"Internal
detect_maturity()call with defaults (loss inferred fromloss).- function
function(tri) -> Maturity Lazy spec, typically built with
maturity_spec(), invoked on the triangle at fit time (leakage-safe forbacktest()).
- tail
Logical or numeric. If
FALSE, no tail factor is applied. IfTRUE, a log-linear tail factor is estimated from selected factors. If numeric, the supplied value is used as the tail factor.- bootstrap
Optional bootstrap specification. Accepts
NULL(default, analytical Mack SE only), aBootstrapTriangleobject produced bybootstrap()(replayed for SE / CI), or the string"auto"to run an internal nonparametric bootstrap at fit time.- B
Integer number of bootstrap replicates when
bootstrap = "auto". Default999L.- seed
Optional integer seed for reproducible bootstrap draws. Default
NULL.- conf_level
Numeric in
(0, 1). Confidence level used for bootstrap-derived CI columns. Default0.95.
Value
An object of class "CLFit" containing:
callThe matched call.
dataThe input
"Triangle"object.methodThe method used (
"mack").groupsCharacter vector of grouping variable names.
cohortCharacter scalar of period variable name.
devCharacter scalar of development variable name.
lossCharacter scalar of loss column name.
fulldata.tablewith observed and projected values, including process/parameter SE and CV columns.projdata.tableidentical tofullwith observed cells set toNA.linkThe
"Link"object produced byas_link().summaryCohort-level summary with latest, ultimate, reserve, and Mack standard errors.
selecteddata.tableof selected factors used for projection.factordata.tableof fitted factors fromfit_ata().maturityMaturity diagnostics from
detect_maturity(), orNULLwhen maturity filtering was not applied.alphaValue of
alphaused.sigma_methodSigma extrapolation method.
weightWeight variable name used, or
NULL.recentNumber of recent periods used, or
NULL.regimeResolved
Regimeobject, orNULL.use_maturityLogical; whether maturity filtering was applied.
tailTail factor argument supplied by the user.
tail_factorNumeric tail factor applied.
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"
)
# Mack chain ladder with process / parameter standard errors
cl_mack <- fit_cl(tri, loss = "loss", method = "mack")
summary(cl_mack)
plot(cl_mack)
# WLS factors for ratio (loss ratio) using premium as the weight
cl_ratio <- fit_cl(tri, loss = "ratio", weight = "premium")
} # }
