Multinomial distribution#258
Open
wouterwln wants to merge 4 commits into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #258 +/- ##
==========================================
+ Coverage 82.01% 84.28% +2.26%
==========================================
Files 41 41
Lines 3409 3397 -12
==========================================
+ Hits 2796 2863 +67
+ Misses 613 534 -79 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Nimrais
requested changes
Oct 23, 2025
| for n in 2:6 | ||
| for trials in 2:10 | ||
| @testset let d = Multinomial(trials, normalize!(rand(rng, n), 1)) | ||
| test_exponentialfamily_interface(d; option_assume_no_allocations = false, |
Member
There was a problem hiding this comment.
The PR is good. Only thing could you add some ad-hoc tests for the methods that we skipped to test in our generic test?
Member
Author
|
@Nimrais could you add a test for mean parametrization Fisher information? |
Member
|
ok np |
Contributor
|
LGTM!! My only comment would be to use |
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.
Together with @esther-van-pelt . There are a couple of issues with the Multinomial distribution:
(1) The Fisher information, which I took from the
wipfolder implementation, returns non-invertible matrices. This is similar to what happens inCategorical, which makes sense because their functional form is really similar.(2) logpartition is not differentiable for uniform Multinomial distribution. This is because of an optimization in
logsumexpwhich renders it not differentiable byForwardDiff.(3)
prodinvolves a sampling procedure, I did not want to take a dependency onStableRNGsso I used the builtinMersenneTwisterto seed the random number generator.