Skip to content

Add explicit-state Bernoulli distribution - #86

Draft
jonathanberthias wants to merge 2 commits into
migration/log-probabilityfrom
migration/bernoulli
Draft

jonathanberthias wants to merge 2 commits into
migration/log-probabilityfrom
migration/bernoulli

Conversation

@jonathanberthias

@jonathanberthias jonathanberthias commented Sep 27, 2026 •

Copy link
Copy Markdown
Collaborator

The common log_prob path has no concrete discrete distribution, so integer sampling, probability bounds, and discrete MLE remain unproven in the new API.

This PR adds an opt-in Bernoulli law whose probability is a literal or parameter expression. It scores observations through log_prob, offers pmf, returns integer samples with sample dimensions before parameter batches, and works with the existing explicit-state fitter. Invalid probability states are rejected during evaluation and penalized during fitting.

Bernoulli lives with the SciPy-backed implementations, while distributions/core.py remains limited to shared contracts. Broader discrete wrappers and the public API cutover remain separate work.

@jonathanberthias
jonathanberthias force-pushed the migration/log-probability branch from 5aa26b9 to 360f181 Compare September 27, 2026 13:51
@jonathanberthias
jonathanberthias force-pushed the migration/log-probability branch from 360f181 to 7707140 Compare September 27, 2026 20:27
@jonathanberthias
jonathanberthias force-pushed the migration/bernoulli branch 2 times, most recently from 1aa980d to 796ffab Compare October 2, 2026 22:25
@jonathanberthias
jonathanberthias force-pushed the migration/log-probability branch from 7f1ac6f to 654c6ff Compare October 2, 2026 22:25
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