ReactiveBayes / ExponentialFamily.jl

ExponentialFamily.jl is a Julia package that extends the functionality of Distributions.jl by providing a collection of exponential family distributions and customized implementations.
https://reactivebayes.github.io/ExponentialFamily.jl/
MIT License
12 stars 2 forks source link

Add MvNormalMeanScalePrecision distribution #206

Open albertpod opened 3 weeks ago

albertpod commented 3 weeks ago

This PR was initially aimed at addressing https://github.com/ReactiveBayes/ReactiveMP.jl/issues/387, which it still does. The distribution in question is parametrized by the mean and scale parameter of the precision matrix.

Initially, I implemented it as part of the MultivariateNormalDistributionsFamily. However, the conversions between MvNormalMeanScalePrecision and other distributions in this "class" don't always hold.

During the process, @Nimrais suggested that this distribution could be particularly interesting for ExponentialFamilyProjections.jl. To make it more useful, we need to optimize methods related to the computation of the Fisher information matrix. I made a first attempt to improve performance by modifying the computation of kron(invη2, invη2). I believe further improvements are possible, but this serves as a starting point.

Any suggestions for additional optimizations to enhance the distribution's effectiveness are much welcome.

UPD: I added the piece of code that actually fixes the https://github.com/ReactiveBayes/ReactiveMP.jl/issues/387

albertpod commented 1 week ago

ping @Nimrais