Skip to content

Use Cholesky solves in PMC covariance evaluation - #222

Open
fujikix1102 wants to merge 1 commit into
cosmosis-developers:mainfrom
fujikix1102:audit/pmc-cholesky-no-inverse
Open

fujikix1102 wants to merge 1 commit into
cosmosis-developers:mainfrom
fujikix1102:audit/pmc-cholesky-no-inverse

Conversation

@fujikix1102

Copy link
Copy Markdown

Summary

  • replace explicit covariance inverses in PMC Gaussian and Student-t components with cached Cholesky factors
  • evaluate quadratic forms with triangular solves and compute log normalizations from the Cholesky diagonal
  • retain the historical A normalization attribute for compatibility
  • add regression coverage against the direct quadratic-form reference

Validation

  • pytest -q cosmosis/test/test_samplers.py -k 'pmc or pmaxlike or maxlike' --disable-warnings --maxfail=1 (17 passed)
  • Python compilation and git diff --check passed

The complete sampler test file is environment-limited here because the optional dynesty dependency is not installed.

@fujikix1102

Copy link
Copy Markdown
Author

Follow-up validation: installed dynesty, zeus-mcmc, and nautilus-sampler in the test environment. Full cosmosis/test/test_samplers.py now passes: 37 passed, 4 skipped, 457 warnings in 46.71s. The skips are optional/unsupported environments; no PMC-related failures.

@fujikix1102

Copy link
Copy Markdown
Author

Performance/reproducibility check: with the same seed (20260924), dimension=24, 4,000 samples, and 8 log-density evaluations per timing run, the Cholesky implementation had median 0.00335 s versus 0.03759 s for the previous explicit-inverse implementation (11.2x speedup). Maximum absolute log-density difference was 1.42e-13.

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