Worst Realization
Calculate the Worst Realization: the lowest return of an investment portfolio or asset, the loss on the worst day (or week, month) of the sample.
The Worst Realization is the most conservative measure of the risk in the left tail: the loss on the worst day (or week, month) of the sample. It is the limit of the Value at Risk and Conditional Value at Risk as their tail probability goes to 0, and the risk measure of Young’s (1998) minimax portfolio, which minimizes the worst loss rather than the variance. As it rests on a single observation it moves in jumps and depends on the length of the sample: a longer history can only add worse days.
The formula is as follows:
\[\text{Worst Realization} = \min(\text{Return}_{t})\]The result is a return, negative for a loss, as the Value at Risk and Conditional Value at Risk of the Toolkit are.
Also known as: worst return, minimax risk, maximum loss.
Example · NVDA, AMD, INTC · 2021 to 2025
Install the Finance Toolkit with pip install financetoolkit -U, then call get_worst_realization:
from financetoolkit import Toolkit
toolkit = Toolkit(
["NVDA", "AMD", "INTC"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2021-01-01",
end_date="2025-12-31",
)
toolkit.risk.get_worst_realization(period="yearly", within_period=True)
Or, with the Finance Toolkit MCP set up, ask an AI assistant such as Claude or ChatGPT:
What was the worst daily return of Nvidia, AMD, Intel and the S&P 500 in each year from 2021 to 2025?
Which returns:
| Item | NVDA | AMD | INTC | Benchmark |
|---|---|---|---|---|
| 2021 | -0.0822 | -0.0620 | -0.1168 | -0.0244 |
| 2022 | -0.0947 | -0.1387 | -0.0856 | -0.0435 |
| 2023 | -0.0591 | -0.0922 | -0.0641 | -0.0201 |
| 2024 | -0.1000 | -0.1062 | -0.2606 | -0.0298 |
| 2025 | -0.1697 | -0.0890 | -0.1150 | -0.0585 |
5 rows
Parameters
get_worst_realization accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
period | str | The data frequency for returns. Options are: “daily”, “weekly”, “monthly”, “quarterly”, “yearly”. Defaults to “daily”. | "weekly" |
within_period | bool | Whether to calculate the Worst Realization within the specified period or for the entire period. Thus whether to look at the Worst Realization 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 |
rolling | int | The rolling window size to use for the calculation. If set, the Worst Realization 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 |
rounding | int | None | The number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise). | 2 |
growth | bool | Whether to calculate the growth of the Worst Realization values over time. Defaults to False. | True |
lag | int | list[int] | The lag to use for the growth calculation. Defaults to 1. | 4 |
standardize | bool | Whether 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_columns | str | list[str] | None | The 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 Young, M.R. (1998). “A Minimax Portfolio Selection Rule with Linear Programming Solution.” Management Science, 44(5), 673-683.
- Library Referenced against Riskfolio-Lib’s WR
- Library Referenced against skfolio’s worst_realization