Calculates the convolution of two distribution via numerical calculations.
Returns an R6 object of class Convolution.
Convolution$new(dist1, dist2, add = TRUE, type = NULL)
Argument | Type | Details |
dist1 |
distribution | First distribution in convolution. |
dist2 |
distribution | Second distribution in convolution. |
add |
logical | Add or subtract distributions. |
type |
logical | Type of new distribution, automated if NULL. |
The convolution of two probability distributions \(X\), \(Y\) is the sum $$Z = X + Y$$ which has a pmf, $$P(Z = z) = \sum_x P(X = x)P(Y = z - x)$$ with an integration analogue for continuous distributions.
Currently distr6 supports the addition of discrete and continuous probability distributions, but only subtraction of continuous distributions.