# Mean of an Exponential Distribution whose rate parameter is also exponentially distributed

Suppose I have a random variable $$X$$ with an exponential distribution with rate parameter $$\lambda$$. Suppose also that I don’t know the value of $$\lambda$$ but that it will be drawn from another exponential distribution with rate parameter $$K$$. I’m trying to figure out what my expected value for $$X$$ is in terms of $$K$$. The integral as I understand it seems to be $$\int \frac{Ke^{-Kx}}{x}$$

Playing around it seems as though setting $$K = 1$$ gives $$X$$ a mean of the Exponential Integral function $$\mathrm{Ei}(0)$$ (please correct me if this is wrong), but I’m not familiar enough with this function to understand how changing $$K$$ affects this output

In particular, setting $$K = 2$$ seems to yield

$$\int \frac{2e^{-2x}}{x} = 4\int \frac{e^{-2x}}{2x} = 4 \mathrm{Ei}(0)$$

Which intuitively seems wrong as increasing the rate parameter should decrease the mean. Clearly I’m doing something very stupid here but would appreciate pointers! Thanks

• It is not forbidden to use $\LaTeX$, especially for non-newbies. At the link are some tips for usage. Commented Mar 22, 2022 at 15:56
• My bad, will do a better job on formatting in the future. Thanks for the tips/resource! Commented Mar 22, 2022 at 16:03
• The expected value is $E(X) = \int_0^\infty x f(x) dx,$ not $\int f(x)/x dx.$ Commented Mar 22, 2022 at 17:23
• I’m calculating $\int g(x)f(x)$ where $f$ if the pdf and $g$ the mean of an exponential with parameter $x$, which is where the $1/x$ comes from Commented Mar 22, 2022 at 17:49

The expected value can be computed using the law of total expectation. $$X$$ given $$\Lambda=\lambda$$ is distributed as $$\mathrm{Exp}(\lambda)$$ and $$\Lambda$$ is distributed as $$\mathrm{Exp}(K)$$. Since the conditional expecation $$E[X|\Lambda=\lambda] = \frac{1}{\lambda}$$ We obtain
$$E[X] = E[E[X|\Lambda]] = \int_0^\infty \frac{K\mathrm{e}^{-K\lambda}}{\lambda}d\lambda,$$ as the OP noted. The only step left to be made is a variable substitution in the integral $$\mu=K\lambda$$ to obtain
$$E[X] = \int_0^\infty \frac{K\mathrm{e}^{-\mu}}{\mu}d\mu = K\cdot \mathrm{Ei}(0),$$
where $$\mathrm{Ei}(z)$$ is the exponential integral. Thus, $$E[X]$$ is indeed increasing in $$K$$. Loosely speaking, this is because larger $$K$$, means smaller $$\Lambda$$, means larger $$X$$.
• Thank you! I see now my intuition about the “direction” of effect was off. Just a minor confusion on my end though - I don’t see how we directly substitute $𝜇$ into the denominator in the last step since we only have a $λ$ it seems like we need to multiply a $K$ above and below for this, so would the actual effect be quadratic in $K$? Commented Mar 22, 2022 at 17:58
• @Ablation_nation You're welcome! Yes, you can multiply the numerator and denominator with $K$. Recall however that you also need to substitute $d\mu = K d\lambda$, which eliminates one $K$ in the numerator. Commented Mar 22, 2022 at 18:01