The sample central moment is defined by $$ m_j = \frac{1}{n} \sum_{i = 1}^{n} \left( x_i - \bar{x} \right)^j %(\#eq:dist-moments-sample-central) $$ where

  • \(n\) is the sample size,

  • \(x = \{x_1 \dots x_n\}\) is a set of values of a random variable \(X\),

  • \(\bar{x}\) is the sample mean of \(x\), and

  • \(j\) is the \(j\)th central moment.

moment(x, j)

Arguments

x

Numeric vector. Sample data.

j

Integer. jth moment. From 0 to 4.

Details

$$ m_0 = \frac{1}{n} \sum_{i = 1}^{n} \left( x_i - \bar{x} \right)^0 = \frac{1}{n} \sum_{i = 1}^{n} \left( 1 \right) = \frac{1}{n} n = \frac{n}{n} = 1 %(\#eq:dist-moments-sample-central-zero) $$

$$ m_1 = \frac{1}{n} \sum_{i = 1}^{n} \left( x_i - \bar{x} \right)^1 = \frac{1}{n} \sum_{i = 1}^{n} \left( 0 \right) = \frac{1}{n} 0 = \frac{0}{n} = 0 %(\#eq:dist-moments-sample-central-first) $$

$$ m_2 = \frac{1}{n} \sum_{i = 1}^{n} \left( x_i - \bar{x} \right)^2 %(\#eq:dist-moments-sample-central-second) $$

$$ m_3 = \frac{1}{n} \sum_{i = 1}^{n} \left( x_i - \bar{x} \right)^3 %(\#eq:dist-moments-sample-central-third) $$

$$ m_4 = \frac{1}{n} \sum_{i = 1}^{n} \left( x_i - \bar{x} \right)^4 %(\#eq:dist-moments-sample-central-fourth) $$

  • The "zeroth" central moment is 1.

  • The first central moment is 0.

  • The second cental moment is the variance.

  • The third central moment is used to define skewness.

  • The fourth central moment is used to define kurtosis.

References

Wikipedia: Central Moment

Wikipedia: Standardized Moment

See also

Other moments functions: cumulant(), kurt(), moments(), skew()