CVaR Diversification Ratio

perfana.monte_carlo.risk.cvar_div_ratio(data, weights, alpha=0.95, rebalance=True, invert=True)[source]

Calculates the CVaR (Expected Shortfall) tail diversification ratio of the portfolio

Notes

From a mathematical point of view, the alpha value (confidence level for calculation) should be taken at the negative extreme of the distribution. However, the default is set to ease the practitioner.

Parameters
  • data (ndarray) – Monte carlo simulation data. This must be 3 dimensional with the axis representing time, trial and asset respectively.

  • weights (Union[Iterable[Union[int, float]], ndarray, Series]) – Weights of the portfolio. This must be 1 dimensional and must match the dimension of the data’s last axis.

  • alpha – Confidence level for calculation.

  • rebalance – If True, portfolio is assumed to be rebalanced at every step.

  • invert – Whether to invert the confidence interval level. See Notes.

Returns

CVaR (Expected Shortfall) tail diversification ratio

Return type

float

Examples

>>> from perfana.datasets import load_cube
>>> from perfana.monte_carlo import cvar_div_ratio
>>> cube = load_cube()[..., :3]
>>> weights = [0.33, 0.34, 0.33]
>>> cvar_div_ratio(cube, weights)
0.8965390850633622