Skip to contents

The mean of a distribution between its levels p_low and p_high, a band of bad years such as the 98th to 99th percentiles that retrocession and layer pricing read: ((1 - p_low) * TVaR(p_low) - (1 - p_high) * TVaR(p_high)) / (p_high - p_low), each draw (or grid point) counted with the share of its probability inside the window. For a sampled, method = "linear" reads the linear quantile function, and "whole_years" the mean of the draws ranked floor((1 - p_high) * n) + 1 to floor((1 - p_low) * n) from the top (years 21 to 40 of 2,000 between 0.98 and 0.99), an error when that holds no draw.

Usage

window_tvar(dist, p_low, p_high, ...)

Arguments

dist

A sampled or a grid_distribution.

p_low, p_high

The levels, from 0 to 1, p_low below p_high.

...

For a sampled, method: "exact", "linear" or "whole_years", as TVaR(). Otherwise unused.

Value

A number.

See also

Examples

years <- sampled(1:10)
window_tvar(years, 0.7, 0.9)
#> [1] 8.5
window_tvar(years, 0.5, 1) == TVaR(years, 0.5)
#> [1] TRUE
window_tvar(grid_distribution(1, c(0.5, 0.3, 0.2)), 0.6, 0.9)
#> [1] 1.333333