Commit b356da0
Add Convolve for DiscreteNonParametric (Redux) (#1850)
* Add convolve for DiscreteNonParametric
DiscreteNonParametric convolution has a very nice trivial closed form. It was not implemented.
This pull request implements it.
* Update src/convolution.jl
Co-authored-by: David Widmann <[email protected]>
* Use Set, instead of splatting.
Co-authored-by: David Widmann <[email protected]>
* Fix type stability of elements.
Doesn't preserve the type of the Vector, but perhaps this is better ....
Co-authored-by: David Widmann <[email protected]>
* Apply suggestions from code review
use functions to access the support and probabilities, and write as one loop.
Co-authored-by: David Widmann <[email protected]>
* Added a test set.
Removed check args:
We know the convovultion is a proper distribution.
* minor rename for consistency
* Formatting, test improvements suggested by devmotion (and a few more)
* Formatting
---------
Co-authored-by: iampritishpatil <[email protected]>
Co-authored-by: David Widmann <[email protected]>1 parent 6af1e2f commit b356da0
2 files changed
+36
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
50 | 64 | | |
51 | 65 | | |
52 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
69 | 91 | | |
70 | 92 | | |
71 | 93 | | |
| |||
0 commit comments