Why is variance formula x^2f(x), not x^2f(x^2)

385 Views Asked by At

The variance formula is $E[X^2]-E[X]^2$ and in the continuous case this means $\int x^2f(x)dx-\mu^2$. This means that $E[X^2]=\int x^2f(x)dx$ which is confusing to me because $E[X]=\int xf(x)$, so I would expect $E[X^2]$ to be $\int x^2f(x^2)$. What am I missing here?

3

There are 3 best solutions below

1
On

$f(x)$ is the so-called PDF (Probability Density Function). However the variable ($X$) changes, the probability density won't change (otherwise you will get another distribution).

Edit: By the way, as the comment points out, the variance formula is $E[X^2]-(E[X])^2$, not the way you wrote it.

0
On

When we look at expected values we multiply each outcome times the probability of that outcome and sum or integrate over all possibilities. We can use the frequency distribution $f(x)$ to find the likelihood of all possible values of $x^2$

Lets look at a simple example:

$f(x) = \begin{cases} \frac 12 & x = 0\\\frac 13 & x = 1\\\frac 16 & x = 2\end{cases}$

That is $X = 0$ with probability $\frac 12, 1$ with probability $\frac {1}{3}, 2$ with probability $\frac 16.$

What is the probability $X^2 = 4$? It is the same as the probability $X = 2$

$E[X^2] = \frac 12 (0^2) + \frac 13 (1^2) + \frac {1}{6}(2^2)$

This example is with discrete probabilities. As we move from discrete probabilities to continuous probabilities summation is replaced with integration.

0
On

To compute the expected value of $X^2$, using the definition of expected value rather than the LOTUS rule, what you would need to do is first find a PDF $g$ for the random variable $X^2$. Then, by the definition of expected value, we would have $E(X^2) = \int x g(x) \, dx$. Now the question is, what is $g$? That is not obvious!

The LOTUS rule saves us from the necessity of finding $g$. According to the LOTUS rule (that is, the "law of the unconscious statistician"), we have $$ E(X^2) = \int x^2 f(x) \, dx $$ where $f$ is a PDF for $X$.