Distributions.jl icon indicating copy to clipboard operation
Distributions.jl copied to clipboard

Add convolve for DiscreteNonParametric

Open iampritishpatil opened this issue 2 years ago • 3 comments

DiscreteNonParametric convolution has a very nice trivial closed form. It was not implemented.

This pull request implements it.

iampritishpatil avatar Mar 22 '22 15:03 iampritishpatil

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.

iampritishpatil avatar Mar 23 '22 09:03 iampritishpatil

Codecov Report

Merging #1523 (f85407a) into master (1c44a2a) will increase coverage by 0.02%. The diff coverage is 100.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.

codecov-commenter avatar Mar 25 '22 22:03 codecov-commenter

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!

mharradon avatar Apr 13 '24 17:04 mharradon