Usage Notes
The functions in this chapter are used to test for goodness of fit and randomness. The goodnessoffit tests are described in Conover (1980). There are two goodnessoffit tests for general distributions, a KolmogorovSmirnov test and a chisquared test. The user supplies the hypothesized cumulative distribution function for these two tests.
There is one function (Lilliefors) that can be used to test specifically for exponential distributions and five functions (ShapiroWilk, Lilliefors, Mardia, AndersonDarling, and Cramervon Mises) that can be used to test specifically for normal distributions.
When the sample size is less than 5,000 observations, the ShapiroWilk test provides an accurate estimate for the pvalue of this test. Lilliefors test is also popular but it only provides accurate pvalue estimates for values between 0.01 and 0.1. Values below 0.01 are always returned as 0.01, and values above 0.1 are returned as 0.5. The general version of the chisquared test is also available for the normal distribution.
The tests for randomness are often used to evaluate the adequacy of pseudorandom number generators. These tests are discussed in Knuth (1981).
The Kolmogorov-Smirnov functions in this chapter compute exact probabilities in small to moderate sample sizes. The chi-squared goodness-of-fit test may be used with discrete as well as continuous distributions.
The Kolmogorov-Smirnov, chi-squared, Anderson-Darling, and Cramer-von Mises goodness-of-fit test functions allow for missing values (NaN, not a number) in the input data. The functions that test for randomness do not allow for missing values.