## Monday, November 10, 2014

### Financial Mathematics: Statistics - Moments

In statistics, there are a variety of calculations referred to as moments. We'll be discussing three types of moments: Raw Moments, Central Moments and Standardized Moments.

#### Raw Moments

Given a random variable, $X$, the $n$th raw moment is defined as the expected value of $X^n$ which looks like this for discrete and continuous random variables, respectively:
\begin{align*} E[X^n] &= \sum_x x^n f(x) \\ E[X^n] &= \int_x x^n f(x)dx \end{align*}
We've already encountered the first raw moment or the mean:
$$\mu = E[X^1] = E[X]$$
Example 1:

Suppose we have two dice and we roll them and add up the sum of the dice. As we previously worked out in Example 1 here, the possible combinations look like this:

So our probability distribution looks like this:
\begin{align*} f(x) = \left\{ \begin{array}{ll} \frac{1}{36} & : x =2\\ \frac{2}{36} &: x = 3 \\ \frac{3}{36} &: x = 4 \\ \frac{4}{36} &: x = 5 \\ \frac{5}{36} &: x = 6 \\ \frac{6}{36} &: x = 7 \\ \frac{5}{36} &: x = 8 \\ \frac{4}{36} &: x = 9 \\ \frac{3}{36} &: x = 10 \\ \frac{2}{36} &: x = 11 \\ \frac{1}{36} &: x = 12 \\ 0 &: \text{otherwise} \end{array} \right\} \end{align*}
Suppose we wanted to find the second raw moment, $E[X^2]$. We would square each dice sum (2, 3, 4, 5, 6, 7, etc) and then multiply by the corresponding probability. The calculation would look like this:
\begin{align*} E[X^2] &= 2^2\frac{1}{36} + 3^2\frac{2}{36} +4^2\frac{3}{36} +5^2\frac{4}{36} +6^2\frac{5}{36} + 7^2\frac{6}{36} +8^2\frac{5}{36} +9^2\frac{4}{36} +10^2\frac{3}{36} +11^2\frac{2}{36} +12^2\frac{1}{36} \\ &\approx 54.833 \end{align*}
Now we noted earlier that expected value is a linear operator. Unfortunately being a linear operator does not enable us to do the following:
$$\require{cancel}\cancel{E[X^2] = E[X]^2}$$
This is occasionally true but in general it is not.

#### Central Moment

Another calculation that is performed is called the central moment. This calculation is similar to the raw moment but it centers the calculation about the mean. The $n$th central moment is defined as $E[(X-\mu)^n]$ and the calculation is given by (for discrete and continuous random variables respectively):
\begin{align*} E[X^n] &= \sum_x (x-\mu)^n f(x) \\ E[X^n] &= \int_x (x-\mu)^n f(x)dx \end{align*}
The $n$th central moment is typically notated as $/mu_n$.

The first central moment is always equal to 0. This can be proven using the fact that expected value is a linear operator:
\begin{align*} \mu_1 = E[(X-\mu)^1] &= E[X - \mu] \\ &= E[X] - E[\mu] \\ &= E[X] - \mu \\ &= \mu - \mu = 0 \end{align*}
Example 2:

We'll use the dice example again. Let's suppose we want to calculate the second central moment. The calculation will look like this (recall that we already found the mean,$\mu$, to be 7):
\begin{align*} E[(X-\mu)^2] &= E[(X - 7)^2] \\ &= (2-7)^2\frac{1}{36} + (3-7)^2\frac{2}{36} +(4-7)^2\frac{3}{36} +(5-7)^2\frac{4}{36} +(6-7)^2\frac{5}{36} + (7-7)^2\frac{6}{36} \\ &\text{ }+(8-7)^2\frac{5}{36} +(9-7)^2\frac{4}{36} +(10-7)^2\frac{3}{36} +(11-7)^2\frac{2}{36} +(12-7)^2\frac{1}{36} \\ &\approx 5.833 \end{align*}
While that calculation looks cumbersome we can actually simplify it a bit if we already know the value of some raw moments. Recall that expected value is a linear operator. We can use some algebra to manipulate the expression (also recall that $E[X]=\mu$):
\begin{align*} E[(X-\mu)^2] &= E[X^2 - 2E[X]\mu + \mu^2] \\ &= E[X^2 - 2E[X]^2 + E[X]^2] \\ &= E[X^2] - E[X]^2 \end{align*}
Example 3:

We'll now rework Example 2, by using the above expression. Recall that $E[X] = 7$ and $E[X^2] \approx 54.833$.
\begin{align*} E[(X-\mu)^2] &= E[X^2] - E[X]^2 \\ &\approx 54.833-7^2 \\ &\approx 5.833 \end{align*}
So if the raw moment has already been calculated, this can be an easier way to work the problem.

It's worth noting that the second central moment ($\mu_2$) is the variance. It's often denoted as $\sigma^2$ where $\sigma$ is the standard deviation. The standard deviation is simply the square root of the variance.

For reference, here are the expanded expressions for the third and fourth central moments:
\begin{align*} E[(X-\mu)^3] &= E[X^3] - 3E[X]E[X^2] + 2E[X]^3 \\ E[(X-\mu)^4] &= E[X^4] - 4E[X]E[X^3] + 6E[X]^2E[X^2] - 3 E[X]^4 \end{align*}

#### Standardized Moment

The $n$th standardized moment is defined as the $n$th central moment divided by standard deviation to the $n$th power:
$$\frac{\mu_n}{\sigma^n}$$
As far as I'm aware there is no notation conventions for this.

Since we've already shown that $\mu_1=0$, it follows that the first standardized moment is also 0.

The second standardized moment is simply 1:
\begin{align*} \frac{\mu_2}{\sigma^2} &= \frac{\sigma^2}{\sigma^2} \\ &= 1 \end{align*}
The third and fourth standardized moments are the definitions for skewness and kurtosis, respectively.

Example 4:

Using the familiar dice example, we'll calculate the third and fourth standardized moments. There are a few ways to do this. I will take the approach first calculating the raw moments.

Now we've already done some calculations. We've found the first raw moment:
$$E(X)=7$$
Likewise, we've already found the second raw moment:
$$E(X^2) \approx 54.833$$
I'll use Google Drive's spreadsheet to calculate the other two: (see here)
\begin{align*} E(X^3)&= 465.5 \\ E(X^4)&=4196.5 \end{align*}
Now we've previously calculated the variance to be $\mu_2 \approx 5.833$. So now we can calculate the third and fourth standardized moments (also done in the spreadsheet).
\begin{align*} \frac{\mu_3}{\sigma^3} &= \frac{E[X^3] - 3E[X]E[X^2] + 2E[X]^3}{\sigma^3} \\ &= \frac{465.5-3*7*54.833+2*7^3}{5.833^{3/2}} \\ &= 0 \\ \frac{\mu_4}{\sigma^4} &= \frac{E[X^4] - 4E[X]E[X^3] + 6E[X]^2E[X^2] - 3 E[X]^4}{\sigma^4} \\ &= \frac{4196.5-4*7*465.5+6*7^2*54.833-3*7^4}{5.833^2} \\ &\approx 2.366 \end{align*}
Now you may get $2.363$ for the fourth standardized moment due to rounding but the $2.366$ (from the spreadsheet) should be more precise.