View source: R/fct_create_triangle_bundle.R
create_triangle_bundle | R Documentation |
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.
create_triangle_bundle(
loss_data,
age_increment = 12,
origin_col = "accident_year",
age_col = "devt",
value_col = "paid"
)
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 |
list of class "triangle_bundle" with an added attribute describing which metric the bundle describes (i.e. paid, reported, counts, etc.)
# 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.