Systemic risk contributions
systemic_risk.Rdmarginal_expected_shortfall() is each component's mean over the
simulations where the total is in its worst 1 - p; it equals
allocate(x, distortion("tvar", p)) and adds up to the total's TVaR.
esscher_allocation() is each component's mean under the Esscher
transform of the total, E[X_j exp(h S)] / E[exp(h S)]; it adds up to
esscher_premium(x, h). covar() is the total's VaR at level q over
the simulations where one component is at or above its own VaR at p
(Adrian and Brunnermeier's CoVaR, in the form of Girardi and Ergun):
compare it with VaR(x, q) to see how much that component's bad years
drag the portfolio.
Arguments
Value
marginal_expected_shortfall() and esscher_allocation(): the
keys data frame of x with a contribution column. covar(): a
single number.
Examples
pd <- predictive_distribution(
matrix(c(1, 2, 3, 4, 0, 1, 5, 1), ncol = 2),
data.frame(lob = c("a", "b"))
)
marginal_expected_shortfall(pd, 0.5)
#> lob contribution
#> 1 a 3.5
#> 2 b 3.0
esscher_allocation(pd, 0.1)
#> lob contribution
#> 1 a 2.697995
#> 2 b 2.231890
covar(pd, list(lob = "a"), 0.75, 0.5)
#> [1] 5