Skip to content

Fix complex Watson fitting direction - #5570

Merged
FlorianPfaff merged 1 commit into
mainfrom
fix/complex-watson-fitting
Oct 28, 2026
Merged

FlorianPfaff merged 1 commit into
mainfrom
fix/complex-watson-fitting

Conversation

@FlorianPfaff

@FlorianPfaff FlorianPfaff commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Complex Watson fitting conjugated the wrong operand when forming scatter matrices from row-wise observations. For nine observations at [1, i]/sqrt(2) and one at its orthogonal conjugate, both weighted and unweighted fitting selected the minority direction.

Form both scatter matrices as sums of z zᴴ, matching the PDF convention. Their eigenvalues are unchanged, preserving the concentration calculation and existing weight normalization.

Validation

Compared with main f653ab8e621fce69eeb9c1c39a0c50fc9a7275c9 using identical frozen dependencies: Python 3.13.14, NumPy 2.4.5, CPU PyTorch 2.12.1, JAX 0.9.1 (x64), and SciPy 1.17.1.

  • Before: 4 failed, 2 passed in the new regression file on each of NumPy and PyTorch. The direction overlap was zero instead of one. Existing targeted tests passed.
  • After: all 6 new regressions pass on NumPy and PyTorch. Coverage includes both estimation entry points, weighted/unweighted observations, PDF ranking, unitary coordinate changes, independent sample phases, and an independent D=2 concentration-moment reference.
  • Broader Watson/Bingham/mixture checks: NumPy 96 passed, 1 skipped; PyTorch 97 passed; JAX 20 passed, 77 skipped. Skipped testcase identities are identical before/after; the new JAX skips preserve the algorithm's existing backend restriction. Existing SciPy/NumPy/PyTorch deprecation warnings remain.
  • Repository Ruff, focused Black, and git diff --check passed. Independent source/test review found no issues.
  • Wheel and source distribution built. Installed-wheel smokes passed for NumPy and PyTorch in isolated processes outside the checkout, confirming installed-package origins, both fitting branches, direction/density behavior, and concentration.
  • CUDA was unavailable on this CPU-only host.
  • Existing PR CI passed all 10 backend/Python jobs plus lint, documentation, packaging, and minimal-install checks. All supporting PR workflows passed; no failures were found.

Two-file fix from current main. The separate mixture-moment issue remains a follow-up.

@github-actions

Copy link
Copy Markdown
Contributor

✅MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Max errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 4.73s
✅ JSON prettier 7 0 0 0 0.57s
✅ JSON v8r 7 0 0 3.49s
✅ MARKDOWN markdownlint 69 0 0 0 1.44s
✅ MARKDOWN markdown-table-formatter 69 0 0 0 0.26s
✅ PYTHON black 2042 0 0 0 36.95s
✅ PYTHON isort 2042 3 0 0 1.69s
✅ REPOSITORY betterleaks yes no no 0.88s
✅ REPOSITORY checkov yes no no 26.24s
✅ REPOSITORY git_diff yes no no 0.08s
✅ REPOSITORY secretlint yes no no 3.88s
✅ REPOSITORY syft yes no no 2.12s
✅ REPOSITORY trivy-sbom yes no no 1.49s
✅ YAML prettier 11 0 0 0 0.48s
✅ YAML v8r 11 0 0 8.87s
✅ YAML yamllint 11 0 0 0.27s

Notices

⚠️ Your configuration references items that have been removed from MegaLinter and are ignored: MAKEFILE_CHECKMAKE. See Removed linters to find their replacements.

See detailed reports in MegaLinter artifacts

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@10.1.0 --custom-flavor-setup --custom-flavor-linters PYTHON_BLACK,PYTHON_ISORT,COPYPASTE_JSCPD,JSON_V8R,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_BETTERLEAKS,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY_SBOM,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

MegaLinter is provided by OX Security
Show us your support by starring ⭐ the repository

@FlorianPfaff
FlorianPfaff marked this pull request as ready for review October 28, 2026 16:36
@FlorianPfaff
FlorianPfaff merged commit 5c0a303 into main Oct 28, 2026
26 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