Skip to contents

Reads a file of the CAS loss reserve database (NAIC Schedule P, one file per line such as comauto_pos.csv, downloaded from the CAS web site) as a triangle with one segment per company. Python's prospicio.reserving.schedule_p() reads the same data from the cas-schedule-p package instead; R has no such package, so the file is the user's (nothing is downloaded).

Usage

schedule_p_triangle(
  path,
  company = NULL,
  columns = NULL,
  accident_years = c(1988, 1997),
  lower = FALSE
)

Arguments

path

Path to a CAS loss reserve database CSV file.

company

Group codes (GRCODE) to keep, or NULL for every company in the file.

columns

Measures among "paid", "incurred", "case_incurred", "premium" and "premium_direct"; all five by default.

accident_years

The first and last accident year.

lower

Whether to keep the cells valued after the last accident year's first year-end: the lower triangle, which a study holds out as the outcome. With it, each complete company is a 10 x 10 square.

Value

A triangle keyed by company.

Details

The measures, as the calibration study reads them (validation/scripts/calibration_panel.py): paid is CumPaidLoss, incurred is IncurLoss (bulk and IBNR included), case_incurred is IncurLoss - BulkLoss (Meyers' incurred), premium is EarnedPremNet and premium_direct is EarnedPremDIR, in USD thousands; each file's columns carry a suffix per line (_C, _B, ...), found by its prefix. Ages are DevelopmentLag * 12 months. The key is company, the GRCODE as text.

Examples

if (FALSE) { # \dontrun{
tri <- schedule_p_triangle("comauto_pos.csv", company = 353)
} # }