Skip to contents

Each simulation's ultimate, or its ultimate over a premium, from a fit with reserves per simulation, for a tower (apply_tower() on a numeric vector), a deal book or the cash-flow engine (cashflow_run()). Element i is simulation i for every origin and every call, the same as row i of the fit's reserves (and of draw_matrix() of ultimate_distribution()), and the same again when the fit is run with the same seed, so vectors built from one fit keep their dependence.

Usage

ultimate_draws(fit, origin = NULL)

loss_ratio_draws(fit, origin = NULL, premium)

ultimate_distribution(fit)

Arguments

fit

An odp_bootstrap_fit, mack_bootstrap_fit, bayes_odp_fit, bayes_odp_fits, bayes_bf_fit, bayes_bf_normalised_fit, meyers_fit, meyers_fits, compartmental_fit or compartmental_fits.

origin

The component key: the origin's label ("2021", 2021, "2021Q3") for a fit of one segment, the segment's key values then the origin (list("Auto", 2021)) over segments. NULL (the default) gives the total over every component, summed simulation by simulation.

premium

The subject premium of the origin (of every origin for the total), finite and positive.

Value

A numeric vector, one value per simulation; for ultimate_distribution() a predictive_distribution.

Details

The ultimate is the origin's latest value of the fitted column plus its reserve in that simulation, on the column's basis (paid or incurred). Meyers' models simulate the ultimate itself (fit@ultimates), and their draws are those. A compartmental model's ultimate is the latest paid plus its reserve: the paid at the square's last age, on the paid basis.

ultimate_distribution() is the joint distribution of the ultimates, with the dimensions, components and rows of fit@reserves, so join_predictive() and reorder_groups() keep each simulation's origins together.

Examples

long <- data.frame(year = c(2020, 2020, 2020, 2021, 2021, 2022),
                   age = c(12, 24, 36, 12, 24, 12),
                   paid = c(100, 150, 165, 110, 170, 120))
fit <- odp_bootstrap(triangle(long, "year", "age", "paid"), n_sims = 1000, seed = 1)
u <- ultimate_draws(fit, 2022)
all.equal(u, 120 + marginal(fit@reserves, 2022)@draws)
#> [1] TRUE
q <- loss_ratio_draws(fit, 2022, premium = 200)
mean(q)
#> [1] 1.00506
total <- ultimate_draws(fit)