Shapiro–Wilk Test

From GM-RKB
Jump to navigation Jump to search

A Shapiro–Wilk test is a hypothesis test that checks whether the sample comes from normally distributed population.



References

2016

Theory: The Shapiro–Wilk test utilizes the null hypothesis principle to check whether a sample x1, ..., xn came from a normally distributed population. The test statistic is
[math]\displaystyle{ W = {\left(\sum_{i=1}^n a_i x_{(i)}\right)^2 \over \sum_{i=1}^n (x_i-\overline{x})^2}, }[/math]
where
  • [math]\displaystyle{ x_{(i)} }[/math] (with parentheses enclosing the subscript index i) is the ith order statistic, i.e., the ith-smallest number in the sample;
  • [math]\displaystyle{ \overline{x} = \left( x_1 + \cdots + x_n \right) / n }[/math] is the sample mean;
  • the constants [math]\displaystyle{ a_i }[/math] are given by
[math]\displaystyle{ (a_1,\dots,a_n) = {m^{\mathsf{T}} V^{-1} \over (m^{\mathsf{T}} V^{-1}V^{-1}m)^{1/2}}, }[/math]
where
[math]\displaystyle{ m = (m_1,\dots,m_n)^{\mathsf{T}}\, }[/math]
and [math]\displaystyle{ m_1,\ldots,m_n }[/math] are the expected values of the order statistics of independent and identically distributed random variables sampled from the standard normal distribution, and [math]\displaystyle{ V }[/math] is the covariance matrix of those order statistics.