Skip to content

fix: include newest returns in rolling risk attribution - #10

Merged
chris-cpz merged 1 commit into
fix/sweep1125-quant-analyticsfrom
fix/rolling-risk-latest-observation
Nov 29, 2026
Merged

chris-cpz merged 1 commit into
fix/sweep1125-quant-analyticsfrom
fix/rolling-risk-latest-observation

Conversation

@chris-cpz

Copy link
Copy Markdown
Contributor

The existing SDK risk fix addressed its own rolling windows, but the quant library's rolling attribution and factor exposures still omitted the newest observation. A 20-day series produced no 20-day result; a longer series ended its last result yesterday.

Include the final complete window in both helpers. Regression tests compare the last alpha, beta, information ratio and factor coefficients with independent NumPy calculations, including a large loss on the final day and an exactly-one-window history. Update the older IR test that accidentally asserted yesterday's window.

Validation: four new cases fail before the fix. Full suite: 1,697 passed, 7 optional skips; 83.64% coverage exceeds the 55% floor. mypy cpz_quant and ruff check cpz_quant tests pass.

Stacked on #8. The SDK side of the same report is covered by CPZ-Lab/cpz-py#81. Both changes are needed. No package release has occurred.

Fixes CPZ-Lab/cpzai#3128

@chris-cpz
chris-cpz marked this pull request as ready for review November 29, 2026 11:34
@chris-cpz
chris-cpz merged commit 83c0bda into fix/sweep1125-quant-analytics Nov 29, 2026
0 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant