Expectation, Moment, and Variance
4.2.1Definition and properties
As with discrete random variables, we can define expectation for continuous random variables. The definition is analogous: Just replace the summation with integration.
The expectation of a continuous random variable \(X\) is
(Uniform random variable) Let \(X\) be a continuous random variable with PDF \(f_X(x) = \frac{1}{b-a}\) for \(a \le x \le b\), and \(0\) otherwise. The expectation is
(Exponential random variable) Let \(X\) be a continuous random variable with PDF \(f_X(x) = \lambda e^{-\lambda x}\), for \(x \ge 0\). The expectation is
where the colored step is due to integration by parts.
If a function \(g\) is applied to the random variable \(X\), the expectation can be found using the following theorem.
Let \(g: \Omega \rightarrow \R\) be a function and \(X\) be a continuous random variable. Then
(Uniform random variable) Let \(X\) be a continuous random variable with \(f_X(x) = \frac{1}{b-a}\) for \(a \le x \le b\), and \(0\) otherwise. If \(g(\cdot) = (\cdot)^2\), then
Let \(\Theta\) be a continuous random variable with PDF \(f_{\Theta}(\theta) = \frac{1}{2\pi}\) for \(0 \le \theta \le 2\pi\) and is 0 otherwise. Let \(Y = \cos (\omega t + \Theta)\). Find \(\E[Y]\).
Referring to Eq. (4.4), the function \(g\) is $$g(\theta) = \cos (\omega t + \theta).$$ Therefore, the expectation \(\E[Y]\) is
where the last equality holds because the integral of a sinusoid over one period is 0.
Let \(A \subseteq \Omega\). Let \(\mathbb{I}_{A}(X)\) be an indicator function such that
Find \(\E[\mathbb{I}_{A}(X)]\).
The expectation is
So the probability of \(\{X \in A\}\) can be equivalently represented in terms of expectation.
Is it true that \(\E[1/X] = 1/\E[X]\)?
No. This is because
All the properties of expectation we learned in the discrete case can be translated to the continuous case. Specifically, we have that
- sep0ex
- \(\E[aX] = a\E[X]\): A scalar multiple of a random variable will scale the expectation.
- \(\E[X+a]= \E[X]+a\): Constant addition of a random variable will offset the expectation.
- \(\E[aX+b] = a\E[X]+b\): Affine transformation of a random variable will translate to the expectation.
Prove the above three statements.
The third statement is just the sum of the first two statements, so we just need to show the first two:
4.2.2Existence of expectation
As we discussed in the discrete case, not all random variables have an expectation.
A random variable \(X\) has an expectation if it is absolutely integrable, i.e.,
Being absolutely integrable implies that \(\E[|X|]\) is an upper bound of \(|\E[X]|\).
For any random variable \(X\),
Proof. Note that \(f_X(x) \ge 0\). Therefore,
Thus, integrating all three terms yields
which is equivalent to \(-\E[|X|] \le \E[X] \le \E[|X|]\).
■Here is a random variable whose expectation is undefined. Let \(X\) be a random variable with PDF
This random variable is called the Cauchy random variable. We can show that
The first integral gives
and the second integral gives \(-\infty\). Since neither integral is finite, the expectation is undefined. We can also check the absolute integrability criterion:
where in (a) we use the fact that the function being integrated is even, and in (b) we lower-bound \(\frac{1}{1+x^2} \ge \frac{1}{x^2+x^2}\) if \(x > 1\).
4.2.3Moment and variance
The moment and variance of a continuous random variable can be defined analogously to the moment and variance of a discrete random variable, replacing the summations with integrations.
The \(k\)th moment of a continuous random variable \(X\) is
The variance of a continuous random variable \(X\) is
where \(\mu \bydef \E[X]\).
It is not difficult to show that the variance can also be expressed as
because
(Uniform random variable) Let \(X\) be a continuous random variable with PDF \(f_X(x) = \frac{1}{b-a}\) for \(a \le x \le b\), and \(0\) otherwise. Find \(\Var[X]\).
We have shown that \(\E[X] = \frac{a+b}{2}\) and \(\E[X^2] = \frac{a^2+ab+b^2}{3}\). Therefore, the variance is
(Exponential random variable) Let \(X\) be a continuous random variable with PDF \(f_X(x) = \lambda e^{-\lambda x}\) for \(x \ge 0\), and \(0\) otherwise. Find \(\Var[X]\).
We have shown that \(\E[X] = \frac{1}{\lambda}\). The second moment is
Therefore,