Distributions.jl
Distributions.jl copied to clipboard
Add convolve for DiscreteNonParametric
DiscreteNonParametric convolution has a very nice trivial closed form. It was not implemented.
This pull request implements it.
Thanks for the suggestions, they were, all on the point.
I think I addressed all of it. If I run into any more floating-point tricky cases, I'll add them, but as far as I can tell, it shouldn't cause errors, apart from any unexpected compiler optimization which causes different things to happen in the two loops.
Let me know if anything more is needed.
Codecov Report
Merging #1523 (f85407a) into master (1c44a2a) will increase coverage by
0.02%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #1523 +/- ##
==========================================
+ Coverage 85.45% 85.47% +0.02%
==========================================
Files 128 128
Lines 7818 7829 +11
==========================================
+ Hits 6681 6692 +11
Misses 1137 1137
Impacted Files | Coverage Δ | |
---|---|---|
src/convolution.jl | 100.00% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 1c44a2a...f85407a. Read the comment docs.
I think this would be a nice PR to merge. I implemented the latest suggestions from @devmotion and PR'd at #1850. Happy to either see this PR fixed up or merge that.
Thank you!