Items read at a driver's percentiles
co_statistics.RdEach item read at the driver's mean, percentiles and TVaRs: the item's
value on the simulation the driver's statistic selects, as a results table
reports a commission or a margin "at" each percentile of the loss ratio.
With o the driver's stable ascending order (order(driver): ties keep
simulation order) and h = q (n - 1) for a level q in percent over 100,
"Mean" is the item on the first o[i] whose driver is at or above the
driver's mean, "Percentile <q>" the item on o[i] with i from h by
rule (0-based), and "TVaR <q>" the item's mean over o[ceiling(h):]
whatever the rule.
Usage
co_statistics(
items,
driver,
percentiles,
tvar_levels = c(99, 99.5, 99.6, 99.8, 99.9, 99.99),
rule = "round_half_even"
)Arguments
- items
A predictive_distribution (every component is read), or a named list or data frame of numeric vectors of equal length.
- driver
The driver's draws; for a predictive_distribution also a component's key as a named list (as
marginal()takes it), orNULLfor its total.- percentiles
Percentiles, in percent, in
[0, 100].- tvar_levels
TVaR levels in percent.
- rule
"round_half_even"(the default: halves to the even index, as R'sround()and Python's do),"floor"or"ceil".
Value
A data frame: for a predictive_distribution its keys with one
column per statistic, otherwise an item column and one column per
statistic.