value_at_risk#

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

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

VaR estimates the potential loss in value of an asset or portfolio over a defined period for a given confidence interval. It is a standard measure used in risk management to assess the risk of loss on a specific portfolio of financial assets.

The Value at Risk (VaR) is calculated as:

\[VaR = \mu - Q_{(1 - \alpha)}\]
where:
  • \(\mu\) is the mean of the sample returns.

  • \(Q_{(1 - \alpha)}\) is the quantile at the specified confidence level.

Parameters:
confidence_levelfloat, optional

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

Returns:
UtilityFunctionType

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

Raises:
ValueError

If confidence_level is not between 0 and 1.

References

[1]

Jorion, P. (2006). Value at Risk: The New Benchmark for Managing Financial Risk.