Calculate the Entropic Value at Risk (EVaR) of an investment portfolio or asset’s returns.

Entropic Value at Risk (EVaR) is a risk management metric that quantifies upper bound for the value at risk (VaR) and the conditional value at risk (CVaR) over a specified time horizon and confidence level. EVaR is obtained from the Chernoff inequality. It provides insights into the downside risk associated with an investment and helps investors make informed decisions about risk tolerance.

The EVaR is calculated under the assumption that returns are normally distributed, for which the Chernoff bound has a closed form.

The formula is as follows (with the default alpha=0.05):

\[\text{EVaR} = \text{Mean} - \text{Std} \cdot \sqrt{- 2 \cdot \ln(\alpha)}\]

Where alpha is the tail probability (0.05 for the 95% confidence level) and Std the sample standard deviation (ddof=1). It is an upper bound of the gaussian VaR and CVaR at the same confidence level. Since it only uses the mean and the standard deviation of the returns, it does not reflect their skewness or fat tails, and at high confidence levels it can be less severe than the historical CVaR of an asset with heavy tails.

For more information about the method, see the following paper:

  • Ahmadi-Javid, A. (2012). “Entropic Value-at-Risk: A New Coherent Risk Measure.” Journal of Optimization Theory and Applications, 155(3), 1105-1123.

Also known as: EVaR.

Entropic Value at Risk (eVaR) in Python or via the MCP

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_entropic_value_at_risk as shown below.

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["CLUSD", "NGUSD"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2021-01-01",
    end_date="2025-12-31",
)

toolkit.risk.get_entropic_value_at_risk(period="yearly", within_period=True)

Or, after setting up the Finance Toolkit MCP, ask:

What was the daily 95% entropic Value at Risk of crude oil, natural gas and the S&P 500 in each year from 2021 to 2025?

Which returns:

  CLUSD NGUSD Benchmark
2021 -0.0496 -0.0837 -0.0185
2022 -0.0718 -0.1505 -0.0373
2023 -0.0509 -0.1079 -0.0187
2024 -0.0436 -0.1183 -0.018
2025 -0.0474 -0.1001 -0.0279

Parameters

get_entropic_value_at_risk accepts the following parameters.

ParameterTypeDescriptionExample
periodstrThe data frequency for returns (daily, weekly, monthly, quarterly, or yearly). Defaults to “daily”."weekly"
alphafloatThe tail probability for the EVaR calculation (e.g., 0.05 for the 95% confidence level). Defaults to 0.05.0.01
within_periodboolWhether to calculate EVaR within the specified period or for the entire period. Thus whether to look at the CVaR 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
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 CVaR 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
Share