Skip to content

Fix Poisson PMF denominator for integer observations#23

Open
OldCrow wants to merge 1 commit intoKorfLab:masterfrom
OldCrow:fix/poisson-pmf-tgamma
Open

Fix Poisson PMF denominator for integer observations#23
OldCrow wants to merge 1 commit intoKorfLab:masterfrom
OldCrow:fix/poisson-pmf-tgamma

Conversation

@OldCrow
Copy link
Copy Markdown

@OldCrow OldCrow commented Apr 24, 2026

Summary

  • Replace factorial(k) with tgamma((double)k + 1.0) in poisson_pdf
  • Avoid small-k inaccuracies from the Stirling-based factorial path
  • Keep PMF computation numerically stable for integer observation counts

Validation

  • Rebuilt and reinstalled StochHMM with this change
  • Reran downstream libhmm vs StochHMM distribution suite
  • Poisson nonfinite/null diff rows dropped from 9 to 0 in the benchmark artifacts

Co-Authored-By: Oz oz-agent@warp.dev

Replace factorial(k) with tgamma(k+1) in poisson_pdf to avoid small-k inaccuracies from the Stirling-based approximation.

Co-Authored-By: Oz <oz-agent@warp.dev>
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