Upside Beta
The Upside Beta is the Ordinary Least Squares Beta over the periods in which the benchmark rose only. Together with the Downside Beta it shows whether an asset follows the market more closely in one direction than in the other, which a single Beta averages away.
The formula for the Upside Beta is as follows:
\[\text{Beta}_{\text{up}} = \frac{\operatorname{cov}\left(R_{a}, R_{m}\right)}{\operatorname{var}\left(R_{m}\right)}\]Where \(R_{a}\) are the returns of the asset and \(R_{m}\) those of the benchmark, both taken over the periods in which the benchmark return was positive only. An Upside Beta above the Downside Beta means the asset takes part in rising markets more than in falling ones.
Beta is the slope of an asset’s returns on those of the market: the part of its risk that comes from moving with the market as a whole. In the Capital Asset Pricing Model (CAPM) of Sharpe, Lintner and Mossin this is the only risk that earns a premium, because the rest disappears in a diversified portfolio, so Beta sets the return investors require and enters the cost of equity. The market is the benchmark, typically a broad index such as the S&P 500.
Beta is read against 1, the benchmark’s own Beta: above 1 the asset tends to amplify market moves, below 1 to dampen them, and a negative Beta means it tends to move against the market. A Beta close to zero can come from a low correlation with the market rather than from low volatility, so it is worth checking both before calling a stock defensive. Every estimate rests on a sample of returns and moves from one window to the next, which is why the estimators differ in how they deal with estimation noise, late reactions to the market and asymmetry between rising and falling markets.
See definition: Beta (finance) (Wikipedia)
Also known as: up-market Beta, bull Beta.
In the Finance Toolkit this is get_beta with method="upside", the same function as Beta.
Example · NVDA, TSLA, JPM · 2021 to 2025
Install the Finance Toolkit with pip install financetoolkit -U, then call get_beta:
from financetoolkit import Toolkit
toolkit = Toolkit(
["NVDA", "TSLA", "JPM"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2021-01-01",
end_date="2025-12-31",
)
toolkit.performance.get_beta(method="upside")
| Parameter | Type | Description | Example |
|---|---|---|---|
period | str | The period to use for the calculation. Options are: “daily”, “weekly”, “monthly”, “quarterly”, “yearly”. Defaults to “quarterly” if the Toolkit is initialised with quarterly=True, otherwise “yearly”. | "quarterly" |
rolling | int | The rolling window size to use for the calculation. If you select period = ‘monthly’ and set rolling to 12 you obtain the rolling 12-month Beta. At least 2. Defaults to None. | 4 |
method | str | The estimator of the Beta. Options are: “ols” (Ordinary Least Squares Beta, the covariance over the benchmark variance), “blume” (Blume Adjusted Beta, pulled a third of the way towards 1), “vasicek” (Vasicek Beta, shrunk towards the mean Beta of the tickers), “dimson” (Dimson Beta, the sum of the lagged, same and leading slopes), “scholes_williams” (Scholes-Williams Beta, three slopes over the benchmark autocorrelation), “upside” (Upside Beta, the periods the benchmark rose), “downside” (Downside Beta, the periods the benchmark fell), “frazzini_pedersen” (Frazzini-Pedersen Beta, at the end of each period), “fama” (Fama Beta, the ratio of the standard deviations). Defaults to “ols”. | "ols" |
lags | int | The number of leads and lags of the Dimson Beta. Defaults to 1. | 2 |
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 ratios. 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 |
transform | str | list[str] | None | Time series steps applied in order, such as “sma:12” (moving average), “ema:12”, “std:12”, “zscore:60”, “percentile:120”, “yoy”, “pct_change:3,annualize:3”, “log”, “diff”, “cumsum” or “hp_trend” and “hp_cycle” (Hodrick-Prescott), before growth. A window needs that many periods of history, so the first periods can be empty. Defaults to None. | None |
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 |
Which returns:
| Date | NVDA | TSLA | JPM |
|---|---|---|---|
| 2021 | 1.6187 | 1.7516 | 0.7879 |
| 2022 | 2.3300 | 1.4130 | 1.1621 |
| 2023 | 1.9937 | 2.4069 | 0.6127 |
| 2024 | 3.5700 | 1.7169 | 1.0500 |
| 2025 | 1.6952 | 2.3474 | 0.8061 |
5 rows
References
- Paper Ang, A., Chen, J. and Xing, Y. (2006). “Downside Risk.” Review of Financial Studies, 19(4), 1191-1239.