Repository navigation
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #878 +/- ##
==========================================
- Coverage 99.69% 99.69% -0.01%
==========================================
Files 202 202
Lines 38871 38866 -5
Branches 2501 2501
==========================================
- Hits 38752 38747 -5
Misses 51 51
Partials 68 68
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The clustered covariance is the sum of the outer products of the cluster score totals, divided by the number of observations. After sorting the labels once, this change uses NumPy's segmented addition (
np.add.reduceat) to sum contiguous runs and a single matrix multiplication for all the outer products. The same group boundaries also supply the existing check for fewer than two groups. The regression test adds a singleton cluster to the independent summation check.I timed the complete public
PooledOLS(y, x).fit(cov_type="clustered", ...)call including model construction and the first evaluation of its lazy.covproperty. I also measured the first.covaccess separately. Median milliseconds from five alternating baseline/candidate blocks after warmup, Python 3.13.16, NumPy 2.5.5, pandas 3.1.1, arm64 macOS, one BLAS thread.I checked both versions against statsmodels OLS and its one- and two-way clustered sandwich estimators with corrections off. The largest absolute coefficient and covariance differences were 1.43e-14 and 6.08e-17. Floating-point summation order changes: both implementations can lose precision when within-cluster scores nearly cancel at the limit of float64.
Local full installed-package suite: 23,686 passed, 2,476 skipped, 47 xfailed, one failure. The same test fails at the same line on a separately built wheel from unmodified parent d7980a7:
test_constant_dependent_variable_panel[RandomEffects-0.1]divides 0 by 0 in the random-effects variance decomposition, before evaluating any clustered covariance.Minimal large fixture (time the entire body from model construction through first covariance access):