Skip to contents

Element k is sum(LR[1:k] * EP[1:k]) / sum(EP[1:k]), and 0 where the premium to date is 0.

Usage

cumulative_loss_ratio(loss_ratios, premiums)

Arguments

loss_ratios, premiums

One premium per loss ratio. A row with both NA adds nothing; a row with one is an error, as are a negative premium and a value that is not finite.

Value

A numeric vector as long as the inputs.

Examples

cumulative_loss_ratio(c(0.5, 0.8, 0.6), c(100, 300, 0))
#> [1] 0.500 0.725 0.725