Classical Goodness-of-Fit Tests
Cramer-von Mises and Anderson-Darling tests of goodness-of-fit for continuous univariate distributions, using modern algorithms to compute the null distributions.
The goftest package contains implementations of the classical Cramer-von Mises and Anderson-Darling tests of goodness-of-fit for continuous univariate distributions.
By default, each test assumes that the parameters of the null
distribution are known (a simple null hypothesis).
If the parameters were estimated (calculated from the data)
then the user should set estimated=TRUE
which uses
the method of Braun (1980) to adjust for the effect of
estimating the parameters from the data.
Adrian Baddeley, Julian Faraway, John Marsaglia, George Marsaglia.
Maintainer: Adrian Baddeley <adrian.baddeley@uwa.edu.au>
Braun, H. (1980) A simple method for testing goodness-of-fit in the presence of nuisance parameters. Journal of the Royal Statistical Society 42, 53–63.
Csorgo, S. and Faraway, J.J. (1996) The exact and asymptotic distributions of Cramer-von Mises statistics. Journal of the Royal Statistical Society, Series B 58, 221–234.
Marsaglia, G. and Marsaglia, J. (2004) Evaluating the Anderson-Darling Distribution. Journal of Statistical Software 9 (2), 1–5. February 2004. http://www.jstatsoft.org/v09/i02
x <- rnorm(30, mean=2, sd=1) # default behaviour: parameters fixed: simple null hypothesis cvm.test(x, "pnorm", mean=2, sd=1) ad.test(x, "pnorm", mean=2, sd=1) # parameters estimated: composite null hypothesis mu <- mean(x) sigma <- sd(x) cvm.test(x, "pnorm", mean=mu, sd=sigma, estimated=TRUE) ad.test(x, "pnorm", mean=mu, sd=sigma, estimated=TRUE)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.