Validate raw experience data, aggregate it to a single scalar row
per group (collapsing both the cohort and development axes), and
assign the Total S3 class so the associated plot.Total() bar
chart and other Total methods dispatch on the result.
Compared with as_triangle() (two-dimensional cohort x dev) and
as_calendar() (one-dimensional time series), as_total() is
zero-dimensional per group – one row of portfolio aggregates. The
typical use is high-level portfolio comparison across products,
coverages, or channels.
Total summarises:
the number of observed cohorts (
n_cohorts)the first and last observed cohort periods (
sales_start,sales_end)total
lossand totalpremium(sum over all cells)total loss ratio (
ratio = loss / premium)each group's share of total loss and total premium
Pre-filter the Triangle (e.g. by cohort range or coverage) before
calling as_total() if a subset summary is needed.
Arguments
- x
A
Triangleobject (typically fromas_triangle()).
Value
A data.frame with class "Total" containing:
- n_cohorts
Number of observed development periods
- sales_start
First observed period
- sales_end
Last observed period
- loss
Total loss
- premium
Total premium
- ratio
Total loss ratio (
loss / premium)- loss_share
Share of total loss
- premium_share
Share of total premium
Examples
if (FALSE) { # \dontrun{
tri <- as_triangle(
experience,
groups = "coverage",
cohort = "uy_m",
calendar = "cy_m",
loss = "incr_loss",
premium = "incr_premium"
)
as_total(tri)
} # }
