Skip to contents

Construct exposure-driven incremental development data from an object of class "Triangle", typically produced by build_triangle(). This is the foundational data structure for the exposure-driven (ED) model, where incremental loss is modelled as a function of cumulative exposure (risk premium) rather than cumulative loss.

The incremental loss intensity is defined as:

$$g_{i,k} = \frac{\Delta C^L_{i,k+1}}{C^P_{i,k}}$$

where \(\Delta C^L_{i,k+1} = C^L_{i,k+1} - C^L_{i,k}\) is the incremental loss and \(C^P_{i,k}\) is the cumulative exposure (risk premium) at development period \(k\).

Usage

build_ed(
  x,
  loss_var = "closs",
  exposure_var = "crp",
  min_exposure = 0,
  drop_invalid = FALSE
)

Arguments

x

An object of class "Triangle".

loss_var

A single cumulative loss variable. Default is "closs".

exposure_var

A single cumulative exposure variable. Default is "crp".

min_exposure

Minimum exposure required to compute g. If exposure_from <= min_exposure, g is set to NA. Default is 0.

drop_invalid

Logical; if TRUE, rows with invalid (non-finite) g values are dropped. Default is FALSE.

Value

A data.table with class "ED" containing:

ata_from

Current development period.

ata_to

Next development period.

ata_link

Concatenated label "ata_from-ata_to".

loss_from

Cumulative loss \(C^L_{i,k}\).

loss_to

Cumulative loss \(C^L_{i,k+1}\).

delta_loss

Incremental loss \(\Delta C^L_{i,k+1}\).

exposure_from

Cumulative exposure \(C^P_{i,k}\).

exposure_to

Cumulative exposure \(C^P_{i,k+1}\).

g

Incremental loss intensity \(\Delta C^L_{i,k+1} / C^P_{i,k}\), or NA when exposure_from <= min_exposure.

The returned object carries the following attributes: group_var, cohort_var, dev_var, loss_var, and exposure_var.

Examples

if (FALSE) { # \dontrun{
d <- build_triangle(df, group_var = cv_nm)
ed <- build_ed(d)
head(ed)
attr(ed, "loss_var")
attr(ed, "exposure_var")
} # }