Skip to contents

The events regrouped into contract years starting at start, a fraction of the simulated year, for a treaty whose year is not the simulation's (#586). The simulated years are read as consecutive years of one timeline: a loss of year i at time t happens at i + t, contract year j runs from j + start to j + 1 + start, and each loss moves to its contract year with its time rebased to it, keeping its sum insured and labels. The first and last contract years are partial: partial = "drop" (the default) leaves them out with their losses, so one year fewer remains; "keep" keeps them, one year more. start = 0 returns the set as it is. Needs times of loss (with_uniform_times(), a timed read_ylt()); an aggregate part, which has no times, is refused.

Usage

contract_years(x, start, partial = c("drop", "keep"))

Arguments

x

An event_set with times.

start

The contract year's start, a fraction of the year from 0 to below 1.

partial

"drop" or "keep".

Value

An event_set.

Examples

cal <- events_from_years(list(c(1, 2), 3), times = list(c(0.25, 0.75), 0.25))
july <- contract_years(cal, 0.5)
events(july, 1)
#> [1] 2 3
event_times(july, 1)
#> [1] 0.25 0.75