Add explicit-state Bernoulli distribution - #86
Draft
jonathanberthias wants to merge 2 commits into
Draft
jonathanberthias wants to merge 2 commits into
jonathanberthias wants to merge 2 commits into
Conversation
jonathanberthias
force-pushed
the
migration/log-probability
branch
from
September 27, 2026 13:51
5aa26b9 to
360f181
Compare
jonathanberthias
force-pushed
the
migration/bernoulli
branch
from
September 27, 2026 13:51
cf1b54a to
04e3ff6
Compare
jonathanberthias
force-pushed
the
migration/log-probability
branch
from
September 27, 2026 20:27
360f181 to
7707140
Compare
jonathanberthias
force-pushed
the
migration/bernoulli
branch
2 times, most recently
from
October 2, 2026 22:25
1aa980d to
796ffab
Compare
jonathanberthias
force-pushed
the
migration/log-probability
branch
from
October 2, 2026 22:25
7f1ac6f to
654c6ff
Compare
jonathanberthias
force-pushed
the
migration/bernoulli
branch
from
October 3, 2026 11:02
796ffab to
ed06a0b
Compare
jonathanberthias
force-pushed
the
migration/log-probability
branch
from
October 3, 2026 11:03
654c6ff to
7a83104
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The common
log_probpath 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, offerspmf, 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.pyremains limited to shared contracts. Broader discrete wrappers and the public API cutover remain separate work.