Variance is a measure of dispersion. It is equal to the average squared distance of the realizations of a random variable from its expected value.
A formal definition of variance follows.
Definition
Let
be a random variable. Denote the expected value operator by
. The
variance of
is
provided
the expected values in the formula exist.
To better understand the definition of variance, we can break up its calculation in several steps:
compute the expected value of
,
denoted
by
construct a new random variable
equal
to the deviation of
from its expected value;
take the
square
which is a measure of distance of
from its expected value (the further
is from
,
the larger
);
finally, compute the expectation of
to know the average distance:
From these steps we can easily see that:
variance is always positive because it is the expected value of a squared number;
the variance of a constant variable
(i.e., a variable that always takes on the same value) is zero; in this case,
we have that
,
and
;
the larger the distance
is on average, the higher the variance.
Variance can also be equivalently defined by the following important
formula:
This formula also makes clear that variance exists and is well-defined only as
long as
and
exist and are well-defined.
We will use this formula very often and we will refer to it, for brevity's sake, as variance formula.
The following example shows how to compute the variance of a discrete random variable using both the definition and the variance formula above.
Example
Let
be a discrete random
variable with
support
and probability mass
function
where
.
Its expected value
is
The
expected value of its square
is
Its
variance
is
Alternatively,
we can compute the variance of
using the definition. Define a new random variable, the squared deviation of
from
,
as
The
support of
is
and its probability mass function
is
The
variance of
equals the expected value of
:
The exercises at the bottom of this page provide more examples of how variance is computed.
The following subsections contain more details on variance.
The square root of variance is called standard deviation. The
standard deviation of a random variable
is usually denoted by
or by
:
Let
be a constant and let
be a random variable.
Then,
Thanks to the fact that
(by linearity of the expected value), we
have
Let
be a constant and let
be a random variable.
Then,
Thanks to the fact that
(by linearity of the expected value), we
obtain
Let
be two constants and let
be a random variable. Then, combining the two properties above, one
obtains
If
exists and is finite, we say that
is a square integrable random variable, or just that
is square integrable. It can easily be proved that, if
is square integrable then
is also integrable,
that is,
exists and is finite. Therefore, if
is square integrable, then, obviously, also its variance
exists and is finite.
Below you can find some exercises with explained solutions.
Let
be a discrete random variable with support
and probability mass
function
Compute
its variance.
The expected value of
is
The
expected value of
is
The
variance of
is
Let
be a discrete random variable with support
and probability mass
function
Compute
its variance.
The expected value of
is
The
expected value of
is
The
variance of
is
Read and try to understand how the variance of a Poisson random variable is derived in the lecture entitled Poisson distribution.
Let
be a continuous random variable with support
and
probability density
function
Compute
its variance.
The expected value of
is
The
expected value of
is
The
variance of
is
Let
be a continuous random variable with support
and
probability density
function
Compute
its variance.
The expected value of
is
The
expected value of
is
The
variance of
is
Read and try to understand how the variance of a Chi-square random variable is derived in the lecture entitled Chi-square distribution.
Please cite as:
Taboga, Marco (2021). "Variance", Lectures on probability theory and mathematical statistics. Kindle Direct Publishing. Online appendix. https://www.statlect.com/fundamentals-of-probability/variance.
Most of the learning materials found on this website are now available in a traditional textbook format.