NUMERICAL AUDIT · 5 DECEMBER 2026

Goldman Sachs’ gs-quant gives a portfolio identical to its benchmark a beta of 0.0001

Xamit Kadirbekov and Daniyal Kadirbekov, GERO Numerical Assurance

REPRODUCED · OPEN. Fix and tests submitted as gs-quant pull request #424 on 5 December 2026; not merged at the time of writing. Reproduced with gs-quant 2.3.4 from PyPI (master commit 0e3cc8e, 27 November 2026). Reproduction script: gs-quant-benchmark-returns-check.py.

gs-quant is Goldman Sachs’ open-source Python package for quantitative finance (Apache 2.0). Its module gs_quant/timeseries/measures_reports.py computes risk and performance measures for a Marquee performance report against a benchmark: beta, alpha, tracking error and others. Yesterday we reported a window error in max_drawdown. This is a second, separate defect in the same library.

0.0001beta of a portfolio identical to its benchmark (should be 1)
4measures fed a cumulative benchmark return in percent
1.6%annualized 0.1% a day in calmar and treynor (should be 28.6%)

The test any benchmark measure must pass

If a portfolio’s daily return is exactly the benchmark’s daily return, its beta is 1, its alpha is 0 and its tracking error is 0. We gave gs-quant such a portfolio: 1,000 business days of simulated returns, a 250-day window, and the same series on both sides. Only the two data lookups were replaced; the measure code ran unchanged.

Measure (last value)Should begs-quant 2.3.4
portfolio_beta10.000103
alpha00.342
tracking_error_bear03.34
tracking_error_bull07.77
tracking_error (control)00.000000

A beta of 0.0001 says the portfolio does not move with its benchmark at all, when it is the benchmark. A hedge sized from that beta would be close to zero instead of the full position.

Where it comes from

The portfolio side is a daily return as a fraction: the report’s daily P&L divided by the previous day’s assets under management. For the benchmark, portfolio_beta, alpha, tracking_error_bear and tracking_error_bull call a helper that returns something else:

def _get_benchmark_return(benchmark_id, start_date, end_date):
    ...
    start_price = benchmark_pricing.iloc[0]
    benchmark_returns = (benchmark_pricing / start_price) - 1
    return benchmark_returns * 100

That is the cumulative return since the start date, in percent. A beta regresses one series on the other, so the daily fraction ends up compared with a running total in percent. The neighbouring measures in the same file, tracking_error, jensen_alpha, information_ratio and sortino_ratio, call _get_benchmark_daily_return, which returns daily returns. That is why the plain tracking error in the table is correct and the bull and bear versions are not.

Three more problems in the same measures

Alpha is regressed the wrong way round. The docstring says alpha is “the intercept from a regression analysis, where the portfolio’s returns are regressed against the benchmark’s returns.” The code calls stats.linregress(portfolio_window, benchmark_window), which regresses the benchmark on the portfolio.

Bull and bear tracking error. They are documented as the standard deviation “only counting the periods when benchmark returns were” positive or negative. The code takes the standard deviation of the whole window and keeps it only if the last day qualifies.

Annualizing with a square root. calmar_ratio and treynor_measure turn a daily return into an annual one as (1 + r) ** np.sqrt(252) - 1. The square root of 252 is how volatility is scaled to a year; a return compounds with the power 252. For a constant 0.1% a day this gives 1.6% instead of 28.6%. In calmar_ratio the numerator is also a single day’s return, not the return of the window over which the drawdown is measured.

How to reproduce

In a clean environment:

pip install gs-quant==2.3.4
python gs-quant-benchmark-returns-check.py

The script prints the table above and the annualization comparison. Download it: gs-quant-benchmark-returns-check.py.

Fix and status

We submitted pull request #424 on 5 December 2026. It uses daily benchmark returns in the four measures, regresses the portfolio on the benchmark, computes bull and bear tracking error over bull and bear days, and annualizes with the power 252 over the rolling window. With the fix, the identical portfolio gets beta 1, alpha 0 and zero tracking error. The library’s own tests for these five measures had the old values written in; we recomputed the new expected values independently with plain numpy from the same inputs. The changed and new tests fail on the current code and pass with the fix, and the timeseries test suite gives 963 passed. In our search of the project’s issues and pull requests we found no earlier report of these defects. External pull requests were last merged into gs-quant in December 2024, so this article records the finding whether or not the pull request is merged.

Limits

The table uses simulated returns and replaces the two data lookups; we did not run these measures on a live Marquee report and do not know what numbers clients see in Marquee. The defects are visible in the code itself: the helper returns a cumulative percentage regardless of the data. This is an implementation defect in specific functions, not a statement about other parts of the library.