Derive the development-link table from a Triangle and assign the
Link S3 class so the associated summary.Link(), plot.Link(),
fit_ata(), fit_intensity(), etc. methods dispatch on the result.
Unlike as_triangle() / as_calendar() / as_total() (which take
raw experience data and validate/aggregate it), as_link() operates
on a Triangle (already validated upstream) and reshapes it into
link-pair rows. Each row corresponds to one development link
(cohort, ata_from -> ata_to), the long-format intermediate
underlying both the chain ladder (CL) and exposure-driven (ED)
workflows.
Two modes are produced depending on exposure:
- Single-variable mode (
exposure = NULL) The age-to-age factor is \(ata = value_{to} / value_{from}\), where \(value\) is the column named by
loss.- Dual-variable mode (
exposuresupplied) In addition to the loss-side ATA, the exposure-driven intensity \(g = \Delta loss / premium_{from}\) is computed and stored in the
intensitycolumn. The exposure measure is the denominator for loss ratio calculations; for long-term health insurance applications, risk premium is commonly used.
Usage
as_link(
x,
loss = "loss",
exposure = NULL,
weight = NULL,
min_denom = 0,
drop_invalid = FALSE
)Arguments
- x
A
Triangleobject.- loss
A single cumulative metric used as the link numerator. Must be one of
"loss","premium", or"ratio". Default"loss". For loss-side ATA this is the cumulative loss column, but any cumulative metric on the Triangle may be supplied.- exposure
Optional second cumulative metric, treated as the exposure base (denominator anchor) for the ED workflow. Must be one of
"loss","premium","ratio", and must differ fromloss. WhenNULL(default), only the single-variable columns are produced.- weight
Optional cumulative metric used as WLS weight in downstream
summary/fit_atacalls. Must differ fromloss. Cannot be combined withexposure(the dual workflow has its own anchor).- min_denom
Minimum denominator required to compute
ataandintensity. Ifloss_from <= min_denom,atabecomesNA; ifpremium_from <= min_denom,intensitybecomesNA. Default0.- drop_invalid
Logical; if
TRUE, rows with non-finiteata(single-var) or non-finiteintensity(dual-var) are dropped. DefaultFALSEso the full link grid is preserved for diagnostics.
Value
A data.table of class "Link" with columns:
Always:
[group],cohort,ata_from,ata_to,ata_link,loss_from,loss_to,loss_delta,ata.If
exposureis set: alsopremium_from,premium_to,premium_delta,intensity.If
weightis set: alsoweight.
The returned object carries attributes groups, cohort,
dev, loss, premium (or NULL), weight
(or NULL).
Examples
if (FALSE) { # \dontrun{
tri <- as_triangle(
df,
groups = "coverage",
cohort = "uy_m",
calendar = "cy_m",
loss = "incr_loss",
premium = "incr_premium"
)
# Single-variable: cumulative-loss link factors (ATA workflow)
link_loss <- as_link(tri, loss = "loss")
# Dual-variable: ED-ready link table (loss + premium)
link_ed <- as_link(tri, loss = "loss", exposure = "premium")
head(link_ed)
} # }
