Skip to content

MATH-1392: Allow square full-rank regression without an intercept - #337

Merged
aherbert merged 1 commit into
apache:masterfrom
hutiefang76:MATH-1392-no-intercept-sample
Oct 24, 2026
Merged

aherbert merged 1 commit into
apache:masterfrom
hutiefang76:MATH-1392-no-intercept-sample

Conversation

@hutiefang76

@hutiefang76 hutiefang76 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Fixes MATH-1392: https://issues.apache.org/jira/browse/MATH-1392

Sample-size validation always reserves a column for an intercept, including when setNoIntercept(true) is used. A full-rank 2×2 design such as x = [[1, 2], [3, 4]], y = [5, 11] is therefore rejected before OLS or GLS can solve the uniquely determined coefficients [1, 2].

Count only the design columns actually used in both the flat and matrix entry points. Keep the existing default-intercept boundary, rejection of underdetermined and empty inputs, and covariance validation. This permits coefficient estimation for a square full-rank model; it does not make error variance estimable at zero residual degrees of freedom, and the Javadoc now states that limit.

Validation on the current head e406d597 (macOS arm64, JDK 17):

  • All 60 OLS/GLS tests pass, with no failures, errors or skips. The original red run rejected the three square no-intercept cases; its other 57 cases passed.
  • Root mvn -B clean verify passed across all 14 modules: 3,809 test cases, 33 skips, zero final failures or errors. The project's unchanged retry configuration recovered 51 randomized cases after 97 failed attempts; this was one root build invocation. Focused cases are included in this count.
  • The three implementation/test files are byte-for-byte unchanged by the rebase onto master 73bf53b4. The changelog keeps both MATH-1678 and MATH-1392; the net PR still contains only its four intended files.
  • git diff --check passed. Hosted CI for this rebased head is separate and remains to complete.

AI-generated description. DeepSeek and Codex assisted with investigation, implementation, tests and review. The Git state and validation figures were checked against the execution records.

@hutiefang76

Copy link
Copy Markdown
Contributor Author

The three workflows for 6fc6ba7 are waiting for approval (action_required, zero jobs started). Could a maintainer approve them? Local mvn clean verify and the Java 8 OLS/GLS checks have passed; the PR description includes the existing automatic-retry results.

@codecov-commenter

codecov-commenter commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.19%. Comparing base (f554608) to head (e406d59).
⚠️ Report is 385 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #337      +/-   ##
============================================
+ Coverage     86.54%   87.19%   +0.64%     
+ Complexity     9787       91    -9696     
============================================
  Files           532      499      -33     
  Lines         35516    33514    -2002     
  Branches       6194     5848     -346     
============================================
- Hits          30738    29222    -1516     
+ Misses         3518     3169     -349     
+ Partials       1260     1123     -137     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aherbert

Copy link
Copy Markdown
Contributor

Please rebase to resolve conflicts

Permit square full-rank OLS and GLS designs without an intercept while
preserving default-intercept and underdetermined-input validation.
Document that error variance remains unavailable at zero residual DOF.

Generated-by: DeepSeek
Generated-by: Codex
@hutiefang76
hutiefang76 force-pushed the MATH-1392-no-intercept-sample branch from 82273cc to e406d59 Compare October 24, 2026 13:41
@hutiefang76

Copy link
Copy Markdown
Contributor Author

Rebased onto current master 73bf53b4; the new head is e406d597 with one linear commit. The only conflict was in changes.xml, where both MATH-1678 and MATH-1392 are retained. The three implementation/test files are byte-for-byte unchanged.

All 60 OLS/GLS tests pass. Root mvn clean verify also completes all 14 modules: 3,809 cases, 33 skips, no final failures or errors. The existing retry configuration recovered 51 randomized cases after 97 failed attempts; seeds, tolerances and retry settings are unchanged. Hosted CI still needs to complete on this head.

AI-generated reply; Git state and validation figures were checked against the execution records.

@aherbert
aherbert merged commit b3a8489 into apache:master Oct 24, 2026
11 of 12 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.

3 participants