Skip to main content

Module goodness_of_fit

Module goodness_of_fit 

Source
Expand description

The Cramér-von Mises tests (SciPy’s cramervonmises and cramervonmises_2samp): the integrated squared difference between a sample’s empirical distribution function and a hypothesised one, or between two samples’ empirical distribution functions.

See the book entry Multivariate distributions and further tests.

Enums§

CvmMethod
How cramervonmises_2samp computes its p-value.

Functions§

cramer_von_mises_cdf
The distribution function of ω² for samples of size n (Csörgő and Faraway’s approximation, as SciPy’s _cdf_cvm).
cramer_von_mises_cdf_limit
The limiting distribution of the statistic ω² (Anderson and Darling, 1952), as SciPy sums it: Σ_k Γ(k + ½)/(Γ(k + 1) π^{3/2} √x) √(4k+1) e^{−q} K_{1/4}(q), q = (4k+1)²/(16x), stopping after the first term below 10⁻⁷.
cramervonmises
The one-sample Cramér-von Mises test of the hypothesis that x comes from the distribution cdf (SciPy’s cramervonmises): ω² = 1/(12n) + Σ ((2i − 1)/(2n) − F(x_(i)))², with the p-value from the finite-sample distribution of Csörgő and Faraway.
cramervonmises_2samp
The two-sample Cramér-von Mises test (SciPy’s cramervonmises_2samp), from the average ranks: U = n_x Σ (r_i − i)² + n_y Σ (s_j − j)² and T = U/(n_x n_y N) − (4 n_x n_y − 1)/(6N), with an exact p-value (lattice-path counting) or the asymptotic one after standardising T.