I'm only starting to learn statistics.

The definition I've been given for the expected value (expectation) of a continuous random variable X with probability density function (PDF) $f_X$ is the following

$$ E[X] = \int_{-\infty}^{+\infty}f_X(x)xdx $$

Despite only beginning stats, I've already stumbled many times on the use of a property that was not explicited and that I don't find any explanation for. I don't know the exact conditions of application of this property, but it seems that $E[h(X)]$, where h is a function from $\mathbb{R}$ to $\mathbb{R}$, that, I guess, has to verify some conditions, is often expressed, by some people as:

$$ \int_{-\infty}^{+\infty}h(x)f_X(x)dx $$

For example, in the course I'm following, they define the variance $Var(X)$ as the expectation of $(X - \mu)^2$. All I get from this definition is that if $f_{(X-\mu)^2}$ is the PDF of $(X - \mu)^2$, then

$$ Var(X) = \int_{-\infty}^{+\infty}f_{(X-\mu)^2}(x)xdx $$

Yet, without other explanation, the variance is replaced with the following expression:

$$ Var(X) = \int_{-\infty}^{+\infty}(x-\mu)^2f_X(x)dx $$

during the course. Other example, in this post:


it is written that ($f$ being the PDF of $X$): $$ E[X^2] = \int_{-\infty}^{\infty}{x^2 f(x) dx} $$

Integration is also a work in progress for me at the moment, so probably I'm just missing some basic property of integrals to make this step from $$ \int_{-\infty}^{+\infty}f_{h \circ X}(x)xdx $$ to $$ \int_{-\infty}^{+\infty}h(x)f_X(x)dx $$ But what is the theorem/property that allows to do that and where can I find a proof of it?


This property is sometimes called the law of the unconscious statistician; Wikipedia has some proofs in different settings. You're right that it is not immediately obvious from the original definition.

  • $\begingroup$ Wow, thanks, that's exactly what I was looking for! $\endgroup$ – John Smith Optional Jan 30 at 16:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.