Entropic Risk Measure (ERM)

Calculate the Entropic Risk Measure (ERM) of an investment portfolio or asset’s returns at a given risk aversion: the entropic bound on the tail loss of an investor with that risk aversion.

The Entropic Risk Measure is the certainty equivalent loss of an investor with exponential utility, shifted by the confidence level: by the Chernoff inequality the loss exceeds it with a probability of at most alpha, whatever the risk aversion z. The Entropic Value at Risk is its smallest value over z (the historic method of get_entropic_value_at_risk), so the ERM at any risk aversion is at least as severe as the historic EVaR, and equal to it at the z that minimizes it. A z close to the size of the returns (about 0.01 for daily returns) gives a value near the EVaR; a large z gives a value dominated by z * ln(1 / alpha).

The formula is as follows (with the default risk aversion of 1 and an alpha of 0.05):

\[\text{ERM} = - z \cdot \ln\left(\frac{\operatorname{mean}\left(\exp\left(- \frac{\text{Return}_{i}}{z}\right)\right)}{\alpha}\right)\]

Where z is the risk aversion and the mean runs over the returns. The result is a return, negative for a loss, as the VaR, CVaR and EVaR of the Toolkit are.

Also known as: ERM, entropic risk, exponential utility risk measure.

Example · GLD, SLV, USO · 2021 to 2025

Install the Finance Toolkit with pip install financetoolkit -U, then call get_entropic_risk_measure:

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["GLD", "SLV", "USO"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2021-01-01",
    end_date="2025-12-31",
)

toolkit.risk.get_entropic_risk_measure(period="yearly", within_period=True, risk_aversion=0.01)

Or, with the Finance Toolkit MCP set up, ask an AI assistant such as Claude or ChatGPT:

What was the entropic risk measure, at a risk aversion of 0.01, of the SPDR Gold Shares (GLD), iShares Silver Trust (SLV), United States Oil Fund (USO) and the S&P 500 in each year from 2021 to 2025?

Which returns:

Parameters

get_entropic_risk_measure accepts the following parameters.

ParameterTypeDescriptionExample
periodstrThe data frequency for returns. Options are: “daily”, “weekly”, “monthly”, “quarterly”, “yearly”. Defaults to “daily”."weekly"
risk_aversionfloatThe risk aversion z, larger than 0, in the units of the returns. Defaults to 1, the default of Riskfolio-Lib and skfolio.1, the default of Riskfolio-Lib and skfolio
alphafloatThe tail probability (e.g., 0.05 for the 95% confidence level). Defaults to 0.05.0.01
within_periodboolWhether to calculate the ERM within the specified period or for the entire period. Thus whether to look at the ERM within a specific year (if period = ‘yearly’) or look at the entirety of all years. Defaults to False. Note that this requires intraday data when period = ‘daily’, since a single day only nests observations when intraday data was fetched.True
rollingintThe rolling window size to use for the calculation. If set, the ERM is calculated over a rolling window of this many periods across the full return history instead of per period. At least 2. Defaults to None.4
roundingint | NoneThe number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise).2
growthboolWhether to calculate the growth of the ERM values over time. Defaults to False.True
lagint | list[int]The lag to use for the growth calculation. Defaults to 1.4
standardizeboolWhether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False.True
show_columnsstr | list[str] | NoneThe columns to keep, a name or a list of names, matched on every column level, or the rows when no column has those names (such as the line items of a financial statement). Names that do not exist are logged, and when none exist the result is returned in full. Defaults to None, which keeps every column.None, which keeps every column

References

  • Paper Föllmer, H. and Schied, A. (2002). “Convex Measures of Risk and Trading Constraints.” Finance and Stochastics, 6(4), 429-447.
  • Paper Ahmadi-Javid, A. (2012). “Entropic Value-at-Risk: A New Coherent Risk Measure.” Journal of Optimization Theory and Applications, 155(3), 1105-1123.
  • Library Referenced against skfolio’s entropic_risk_measure
  • Library Referenced against Riskfolio-Lib’s Entropic_RM
Share