run_single_backtest: Run reserve backtest for a single reserving method

Description Usage Arguments Value Examples

View source: R/backtestr.R

Description

Run reserve backtest for a single reserving method

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
run_single_backtest(
  loss_data,
  reserving_function,
  lines_to_include = c("comauto", "othliab", "ppauto", "wkcomp"),
  loss_type_to_backtest = c("paid", "case", "ultimate"),
  by_year = FALSE,
  to_ultimate = TRUE,
  method_label = NULL,
  ...
)

Arguments

loss_data

a nested tibble containing loss triangle data. See cas_loss_reserve_db.

reserving_function

a function that takes as input a loss triangle and outputs estimated reserve

lines_to_include

a character vector with the lines of business to include

loss_type_to_backtest

a character indicating whether to use paid, case-incurred, or ultimate losses

by_year

logical, whether to estimate results by year (TRUE) or in total across all years (FALSE). Default is FALSE.

to_ultimate

logical, whether to estimate results to ultimate (TRUE) or for the next calendar year (FALSE). Default is TRUE.

method_label

a character giving the name given to method. Default is "results"

...

arguments passed on to the reserving_function

Value

a tibble with the results of the method and back-testing results as columns

Examples

1
2
3
4
5
6
data <- cas_loss_reserve_db %>%
 get_meyers_subset()
data <- data[1:3,]

backtest_mack_paid <- run_single_backtest(data, testr_MackChainLadder, lines_to_include = "comauto",
method_label = "mack_paid")

problemofpoints/reservetestr documentation built on Jan. 3, 2020, 9:12 a.m.