tail_distance#
- pymc_marketing.mmm.utility.tail_distance(confidence_level=0.75)[source]#
Calculate the absolute distance between the mean and the quantiles.
It is a simple and interpretable metric that can be used to assess the risk.
The tail distance is calculated as:
\[\begin{split}Tail\\ Distance = |Q_{(1 - \\alpha)} - \\mu| + |\\mu - Q_{\\alpha}|\end{split}\]- where:
\(\\mu\) is the mean of the sample returns.
\(Q_{(1 - \\alpha)}\) is the quantile at the specified confidence level.
\(Q_{\\alpha}\) is the quantile at the specified confidence level.
- Parameters:
- confidence_level
float
, optional Confidence level for the quantiles (default is 0.75). Confidence level must be between 0 and 1.
- confidence_level
- Returns:
UtilityFunctionType
A function that calculates the tail distance metric given samples and budgets.