One part of a predictive distribution
select_components.RdThe components whose value on dimension dim is one of keys, with every
dimension and the draws' joint structure kept. Take one part of a result
this way before joining it to another: select_components(apply_tower(...), "kind", "ceded") is a treaty's cession, ready to add to a book with
join_predictive(). Aggregating over kind instead adds gross, ceded and
net together.
Arguments
Examples
pd <- predictive_distribution(matrix(c(10, 4, 3, 0, 7, 4), ncol = 3),
data.frame(kind = c("gross", "ceded", "net"), layer = c("ground_up", "5x5", "retained")))
mean(select_components(pd, "kind", "ceded"))
#> [1] 1.5