how to derive the expected value and variance of this exponential distribution

539 Views Asked by At

I'm new to probability and I'm stucking with this problem. Let $X$ be a continuous random variable following a pdf $$p(x|\theta)=\frac{\theta}{2}\exp(-\theta |x-\mu|)$$ Then, how can I calculate the expectation $E_p [X]=\int_{-\infty}^{\infty}xp(x|\theta)dx$ and variance $V_p[X]=\int_{-\infty}^{\infty}(x-E_p[X])^2p(x|\theta)dx$ of $X$? Thank you in advance.

edit:[my attempt]

Let $u=x-\mu$, $$\operatorname{E}[X]=\frac{\theta}{2}\int_{-\infty}^\infty u\ e^{-\theta |u|}\ du+\mu$$ $$=\frac{\theta}{2}\int_{-\infty}^0 u\ e^{\theta u}\ du + \frac{\theta}{2}\int_0 ^{\infty} u\ e^{-\theta u}\ du +\mu $$ $$=-\frac{\theta}{2}\int^{\infty}_0 u\ e^{-\theta u}\ du + \frac{\theta}{2}\int_0 ^{\infty} u\ e^{-\theta u}\ du +\mu $$ $$=\mu$$ and $$E[X^2]=E[(U+\mu)^2]=E[U^2]+2\mu E[U]+\mu^2= E[U^2]+2\mu E[x-\mu]+\mu^2$$ $$=\frac{\theta}{2} \int_{-\infty}^{\infty}u^2e^{-\theta |u|}du + \mu^2$$ $$=\frac{\theta}{2} \int_{-\infty}^{0}u^2e^{\theta u}du + \frac{\theta}{2} \int_{0}^{\infty}u^2e^{-\theta u}du + \mu^2$$ $$=\frac{\theta}{2} \int_{0}^{\infty}u^2e^{-\theta u}du + \frac{\theta}{2} \int_{0}^{\infty}u^2e^{-\theta u}du + \mu^2$$ $$=\theta \int_0 ^{\infty}u^2e^{-\theta u}du+\mu^2$$ $$=\frac{2}{\theta^2}+\mu^2$$ Thus $$V[X]=E[X^2]-(E[X])^2= \frac{2}{\theta^2}$$ Is this correct?

1

There are 1 best solutions below

0
On BEST ANSWER

You can sidestep dealing with $\mu$ entirely by recognizing that for any random variable $Z$ and constant $\mu$, $$\operatorname{E}[Z + \mu] = \operatorname{E}[Z] + \mu$$ and $$\operatorname{Var}[Z + \mu] = \operatorname{Var}[Z],$$ the latter being a straightforward exercise to show. Therefore once we obtain the expectation and variance for the case $\mu = 0$, we also get these moments for the general case. In particular, let $Z$ be a random variable with density $$f_Z(z \mid \theta) = \frac{\theta}{2}e^{-\theta |z|}, \quad -\infty < z < \infty$$ so that $$X = Z + \mu$$ gives $$f_X(x) = f_Z(x - \mu) \left|\frac{d}{dx}[x - \mu]\right| = f_Z(x - \mu) = \frac{\theta}{2} e^{-\theta|x - \mu|}, \quad -\infty < x < \infty.$$

Now the integration easily proceeds via symmetry: $$\operatorname{E}[Z] = \int_{z=-\infty}^\infty z \cdot \frac{\theta}{2} e^{-\theta |z|} \, dz = 0$$ since $z f_Z(z)$ is an odd function satisfying $$-z f_Z(-z) = -(z f_Z(z)).$$ The variance is now straightforward because the integrand is an even function: $$\operatorname{Var}[Z] = \int_{z=-\infty}^\infty (z - 0)^2 \frac{\theta}{2} e^{-\theta |z|} \, dz = 2 \cdot \frac{\theta}{2} \int_{z=0}^\infty z^2 e^{-\theta|z|} \, dz = \theta \int_{z=0}^\infty z^2 e^{-\theta z} \, dz = \frac{2}{\theta^2},$$ from which it follows that $\operatorname{E}[X] = 0 + \mu = \mu$ and $\operatorname{Var}[X] = \operatorname{Var}[Z] = 2/\theta^2$.