Skip to contents

Tables of a chain_ladder_fit, mack_fit, expected_loss_fit, cape_cod_fit, odp_bootstrap_fit, mack_bootstrap_fit, one_year_fit or clark_fit with the triangle's key columns by name. as.data.frame(fit) has one row per segment and origin: origin, latest, ultimate and reserve (the method's own), plus for Mack process_risk, parameter_risk and standard_error, for the expected-loss methods exposure and apriori (and Cape Cod's trended_apriori), for the bootstraps the mean and std_dev of the bootstrapped reserve, and for Clark (Cape Cod) exposure, expected_ultimate and the three standard errors. The one-year view names them opening_ultimate and opening_reserve and adds the cdr_mean and cdr_std_dev of the claims development result. totals_frame() has one row per segment with the same quantities for the segment's total (for the expected-loss methods the total exposure, for the ODP bootstrap and its one-year view also the bootstrap's scale; for Clark its omega, theta, scale and, for Cape Cod, elr). development_frame() has one row per segment and age: development, ldf (to the next age), cdf (to ultimate, with the tail), sigma and std_err; the oldest age has NA for ldf, sigma and std_err. A clark_fit has no development table of its own: use development_frame(fit@chain_ladder) for the chain ladder's.

Usage

totals_frame(fit)

development_frame(fit)

segment(fit, ...)

Arguments

fit

A chain_ladder_fit, mack_fit, expected_loss_fit, cape_cod_fit, odp_bootstrap_fit, mack_bootstrap_fit, one_year_fit or clark_fit (not for development_frame()).

...

Key conditions as key = value, one value each.

Value

A data.frame, or for segment() a fit of the same class.

Details

segment() returns the fit of one segment, chosen by key values as in segment(fit, lob = "auto") (compared as character). Keys not named may take any value, so a fit with one segment needs none; a choice that matches several segments is an error. For the bootstraps, the segment keeps its part of the joint reserves, and for the one-year view its part of the joint cdr, with the same dimensions.

These are Python's to_frame(), totals_frame(), development_frame() and segment(**keys).

Examples

long <- data.frame(lob = rep(c("auto", "home"), each = 6), year = c(2020, 2020, 2020, 2021, 2021, 2022),
                   age = c(12, 24, 36, 12, 24, 12),
                   paid = c(100, 150, 165, 110, 170, 120, 50, 80, 85, 60, 90, 70))
fits <- chain_ladder(triangle(long, "year", "age", "paid", keys = "lob"))
totals_frame(fits)
#>    lob latest ultimate  reserve tail tail_sigma tail_std_err
#> 1 auto    455 553.1429 98.14286    1          0            0
#> 2 home    245 295.5682 50.56818    1          0            0
development_frame(fits)
#>    lob development      ldf      cdf     sigma    std_err
#> 1 auto          12 1.523810 1.676190 0.3289758 0.02270149
#> 2 auto          24 1.100000 1.100000        NA         NA
#> 3 auto          36       NA 1.000000        NA         NA
#> 4 home          12 1.545455 1.642045 0.5222330 0.04979296
#> 5 home          24 1.062500 1.062500        NA         NA
#> 6 home          36       NA 1.000000        NA         NA
segment(fits, lob = "home")@ldf
#>    12-24    24-36 
#> 1.545455 1.062500