Skip to content

Reject invalid numeric PMF/prior vectors#145

Merged
sbfnk merged 1 commit into
mainfrom
fix/pmf-validation
Jul 23, 2026
Merged

Reject invalid numeric PMF/prior vectors#145
sbfnk merged 1 commit into
mainfrom
fix/pmf-validation

Conversation

@sbfnk-bot

Copy link
Copy Markdown
Collaborator

Addresses #141.

A shared internal check_pmf_values() rejects a numeric PMF/weight vector that is non-numeric, contains negative or non-finite values, or is all zero, with an informative error. Wired into NonParametric() and Dirichlet(prior = ) so both behave the same. Un-normalised non-negative weights are still accepted and normalised as before.

This is the safe, non-breaking slice of #141: it catches genuinely-invalid input without touching the auto-normalisation behaviour. The broader question in #141 — whether to keep silently renormalising, warn near 1, or preserve a deliberately sub-1 PMF (e.g. a nowcasting sub-distribution) — is left open on the issue for a separate decision, so I've referenced rather than closed it.

…irichlet()

Co-authored-by: sbfnk <sebastian.funk@lshtm.ac.uk>
@sbfnk-bot
sbfnk-bot requested a review from sbfnk July 22, 2026 16:32
@sbfnk
sbfnk marked this pull request as ready for review July 23, 2026 06:14
@sbfnk-bot sbfnk-bot added the llm-reviewed Reviewed by the wait-for-review loop label Jul 23, 2026
@sbfnk
sbfnk merged commit b8834a5 into main Jul 23, 2026
11 checks passed
@sbfnk
sbfnk deleted the fix/pmf-validation branch July 23, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llm-reviewed Reviewed by the wait-for-review loop

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants