conditional_value_at_risk#

pymc_marketing.mmm.utility.conditional_value_at_risk(confidence_level=0.95)[source]#

Calculate the Conditional Value at Risk (CVaR) at a specified confidence level.

CVaR, also known as Expected Shortfall, measures the average loss exceeding the VaR at a given confidence level, providing insight into the tail risk of the distribution.

The Conditional Value at Risk (CVaR) is calculated as:

\[CVaR = \mathbb{E}[X \mid X \leq VaR]\]

where \(X\) represents the loss distribution, and \(VaR\) is the Value at Risk at the specified confidence level. CVaR provides a more comprehensive view of the risk associated with extreme losses beyond the VaR.

Parameters:
confidence_levelfloat, optional

Confidence level for CVaR (default is 0.95). Confidence level must be between 0 and 1.

Returns:
UtilityFunctionType

A function that calculates the CVaR value at the specified confidence level given samples and budgets.

Raises:
ValueError

If confidence_level is not between 0 and 1. If no samples fall below the VaR threshold.

References

[1]

Rockafellar, R.T., & Uryasev, S. (2000). Optimization of Conditional Value-at-Risk.