Fit a chain ladder projection from an object of class "Triangle".
The function works on long-form cumulative data and does not require
a complete triangle.
Two methods are supported via the method argument:
"basic"(default)Classical chain ladder point projection. Age-to-age factors are estimated through
build_ata()andfit_ata(), then applied recursively."mack"Mack (1993) chain ladder. Point forecast follows the standard recursion, and prediction uncertainty is decomposed into process variance and parameter variance.
When weight_var is supplied (e.g. "crp"), age-to-age factors and
their variance are estimated using the supplied WLS weights.
Arguments
- x
An object of class
"Triangle".- method
One of
"basic"or"mack". Default is"basic".- value_var
A single cumulative variable to project. Typical choices are
"closs","crp", or"clr".- weight_var
An optional column name passed to
build_ata()as the WLS weight variable. Typically"crp"whenvalue_var = "clr". Default isNULL.- alpha
Numeric scalar controlling the variance structure in
fit_ata(). Default is1.- sigma_method
Sigma extrapolation method passed to
fit_ata(). One of"min_last2"(default),"locf", or"loglinear". Only relevant whenmethod = "mack".- recent
Optional positive integer. When supplied, only the most recent
recentperiods are used for factor estimation. Default isNULL(use all periods).- maturity_args
A named list of arguments forwarded to
find_ata_maturity()viafit_ata(), orNULL(default) to skip maturity filtering. Passlist()to use all defaults with maturity filtering enabled.- 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.
Value
An object of class "CLFit" containing:
callThe matched call.
dataThe input
"Triangle"object.methodThe method used (
"basic"or"mack").group_varCharacter vector of grouping variable names.
cohort_varCharacter scalar of period variable name.
dev_varCharacter scalar of development variable name.
value_varCharacter scalar of value variable name.
fulldata.tablewith observed and projected values. For"mack", also includes process/parameter SE and CV columns.preddata.tableidentical tofullwith observed cells set toNA.ataThe
"ATA"object produced bybuild_ata().summaryFor
"basic":data.tableof fitted factors fromfit_ata(). For"mack": cohort-level summary with latest, ultimate, reserve, and Mack standard errors.selecteddata.tableof selected factors used for projection.factorFor
"mack"only:data.tableof fitted factors fromfit_ata().maturityMaturity diagnostics from
find_ata_maturity(), orNULLwhen maturity filtering was not applied.alphaValue of
alphaused.sigma_methodFor
"mack"only: sigma extrapolation method.weight_varWeight variable name used, or
NULL.recentNumber of recent periods used, or
NULL.use_maturityLogical; whether maturity filtering was applied.
maturity_argsResolved maturity arguments, or
NULL.tailTail factor argument supplied by the user.
tail_factorNumeric tail factor applied.
Examples
if (FALSE) { # \dontrun{
data(experience)
exp <- as_experience(experience)
tri <- build_triangle(exp[cv_nm == "SUR"], group_var = cv_nm)
# Basic chain ladder (point projection only)
cl <- fit_cl(tri, value_var = "closs", method = "basic")
print(cl)
# Mack chain ladder with process / parameter standard errors
cl_mack <- fit_cl(tri, value_var = "closs", method = "mack")
summary(cl_mack)
plot(cl_mack)
# WLS factors for clr (loss ratio) using crp as the weight
cl_clr <- fit_cl(tri, value_var = "clr", weight_var = "crp")
} # }
