Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix add wishart wishartfast prod #217

Merged
merged 5 commits into from
Oct 24, 2024
Merged

Conversation

Nimrais
Copy link
Member

@Nimrais Nimrais commented Oct 24, 2024

This PR addresses two issues:

#192: Missing product definition between Wishart and WishartFast
#216: ProductOf{InverseWishart, InverseWishartFast} not dispatched correctly

Added product rules for:

  1. Wishart × WishartFast
  2. InverseWishart × InverseWishartFast

The implementation converts the standard distribution to its "Fast" variant before computing the product, since *Fast variants are optimized versions of the same distributions used for messages.

Note: The product between two standard Wishart distributions is postponed until we have a specific model requiring this functionality.

@wouterwln
Copy link
Member

Looks like you beat me to it. Will this not break if Wishart or InverseWishart is on the right side instead of left? And can you add tests for InverseWishart too?

@Nimrais
Copy link
Member Author

Nimrais commented Oct 24, 2024

Ah hoped that you already have tests, yeah I will do.

@Nimrais
Copy link
Member Author

Nimrais commented Oct 24, 2024

Will this not break if Wishart or InverseWishart is on the right side instead of left?

not it does not - I have test for this. In bayes base we check if there is a rule if we will swap the arguments.

@wouterwln
Copy link
Member

Perfect. Poke me if you're done, I will review and merge.

@wouterwln wouterwln merged commit 5fe84b4 into main Oct 24, 2024
2 checks passed
@wouterwln wouterwln deleted the fix-wishart-wishartfast-prod branch October 24, 2024 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants