I would like to know how to compute a probability function of a convolution of Negative Binomial distribution with Maple.
Here is an easy example of what I want to do : '
With(Statistics):
X[1]:=RandomVariable(NegativeBinomial(2,0.5)):
X[2]:=RandomVariable(NegativeBinomial(6,0.3)):
S:=X[1]+X[2]:
ProbabilityFunction(S,0);
If I ask for the Mean, it works fine with Mean(S) but when I ask for the Probability Function, Maple gives me "FAIL" as answer.
Thank you!
Jean-Philippe
I am not really sure how to compute this with Maple, but here is how to get it in closed form.
Recall that the negative binomial distribution with parameters $n$ and $p$ has the following simple probability generating function: $$ \mathcal{P}_X\left(z\right) = \left( \frac{p}{1-(1-p)z} \right)^n $$ And that the probability generating function for the sum of two independent random variables $X_1+X_2$ is a product of individual generating functions: $$ \mathcal{P}_{X_1+X_2}(z) = \left( \frac{p_1}{1-(1-p_1)z} \right)^{n_1} \left( \frac{p_2}{1-(1-p_2)z} \right)^{n_2} $$ The probability mass function for $X_1+X_2$ is then read off as a series coefficient of PGF: $$ \mathbb{P}\left(X_1+X_2 = n\right) = [z^n] \mathcal{P}_{X_1+X_2}(z) $$ In particular: $$ \mathbb{P}\left(X_1+X_2=0\right) = p_1^{n_1} p_2^{n_2} = \mathbb{P}\left(X_1=0\right) \mathbb{P}\left(X_2=0\right) $$
By the way, here is what Mathematica gives for your problem:
Compare with the series coefficient: