Skip to main content

Module normality

Module normality 

Source
Expand description

Tests of normality, following scipy.stats: Shapiro-Wilk (shapiro, Royston’s algorithm AS R94), Anderson-Darling (anderson_normal), Jarque-Bera (jarque_bera) and D’Agostino and Pearson’s omnibus test (normaltest, from skewtest and kurtosistest).

See the book entry More hypothesis tests.

Structs§

AndersonResult
The result of anderson_normal.

Functions§

anderson_normal
The Anderson-Darling test of normality with estimated mean and standard deviation (SciPy’s anderson(x, 'norm')): A² = −n − Σ (2i − 1)/n [ln Φ(zᵢ) + ln(1 − Φ(z₍ₙ₊₁₋ᵢ₎))], with the Stephens critical values adjusted for n. The null hypothesis is rejected at a level if the statistic exceeds its critical value.
jarque_bera
The Jarque-Bera test: JB = n/6 (S² + K²/4) from the sample skewness S and excess kurtosis K (biased), asymptotically χ² with 2 degrees of freedom (SciPy’s jarque_bera).
kurtosistest
Anscombe and Glynn’s test that the kurtosis is that of a normal distribution (SciPy’s kurtosistest, n ≥ 5).
normaltest
D’Agostino and Pearson’s omnibus test (SciPy’s normaltest): K² = Z_skew² + Z_kurt², approximately χ² with 2 degrees of freedom.
shapiro
The Shapiro-Wilk test (SciPy’s shapiro): W measures how well the ordered sample matches the expected normal order statistics, W = (Σ aᵢ x₍ᵢ₎)² / Σ (xᵢ − x̄)², with Royston’s approximations (AS R94) to the coefficients aᵢ and to the null distribution of ln(1 − W). Valid for 3 ≤ n ≤ 5000.
skewtest
D’Agostino’s test that the skewness is that of a normal distribution (SciPy’s skewtest, n ≥ 8): the sample skewness is transformed to an approximately standard normal Z.