Date events by a season
with_seasonal_times.RdThe same events at times drawn from a seasonal density: the year is cut
into length(weights) equal periods (12 for months, 52 for weeks)
starting at the contract's inception, and a loss falls in period k
with probability weights[k] / sum(weights), uniformly within it. A
zero weight means no losses in that period (a hurricane season). The
draws are those of with_uniform_times(), mapped through the season's
quantile, so equal weights give the uniform times.
Value
An event_set whose losses carry times; event_times() reads
them.
Examples
ev <- simulate_events(poisson_count(3), lognormal(0, 1), 10, seed = 1)
# Atlantic hurricanes, June to November, for a 1 January contract.
hurricanes <- with_seasonal_times(ev, c(0, 0, 0, 0, 0, 1, 2, 6, 8, 3, 1, 0))
event_times(hurricanes, 1)
#> [1] 0.8337068