úÎ"œ!B Safe-Infered      Safe-Infered with Marsaglia'+s long-computation shortcut approximation. K Accurate to about 7 decimal places in the right tail of the distribution.  Safe-InferedE distribution: not really a standard mathematical concept, but still  a nice conceptual shift. KS n d! is the distribution of a random # variable constructed as a list of n! independent random variables of  distribution d. The corresponding 2 instance implements the K-S test for such lists.  For example, if xs7 is a list of length 100 believed to contain Beta(2,5)  variates, then cdf (KS 100 (Beta 2 5))( is the K-S test for that distribution.  (Note that if  length xs/ is not 100, then the result will be 0 because # such lists cannot arise from that & distribution. Somewhat arbitrarily,  all lists of " impossible"2 length are grouped at the bottom of the ordering  encoded by the  instance.) The ) test can easily be applied recursively.  For example, if d is a % of interest and you have 100 trials 7 each with 100 data points, you can test it by calling cdf (KS 100 (KS 100 d)). JKolmogorov-Smirnov statistic for a set of data relative to a (continuous) L distribution with the given CDF. Returns 3 common forms of the statistic: ) (K+, K-, D), where K+ and K- are Smirnov'"s one-sided forms as presented in  Knuth'@s Semi-Numerical Algorithms (TAOCP, vol. 2) and D is Kolmogorov's  undirected version. In particular,  K+ = sup(x -> F_n(x) - F(x))  * K- = sup(x -> F(x) - F_n(x))  * D = sup(x -> abs(F_n(x) - F(x)))  ksTest cdf xs H Computes the probability of a random data set (of the same size as xs) I drawn from a continuous distribution with the given CDF having the same  Kolmogorov statistic as xs. IThe statistic is the greatest absolute deviation of the empirical CDF of  XS from the assumed CDF cdf. IIf the data were, in fact, drawn from a distribution with the given CDF, E then the resulting p-value should be uniformly distributed over (0,1].        ks-test-0.1#Data.Random.Distribution.KolmogorovMath.Statistics.KSTestNumeric.LinearAlgebraDkCdf kCdfQuickKSksksTestMatrixmatRowsmatColscontentmatrixindexM unsafeIndexMscalemultiply $fCDFDDouble$fDistributionDDoublerandom-fu-0.2.1.1Data.Random.DistributionCDF Distribution $fCDFKS[]$fDistributionKS[]$fShowKS$fEqKS