Expected values summarize the position of a distribution on the number line with a central value. Often it is important to summarize both the position and the spread in a distribution. In terms of a random variable, we often want to return some best prediction (e.g. an expected value) plus or minus some anticipated degree of variation.
This chapter will focus on variance and standard deviation. Standard deviation and variance both measure the degree of variability in a random variable. Equivalently, they are summary measures of the “breadth”, “width”, or “spread” in a distribution.
Definition¶
To summarize the spread in a distribution, we will start by centering it.
Centering is often this first step in standardizing a random variable.
Next, we will try to measure the average deviation in by measuring the average size of . If is typically small, then most samples are near the expected value, so the distribution can’t spread much. If, on the other hand, is typically large, then most samples are far from their expected value, so the distribution must be very broad.
To measure the average deviation, we could try . To keep our notation concise, let . Then:
Next, by the translation property (linearity) of expectation:
So, the expected value of is always zero. This is not a surprise, since was a centered variable.
To measure the average size of , we should find the expected value of some function of , , chosen so that is nonnegative and monotonically increasing the farther is from 0. We want to use a nonnegative function since size is commonly understood, like distance, or length, to be nonnegative. Moreover, when measuring variability, we don’t want positive and negative deviations to cancel out.
The most natural choice would be to measure the expected absolute deviation:
Most statisticians select a related measure. Instead of averaging the asbsolute deviation, it is common practice to average the squared deviation, then correct the square with a square root outside the expectation. These two steps define the variance and the standard deviation:
Notice, if has unit , then variance has units . For instance, if is the price of an investment, then has unit of not The standard deviation has units . For this reason, it is really the standard deviation, not the variance, that measures the spread, or variability, in .
The variance is related to the spread, or variability, in through its relation to the standard deviation. Large variances indicate large standard deviations. Since the variance is an expected square, it’s value alone is often hard to interpret and is easy to misread.
The standard deviation and mean absolute deviation are differ. In particular:
The middle inequality is Jensen’s inequality applied to the square root. Square roots are concave functions, so expected roots are less than or equal to the square root of an expectation.
The mean absolute deviation and standard deviation differ since the standard deviation averages squared deviations. As a result, it is much more sensitive to large deviations, and discounts small deviations.
Given an expectation and a standard deviation, it is common practice to standardize a random variable.
Notice, a random variable, and its standardization, are related by a linear transformation. Often, we will define distribution families by first posing some model for a standard variable, , then by allowing for any choice of and . The choice of assigns the distribution a central location. The choice of selects its variability, or spread, about that central location. This is why we focused on linear transformations of the inputs and outputs to functions in Section 3.2.
While standard deviations provide direct measures of spread, we will focus our study on variances. It is easy to compute standard deviations from variances, and variances have stronger algebraic properties, so are more convenient to work with.
Rules of Variance¶
Like expectations, variances are popular summaries since they admit obey convenient rules. These rules make it possible to break problems down into simpler parts. We won’t cover too many rules in this chapter. Instead, we’ll just check the rules associated with linear transformations:
Constants: If then .
So, the variance of a constant is zero.
Nonnegativity: and equals zero if and only if for some constant .
Variance is nonnegative by construction. Variance is an expected square, and all squares are nonnegative. The average of a series of nonnegative quantities is itself nonnegative.
The variance of a constant is always zero. If the variance is zero, then the random variable is equal to a constant. This is natural, the random variable doesn’t vary if its variance is zero.
Translation: Given any ,
So, the variance after a translation is the variance before the translation. This is an entirely sensible rule. Variances are associated to the spread, or width, of a distribution. The spread, or width, are unchanged by translating the distribution.
It follows that:
Scaling: Given any ,
Proof: Just apply the definition, then use rules of expectation from Section 4.2:
So, the variance after a scaling is the variance before the scaling, multiplied by the scaling squared.
It follows that:
Computing Variances¶
Formally, the variance is the expected value of the nonnegative random variable . So, when is discrete:
When is continuous:
We’ll often work with a formula that breaks the variance into simpler parts.
Proof: As usual, start from the definition, expand, then apply properties of expectation:
Then, by the additivity of expectation:
Then, since is a constant, we can use linearity to pull all constants outside the expectations:
Finally, since :
So, the variance in is the expected square, , minus the squared expectation, .
If you get stuck trying to compute a variance, this is often the first formula you should try next. In many cases it is easier to evaluate and than it is to evaluate directly.
Other Moments¶
So far we’ve seen two summaries based on expectations. These are each examples of the moments of a distribution.
The raw moments are expectations of the kind for various integers . The first raw moment is the expected value since returns .
The central moments are the raw moments of the centered variable. These are expectations of the kind for various integers . The second central moment is the variance. Central moments can always be recovered from linear combinations of raw moments like we saw above.
Higher order central moments have been used to define other shape summaries. For example, the third central moment is commonly used as a measure of the skew in a distribution, and the fourth central moment is used to check whether the distribution is “bell shaped” in the same fashion as the famous “normal” distribution.