Why Calculate Sample Moments?
A data set can be summarized in several ways. Its average describes its location, while moments about the average describe aspects of its spread and shape. Calculating these summaries directly from a short list of observations also provides a useful check on formulas used later in estimation.
This tutorial focuses on two calculations: sample raw moments, formed from powers of the observations, and sample central moments, formed from powers of deviations from the sample mean. Unless stated otherwise, every moment here uses divisor \(n\), the number of observations. No probability distribution is assumed for the worked data sets; they are treated as fixed observed values.
The first raw moment is the sample mean. The first central moment is always zero because positive and negative deviations from the mean sum to zero. The second central moment is the average squared deviation from the mean, using divisor \(n\). It is a descriptive moment; it is not the same quantity as the commonly used sample variance with divisor \(n-1\).
Calculating Moments Directly
For a small data set, a table helps keep powers, sums, and divisors separate. First calculate \(\bar{x}\), then calculate powers of the original observations for raw moments. For central moments, subtract \(\bar{x}\) from each observation before raising the deviations to the required powers.
Worked Example: Raw and Central Moments of Four Observations
A hypothetical analyst records four claim-processing times, in hours: \(1,2,4,5\). Treat these as the complete data set for this calculation, with no probability model assumed. Find the first four raw moments and central moments, and verify the conversions through order four.
Method. Calculate the mean and powers from the original values, then calculate the deviations and their powers. The common mistake to avoid is using the raw second moment as though it were already the central second moment.
The sample size is \(n=4\), and the mean is \[ \bar{x}=\frac{1+2+4+5}{4}=\frac{12}{4}=3. \] The raw moments are \[ m_1'=3,\qquad m_2'=\frac{1+4+16+25}{4}=\frac{46}{4}=11.5, \] \[ m_3'=\frac{1+8+64+125}{4}=\frac{198}{4}=49.5, \qquad m_4'=\frac{1+16+256+625}{4}=\frac{898}{4}=224.5. \]
The deviations from \(3\) are \(-2,-1,1,2\). Their powers give \[ m_1=\frac{-2-1+1+2}{4}=0,\qquad m_2=\frac{4+1+1+4}{4}=\frac{10}{4}=2.5, \] \[ m_3=\frac{-8-1+1+8}{4}=0,\qquad m_4=\frac{16+1+1+16}{4}=\frac{34}{4}=8.5. \]
As a check, the second central moment from raw moments is \(11.5-3^2=2.5\). The third is \(49.5-3(3)(11.5)+2(3^3)=49.5-103.5+54=0\). The fourth is \(224.5-4(3)(49.5)+6(3^2)(11.5)-3(3^4)=224.5-594+621-243=8.5\). Each conversion agrees with the direct calculation.
Converting Raw Moments to Central Moments
The conversion follows by expanding the power of a deviation. For any positive integer \(r\), the binomial theorem gives a sum of terms involving powers of \(x_i\) and \(\bar{x}\). Averaging across the observations replaces each average power of \(x_i\) by its raw moment.
Write \((x_i-\bar{x})^r\) using the binomial theorem.
The average of \(x_i^j\) over the data is \(m_j'\), and \(\bar{x}\) is constant across observations.
Substitute \(\bar{x}=m_1'\), then combine terms. This yields the stated conversion formulas.
For example, at order two the expansion is \((x_i-\bar{x})^2=x_i^2-2\bar{x}x_i+\bar{x}^2\). Averaging gives \(m_2=m_2'-2\bar{x}m_1'+\bar{x}^2\). Since \(m_1'=\bar{x}\), this simplifies to \(m_2=m_2'-(m_1')^2\). The same expansion-and-average argument gives the higher-order formulas.
Worked Example: Converting Through the Fourth Moment
A hypothetical portfolio review uses the five observed values \(0,2,2,6,10\), measured in thousands of dollars. Treat the values as a fixed data set, not as draws from an assumed distribution. Calculate the raw moments through order four and use them to find the central moments through order four.
Method. Find the raw moments first, then substitute into the conversion formulas. The trap to avoid is dropping the last \( -3(m_1')^4\) term in the fourth-moment conversion.
Here \(n=5\), and \[ \bar{x}=m_1'=\frac{0+2+2+6+10}{5}=\frac{20}{5}=4. \] The raw moments are \[ m_2'=\frac{0+4+4+36+100}{5}=\frac{144}{5}=28.8, \] \[ m_3'=\frac{0+8+8+216+1000}{5}=\frac{1232}{5}=246.4, \] \[ m_4'=\frac{0+16+16+1296+10000}{5}=\frac{11328}{5}=2265.6. \]
The second central moment is \[ m_2=28.8-4^2=28.8-16=12.8. \] The third central moment is \[ m_3=246.4-3(4)(28.8)+2(4^3) =246.4-345.6+128=28.8. \] The fourth central moment is \[ m_4=2265.6-4(4)(246.4)+6(4^2)(28.8)-3(4^4) \] \[ =2265.6-3942.4+2764.8-768=320. \]
Check directly using deviations \(-4,-2,-2,2,6\). Their squared powers sum to \(16+4+4+4+36=64\), so \(m_2=64/5=12.8\). Their cubes sum to \(-64-8-8+8+216=144\), so \(m_3=144/5=28.8\). Their fourth powers sum to \(256+16+16+16+1296=1600\), so \(m_4=1600/5=320\). The direct calculations confirm all three conversions.
Moment Signs and the Divisor Convention
The sign of a central moment depends partly on its order. Squared deviations cannot be negative, so \(m_2\geq 0\). More generally, every even-order central moment is nonnegative. An even-order central moment equals zero exactly when every observation equals \(\bar{x}\), because a sum of nonnegative even powers is zero only if every term is zero. Odd-order central moments can be positive, negative, or zero: observations above and below the mean contribute terms with opposite signs.
This distinction matters when interpreting calculations. A negative third central moment is possible; a negative fourth central moment is not. The sign of an odd central moment reflects the balance of signed deviations raised to that power, but the value alone should not be treated as a complete description of a data set's shape.
Worked Example: Divisor n Versus Divisor n−1
A hypothetical review records values \(3,3,3,9\). Find the second central moment using divisor \(n\), compare it with the variance using divisor \(n-1\), and calculate the third central moment. No distributional assumption is needed for these descriptive calculations.
Method. Center the observations, then keep the two divisors explicit. The common mistake to avoid is silently replacing the requested divisor \(n\) with \(n-1\).
The sample size is \(n=4\), and the mean is \(\bar{x}=(3+3+3+9)/4=18/4=4.5\). The deviations are \(-1.5,-1.5,-1.5,4.5\). Their squared values sum to \[ 3(1.5^2)+4.5^2=3(2.25)+20.25=27. \] Thus the second central moment with divisor \(n\) is \(m_2=27/4=6.75\). The usual variance calculated with divisor \(n-1\) is \(27/3=9\). They differ because they use different divisors, not because one calculation is an alternate way to round the other.
For the third central moment, the cubes of the deviations sum to \[ 3(-1.5^3)+4.5^3=3(-3.375)+91.125=81. \] Therefore \(m_3=81/4=20.25\). The positive sign is consistent with the relatively large positive deviation. As a final check, the second central moment is nonnegative, as required.
Common Mistakes and Practical Checks
Sample moments are straightforward to define, but several small errors can change the answer substantially. Keep the raw and central calculations distinct, and use these checks before accepting a result:
- Using the wrong center. Raw moments use powers of \(x_i\); central moments use powers of \(x_i-\bar{x}\).
- Changing the divisor without saying so. The moments in this tutorial use \(n\). A variance calculated with \(n-1\) is a different quantity.
- Leaving out conversion terms. In particular, the fourth central moment formula includes \(-3(m_1')^4\).
- Misstating the possible signs. Odd-order central moments may have either sign or be zero. Even-order central moments cannot be negative.
- Failing to check the mean. The deviations should sum to zero, and the first central moment should therefore equal zero.
For hand calculations, a compact table with columns for \(x_i\), \(x_i-\bar{x}\), and the required powers can prevent arithmetic from drifting between the raw and centered calculations. If both approaches are manageable, compute a central moment directly and by conversion; agreement is a strong check on the arithmetic.
Check Your Understanding
For each fixed data set, use divisor \(n\) for the moments. The values are observed data; no probability model is assumed.
- For the data \(-1,1,3,5\), find the sample mean and second central moment. (Answer: \(\bar{x}=2,\ m_2=5\))
- For the data \(2,2,5,7\), calculate the second and third central moments directly from deviations from the mean. (Answer: \(\bar{x}=4,\ m_2=4.5,\ m_3=3\))
- For the data \(1,1,1,5\), use the raw moments to find the second and third central moments. (Answer: \(m_1'=2,\ m_2'=7,\ m_3'=32,\ m_2=3,\ m_3=6\))
- For the data \(0,2,4,6,8\), find the second and third central moments. (Answer: \(\bar{x}=4,\ m_2=8,\ m_3=0\))
- For the data \(2,4,4,10\), find the raw second and third moments, then convert to the second and third central moments. (Answer: \(m_2'=34,\ m_3'=284,\ m_2=9,\ m_3=24\))