Skip to content

Use stable logsumexp in grid plots - #223

Open
fujikix1102 wants to merge 2 commits into
cosmosis-developers:mainfrom
fujikix1102:audit/grid-plots-logsumexp
Open

fujikix1102 wants to merge 2 commits into
cosmosis-developers:mainfrom
fujikix1102:audit/grid-plots-logsumexp

Conversation

@fujikix1102

Copy link
Copy Markdown

Summary

  • replace direct log(exp(like).sum()) calculations with SciPy's stable logsumexp
  • cover both 1D and 2D grid marginalization paths
  • add tests for extreme log-likelihoods and empty groups

Validation

  • pytest -q cosmosis/test/test_grid_plots.py --disable-warnings --maxfail=1 (2 passed)
  • Python compilation and git diff --check passed

@fujikix1102

Copy link
Copy Markdown
Author

The Python 3.9 macOS/Ubuntu jobs terminate after the existing MultiNest/PolyChord/L-BFGS-B sampler output with exit code 1; the available excerpt contains no grid-plots traceback or failing test name. All 3.10+ jobs pass. Could a maintainer please rerun the two 3.9 jobs or expose the final pytest traceback? The dedicated grid-plot tests pass locally.

@fujikix1102

Copy link
Copy Markdown
Author

CI run 35924752621 identified the failure: the new empty-group regression test called logsumexp on an empty array, raising ValueError in Python 3.9. Commit c10ef96 now treats an empty marginalization group as mathematical log-sum-exp = -inf. The two grid plot tests pass locally; please rerun CI.

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