# Joint probability of sum of $n$ random variables with exponential distribution

Regards. I would like to ask some view on this.

If it is known that random variables $X_{i}$, $i=1,2,..,$ are independent and each has exponential distribution with mean $\theta$. The sum of the random variables $X= X{1} + X_{2} + .... + X_{n}$, has gamma distribution : $$f(x) = \frac{x^{n-1} e^{-x/\theta}}{(n-1)! \: \theta^{n}}$$

Now if the number of summation $n$ has Poisson distribution with df $g(n)$ and mean $\mu=1$, and $N$ and all the $X_{i}$'s are independent of each other , i would write the pdf of the random variable $S= X_{1} + X_{2} + ..... + X_{N}$ as below :

\begin{align*} P(S=x) &= \sum_{n} f_{n}(x) \times g(n) \\ &= \sum_{n} \frac{x^{n-1} e^{-x/\theta}}{(n-1)! \: \theta^{n}} \times \frac{e^{-1}}{n!} \\ &= e^{-x/\theta}( x \: e)^{-1} \sum_{n} \frac{(x/ \theta)^{n}}{(n-1)! \: n!} \end{align*} The form in the summation does not have exact form, according to The sum of power series with denominators $n!(n+1)!$

This is to calculate the mgf of $S$. Without paying attention the simplest form of the sum, i integrate by mgf wrt $x$ and calculate $M_{S}(1)=3$, and found value of $\theta$ does not fit with a reference. Does this probability distribution incorrect?

*($M_{S}(1)$ does refer to mgf at point $1$ right?)

Thanks.

• I don't think your "$P(S=x)$" as any sense : $S$ is a continuous random variable, all you can obtain is it's density function. But I don't know how to do this... – Nicolas FRANCOIS Apr 11 '17 at 12:05
• $P(S = x) = P\bigl(\sum_{i = 1}^N X_i = x\bigr)$. As you may note here, and as @NicolasFRANCOIS points out, that is a zero probability since the $X_i$'s are continuous. What you could look at is instead "$\leq$" for example. Is that what you want? – Therkel Apr 11 '17 at 12:11
• Also, what you have here is a compound Poisson distribution. – Therkel Apr 11 '17 at 12:12
• Regards @Nicolas. The $P(S=x)$ is the distribution function. The $f(x)$ is continuous distribution, Gamma distribution. The rand.variable $S$ depends on $N$. – Arief Anbiya Apr 11 '17 at 12:15
• Yeah, we understand that. What you have to do is compute $P(S\le x)$, and differentiate wrt $x$, to obtain the density function. That is, if I understand correctly what you are trying to acheive... – Nicolas FRANCOIS Apr 11 '17 at 12:20

If $N$, the number of exponential random variables in the sum, is independent of the sequence of random variables $\{X_i\}$ and is Poisson distributed then

$$S = \sum_{n = 1}^N X_n$$ is called a compound Poisson distributed random variable. Calculating the distribution function or the density function of such random variable can be quite nasty. Fortunately you can avoid that if you are looking for the moment generating function!

Here is a hint: to calculate the moment generating function of $S$, use the independence in a towering argument. That is,

$$M_S(x) = E\left[e^{xS}\right] = E\left[e^{x\sum_{n = 1}^N X_i}\right] = E\Bigl[E\left[ e^{xNX_1} \mid N \right]\Bigr] = E\left[E\left[e^{xX_1} \right]^N\right]$$

Can you take it from here?

• Thanks @Therkel. I would like to correct my argument. $f(x)$ is actually the average of all the probability in the very small interval $[x,x+\triangle x)$, or in the limit $\triangle x$ goes zero. $$f(x) = \lim \frac{P(x <X <x+\triangle x)}{\triangle x}$$ This is true when $P(x <X <x+\triangle x) = F(x + \triangle x)- F(x) = \int_{x}^{x+\triangle x} f(x) \: dx$. So it should be to find the pdf through the cdf. – Arief Anbiya Apr 11 '17 at 16:02

This is what I found, noting $F_n$ the cumulative distribution function of $S_n=X_1+\dots+X_n$ : \begin{align*} P(S\le x) &= \sum_{n\in\mathbb N^\ast} P(S\le x \cap N=n) \\ &= \sum_{n\in\mathbb N^\ast} F_n(x)P(N=n) \\ &= \frac1e\sum_{n\in\mathbb N^\ast} \frac{1}{n!} \int_0^x f_n(t)\,dt \\ &= \frac1e\sum_{n\in\mathbb N^\ast} \frac{1}{(n-1)!n!\theta^n} \int_0^x t^{n-1}e^{-t/\theta}\,dt \end{align*} Now you have to compute the integral. By induction, I found : $$\int_0^x t^{n-1}e^{-t/\theta}\,dt = (n-1)!\theta^n\left[ 1-e^{-x/\theta} \sum_{k=1}^{n-1} \frac{(x/\theta)^k}{k!}\right]$$ So $$P(S\le x) = \frac1e\sum_{n\in\mathbb N^\ast} \frac{1}{n!}\left[ 1-e^{-x/\theta} \sum_{k=1}^{n-1} \frac{(x/\theta)^k}{k!}\right]$$ Now I differentiate wrt $x$, obtaining the density function of $S_N$ : $$f(x)=\frac1e\sum_{n\in\mathbb N^\ast} \frac{e^{-x/\theta}}{n!\,\theta} \left[\frac{(x/\theta)^{n-1}}{(n-1)!}-1\right]$$ I'm quite sure there must be about a dozen mistakes in my computations, but it may be a good basis for the right solution :-)

• $\mathbb N^\ast=\mathbb N\setminus\{0\} = \{1,2,3,\dots\}$. – Nicolas FRANCOIS Apr 11 '17 at 13:10
• But $P(N = 0) > 0$. Aren't you calculating $S\mid N>0$? – Therkel Apr 11 '17 at 13:13
• Yeah, sorry, I confused Poisson distribution with geometric distribution... I'll correct this. – Nicolas FRANCOIS Apr 11 '17 at 13:14
• Just some trouble : with $N=0$, the sum cancels, doesn't it ? – Nicolas FRANCOIS Apr 11 '17 at 13:15
• Correct. $P(S\leq x\mid N = 0) = 1$ for $x>0$. – Therkel Apr 11 '17 at 13:16