create_triangle_bundle: Create Triangle Bundle

View source: R/fct_create_triangle_bundle.R

create_triangle_bundleR Documentation

Create Triangle Bundle

Description

Create a "bundle" of triangle related items from an input loss dataset. The function returns a list of class "triangle_bundle" and an attribute describing which metric the bundle describes (i.e. paid, reported, counts, etc.).

The resulting list contains:

- aggregated data filtered for ages of maturity from the 'age_increment' argument

- triangle data derived off the aggregated data

- the actual spread out triangle

- age_to_age data

- the age_to_age spread out triangle

- averages (currently only straight and weighted)

- initial selections for the LDF's and derived CDF's.

Usage

create_triangle_bundle(
  loss_data,
  age_increment = 12,
  origin_col = "accident_year",
  age_col = "devt",
  value_col = "paid"
)

Arguments

loss_data

initial aggregated loss data as a 'data.frame'

age_increment

increment in months between subsequent maturity periods

origin_col, age_col, value_col

column names as strings

Value

list of class "triangle_bundle" with an added attribute describing which metric the bundle describes (i.e. paid, reported, counts, etc.)

Examples

# create default paid triangle bundle
tri_paid_bundle <- create_triangle_bundle(loss_data_all)

# check out the structure
str(tri_paid_bundle)

# derive a similar bundle for reported dollars and counts
tri_rept_bundle <- create_triangle_bundle(loss_data_all, value_col = "reported")
tri_cnts_bundle <- create_triangle_bundle(loss_data_all, value_col = "n_claims")

jimbrig/lossdevtapp documentation built on Aug. 31, 2024, 8:38 a.m.