Calculates the convolution of two distribution via numerical calculations.
# S3 method for class 'Distribution'
x + y
# S3 method for class 'Distribution'
x - y
Returns an R6 object of class Convolution.
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.
distr6::Distribution
-> distr6::DistributionWrapper
-> Convolution
Inherited methods
distr6::Distribution$cdf()
distr6::Distribution$confidence()
distr6::Distribution$correlation()
distr6::Distribution$getParameterValue()
distr6::Distribution$iqr()
distr6::Distribution$liesInSupport()
distr6::Distribution$liesInType()
distr6::Distribution$median()
distr6::Distribution$parameters()
distr6::Distribution$pdf()
distr6::Distribution$prec()
distr6::Distribution$print()
distr6::Distribution$quantile()
distr6::Distribution$rand()
distr6::Distribution$setParameterValue()
distr6::Distribution$stdev()
distr6::Distribution$strprint()
distr6::Distribution$summary()
distr6::Distribution$workingSupport()
distr6::DistributionWrapper$wrappedModels()
new()
Creates a new instance of this R6 class.
Convolution$new(dist1, dist2, add = TRUE)
dist1
([Distribution])
First Distribution in convolution, i.e. dist1 ± dist2
.
dist2
([Distribution])
Second Distribution in convolution, i.e. dist1 ± dist2
.
add
(logical(1))
If TRUE
(default) then adds the distributions together, otherwise substracts.