The lifetime $X$ of a device is an exponential random variable with mean = $1/R$. Suppose that due to irregularities in the production process, the parameter $R$ is random and has a gamma distribution.

(a) Find the joint pdf of $X$ and $R$.

(b) Find the pdf of $X$.

(c) Find the mean and variance of $X$.

### Solution

Given that $X$ follows exponential distribution with mean $1/R$.

` $$ \begin{aligned} f_X(x|r) & = r e^{-rx}, x>0 \end{aligned} $$ `

Given that $R$ has a gamma distribution.

` $$ \begin{aligned} f_R(r) & = \frac{\lambda^\alpha}{\Gamma(\alpha)} r^{\alpha-1}e^{-\lambda r}, r>0 \end{aligned} $$ `

(a) The joint pdf of $X$ and $R$ is

` $$ \begin{aligned} f_{X,R}(x,r) & = f_X(x|r) f_R(r)\\ &= r e^{-rx}\frac{\lambda^\alpha}{\Gamma(\alpha)} r^{\alpha-1}e^{-\lambda r}\\ &=\frac{\lambda^\alpha}{\Gamma(\alpha)} r^{\alpha}e^{-(\lambda+x) r} \end{aligned} $$ `

(b) The pdf of $X$ is

` $$ \begin{aligned} f_{X}(x) & =\int_0^\infty f_{X,R}(x,r)\; dr\\ &=\int_0^\infty\frac{\lambda^\alpha}{\Gamma(\alpha)} r^{\alpha}e^{-(\lambda+x) r}\; dr\\ &=\frac{\lambda^\alpha}{\Gamma(\alpha)}\int_0^\infty r^{\alpha+1-1}e^{-(\lambda+x) r}\; dr\\ &= \frac{\lambda^\alpha}{\Gamma(\alpha)}\frac{\Gamma(\alpha+1)}{(\lambda+x)^{\alpha+1}}\\ &= \frac{\lambda^\alpha}{\Gamma(\alpha)}\frac{\alpha\Gamma(\alpha)}{(\lambda+x)^{\alpha+1}}\\ &= \frac{\alpha\lambda^\alpha}{(\lambda+x)^{\alpha+1}}, x>0 \end{aligned} $$ `

(c) The mean of $X$ is $E(X)$.

` $$ \begin{aligned} E(X) & =E[E(X|Y)]\\ &= E[1/R]\\ &= \int_0^\infty (1/r) f_{R}(r)\; dr\\ &=\frac{\lambda^\alpha}{\Gamma(\alpha)}\int_0^\infty r^{\alpha-1-1}e^{-\lambda r}\; dr\\ &=\frac{\lambda^\alpha}{\Gamma(\alpha)}\frac{\Gamma(\alpha-1)}{\lambda^{\alpha-1}}\\ &=\frac{\lambda}{(\alpha-1)\Gamma(\alpha-1)}\Gamma(\alpha-1)\\ &=\frac{\lambda}{(\alpha-1)}, \alpha>1 \end{aligned} $$ `

` $$ \begin{aligned} V(X) & =V[E(X|Y)]+E[V(X|Y)]\\ &= V[1/R]+E[1/R^2]\\ &= E[1/R^2]- [E(1/R)]^2 + E[1/R^2]\\ &= 2E[1/R^2]- [E(1/R)]^2 \\ &= 2\int_0^\infty (1/r^2) f_{R}(r)\; dr+\bigg[\frac{\lambda}{(\alpha-1)}\bigg]^2 \\ &=2\frac{\lambda^\alpha}{\Gamma(\alpha)}\int_0^\infty r^{\alpha-2-1}e^{-\lambda r}\; dr+\frac{\lambda^2}{(\alpha-1)^2} \\ &=2\frac{\lambda^\alpha}{\Gamma(\alpha)}\frac{\Gamma(\alpha-2)}{\lambda^{\alpha-2}}+\frac{\lambda^2}{(\alpha-1)^2}\\ &=\frac{2\lambda^2}{(\alpha-1)(\alpha-2)\Gamma(\alpha-2)}\Gamma(\alpha-2)+\frac{\lambda^2}{(\alpha-1)^2}\\ &=\frac{2\lambda^2}{(\alpha-1)(\alpha-2)}+\frac{\lambda^2}{(\alpha-1)^2}, \alpha>2\\ &=\frac{\lambda^2\alpha}{(\alpha-1)^2(\alpha-2)}, \alpha>2. \end{aligned} $$ `