algorithm for calculating skewness and kurtosis (default: KurtosisAlgo.online)
algorithm for calculating sums (default: Summation.appropriate)
The kurtosis of the input, must be floating point References: D’Agostino, R. B. (1971), “An omnibus test of normality for moderate and large sample size”, Biometrika, 58, 341-348; D’Agostino, R. and Pearson, E. S. (1973), “Tests for departure from normality”, Biometrika, 60, 613-622
import mir.math.common: approxEqual, pow; import mir.math.sum: Summation; import mir.ndslice.slice: sliced; import mir.test; auto x = [0.0, 1.0, 1.5, 2.0, 3.5, 4.25, 2.0, 7.5, 5.0, 1.0, 1.5, 0.0]; double p; x.dAgostinoPearsonTest(p).shouldApprox == 4.151936053369771; p.shouldApprox == 0.12543494432988342; p = p.nan; x.dAgostinoPearsonTest!"threePass"(p).shouldApprox == 4.151936053369771; p.shouldApprox == 0.12543494432988342;
Tests that a sample comes from a normal distribution.