Expected value of a continuous variable $X$

878 Views Asked by At

Let $X$ be a continuous variable and let $f$ be the probability density function. $f$ is defined on : $[a, b]$ such that : $$\int_{a}^{b} f(x) \, \mathrm{d}x = 1$$

Then my lesson says that : $E(X) = \int_{a}^{b} xf(x) \, \mathrm{d}x$

Even if it seems like there is a big link with the expected value of a discrete random variable I don't understand this formula.

That's why intuitively according to me it should be : $$E(X) = \sum x \cdot \int_{a}^{x} f(x)\, \mathrm{d}x$$

So, can someone explains where I am wrong or maybe explain the first formula of the expected value (a demonstration would be nice).

2

There are 2 best solutions below

0
On

Let's start with the arithmetic mean. The arithmetic mean is just all the numbers averaged. That is, each number is equal in weight.

Now, we look into weighted means. Let's say we have a table of probabilities of a rigged dice.

enter image description here

We have the weighted average, which is basically taking each number x its weight. So we have $\displaystyle \sum_{n=1}^6Px=1(0.05)+2(0.1)+3(0.15)+4(0.2)+5(0.3)+6(0.2)=4.2$.


I hope you see where I'm going with this.

Now, as the subintervals get even smaller and smaller, we have that $X$ becomes a continuous random variable.


Notice, as we break into smaller and smaller pieces, we would now have something like, the probability of $1.1$ is $0.01$, the probability of $1.2$ is $0.015$.. etc. So we have small probabilities, and more numbers to weight.


Finally as you could probably tell, this leads to the expected value, or mean, being the integral of the product of the probability (density) function and the variable.

This would be $\displaystyle \int_a^b xf(x)\,dx$.

1
On

Expected value can be viewed as weighted mean where each value $x$ multiplied by its "weight" $f_X(x)dx$ or $P_X(x)$. Note that if $X \in [a,b]$, then there are uncountable number of possible values, thus writing $\sum x$ is meaningless (unless you define partition of $[a,b]$, multiple it by $f_X(x)$ ant take a limit - then you will get the usual Riemann sum). So, for discrete random variable that takes values in some countable set $\Omega$, the "weighted mean" is $$ EX = \sum_{x \in \Omega}x P_X(x), $$ and for continuous random variable where $X$ takes values in some interval $[a,b]$, you will get $$ \int_{[a,b]}xf_X(x)dx. $$