EDF_NS.test {EWGoF} | R Documentation |
GoF tests based on the empirical distribution function, the normalized spacings and the probability plots for the Exponential distribution
Description
Computes the Exponential GoF tests based on the empirical distribution function: the Kolmogorov-Smirnov (KS), Cramer-Von-Mises (CM) and Anderson-Darling (AD) tests, the tests based on the probability plot: Shapiro-Wilk (SW) and Patwardhan (PA) tests and the tests based on the normalized spacings: Gnedenko (Gn) and Gini (G) tests.
Usage
EDF_NS.test(x, type = "AD", nsim = 200)
Arguments
x |
a numeric vector of data values. |
type |
the type of the test statistic used. "AD" is the default used test of Anderson-Darling,"KS" for Kolmogorov-Smirnov, "CM" for Cramer-Von-Mises, "SW" for Shapiro-Wilk, "PA" for Patwardhan, "Gn" for Gnedenko and "G" for Gini test statistic. |
nsim |
an integer specifying the number of replicates used in Monte Carlo. |
Details
This function computes the GoF test statistics of three different families: the tests based on the empirical distribution function, the tests based on the probability plots and the tests based on the normalized spacings. The p-value of the tests is computed using Monte-Carlo simulations because only the asymptotic distribution of the previous statistics is known. Therefore the tests can be applied to small samples.
Value
An object of class htest.
Author(s)
Meryam KRIT
References
D'Agostino R.B. and Stephens M.A., Goodness-of-fit techniques, Marcel Dekker, 1986.
Gail M.H. and Gastwirth J.L., A scale-free goodness-of-fit test for the exponential distribution based on the Gini statistic, Journal of the Royal Statistical Society, Series B, 40, 350-357, 1978.
Gnedenko B.V., Belyayev Y.K. and Solovyev A.D., Mathematical Models of Reliability Theory, Academic Press, 1969.
Shapiro S.S. and Wilk M.B., An analysis of variance test for the exponential distribution (complete samples), Technometrics, 14, 355-370, 1972.
Patwardhan G., Tests for exponentiality, Communications in Statistics, Theory and Methods, 17, 3705-3722, 1988.
Examples
x1 <- rexp(50,2)
#Apply the Kolmogorov-Smirnov test
EDF_NS.test(x1,type="KS")
x2 <- rlnorm(50,0.2)
#Apply the Patwardhan test
EDF_NS.test(x2,type="PA")
#Apply the Cramer-von Mises test
EDF_NS.test(x2,type="CM")
#Apply the Gini test
EDF_NS.test(x2,type="G")