You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import Distributions: convolve, MixtureModel
# special case: https://mathoverflow.net/questions/370982/convolution-of-two-gaussian-mixture-model
Distributions.convolve(d1::MixtureModel,d2::Normal) =MixtureModel([convolve(c,d2) for c in d1.components],d1.prior)
Distributions.convolve(d1::Normal,d2::MixtureModel) =convolve(d2,d1)
d3 =convolve(d1,d2)
using Test
@testvar(d3.components[1]) ≈2@testvar(d3.components[2]) ≈2@testmean(d3.components[1]) ≈-2@testmean(d3.components[2]) ≈2@testconvolve(d1,d2) ==convolve(d2,d1)
I can easily made a PR with the test case.
The text was updated successfully, but these errors were encountered:
It would be nice to allow the convolution between Gaussian mixture model and normal distribution, for example:
Currently, this fails with:
Support for this would be quite easy to add:
I can easily made a PR with the test case.
The text was updated successfully, but these errors were encountered: