Years of losses from elsewhere
events_from_years.RdBuilds an event_set from your own simulation, or a catastrophe model's
event loss table by year, optionally with the sum insured of the risk
each loss hit, which a surplus_treaty() needs.
Arguments
- years
A list with one numeric vector of losses per year, in order.
- sums_insured
NULL, or a list of the same shape: each loss's sum insured, at least the loss.- seed
Recorded in results' provenance.
- times
NULL, or a list of the same shape: each loss's time as the fraction of the year elapsed (in[0, 1], non-decreasing within a year), which reinstatements pro rata as to time need.
Value
An event_set; event_sums_insured() and event_times() read
the sums insured and times back.
Examples
ev <- events_from_years(list(c(5, 2), numeric(), 9), list(c(10, 2), numeric(), 50))
event_counts(ev)
#> [1] 2 0 1
event_sums_insured(ev, 3)
#> [1] 50