Skip to contents

correlated_years() gives a term of n_years years whose yearly totals (each year's losses and aggregate part) have a rank correlation, set by Iman-Conover, for apply_tower_term(). Each year's simulations move as whole years, keeping their events, times, sums insured, labels and aggregate part. calibrate_year_correlation() finds the correlation between every pair of years for which the mean of a term's yearly totals has ratio times the standard deviation of one year's total, by bisection on the simulations; with the same premium each year that is the ratio of the term's loss ratio's spread to one year's (independent years give 1 / sqrt(n_years), identical ones 1). year_correlation_for_ratio() is the closed form for Pearson's correlation of the totals, (n_years * ratio^2 - 1) / (n_years - 1), a start.

Usage

correlated_years(
  x,
  n_years,
  correlation,
  kind = "spearman",
  draws = "same",
  seed = 0
)

calibrate_year_correlation(
  x,
  n_years,
  ratio,
  kind = "spearman",
  draws = "same",
  seed = 0
)

year_correlation_for_ratio(n_years, ratio)

Arguments

x

An event_set.

n_years

The number of years, at least 2.

correlation

One correlation for every pair of years, or the full matrix.

kind

"spearman" (Spearman's rho of the totals) or "pearson" (the correlation of their normal scores, as reorder_groups()).

draws

"same": every year reorders all the simulations, so each has exactly the one-year distribution and the term's mean the one-year mean; "blocks": year t is block t of term_years().

seed

The same seed gives the same years.

ratio

The target ratio, in [0, 1].

Value

correlated_years() a list of n_years event_sets; calibrate_year_correlation() a list of correlation, the ratio it achieves and the years; year_correlation_for_ratio() a number.

Examples

ev <- simulate_events(poisson_count(2), lognormal(4, 1), 4000, seed = 7)
years <- correlated_years(ev, 3, 0.5, seed = 11)
fit <- calibrate_year_correlation(ev, 3, 0.75, seed = 11)
c(fit$correlation, fit$ratio)
#> [1] 0.4058227 0.7499997
year_correlation_for_ratio(3, 0.75)
#> [1] 0.34375