cvar
- qf_lib.common.utils.returns.cvar.cvar(qf_series: QFSeries, percentage: float) float [source]
Calculates Conditional Value at Risk for a given percentage. Percentage equal to 0.05 means 5% CVaR.
- Parameters:
qf_series (QFSeries) – Series of returns/prices
percentage (float) – Percentage defining CVaR (what percentage of worst-case scenarios should be considered”
- Returns:
Conditional value at risk as a number from range (-1,1). Simplifying: means how much money can be lost in the worst “percentage” % of all cases.
- Return type:
float