Title: | Goodness-of-Fit Tests for the Exponential and Two-Parameter Weibull Distributions |
---|---|
Description: | Contains a large number of the goodness-of-fit tests for the Exponential and Weibull distributions classified into families: the tests based on the empirical distribution function, the tests based on the probability plot, the tests based on the normalized spacings, the tests based on the Laplace transform and the likelihood based tests. |
Authors: | Meryam Krit |
Maintainer: | Meryam Krit <[email protected]> |
License: | GPL (>= 2.0) |
Version: | 2.2.2 |
Built: | 2024-11-06 03:40:42 UTC |
Source: | https://github.com/mkrit/ewgof |
This package contains a large number of the goodness-of-fit tests for the Exponential and Weibull distributions classified into families: the tests based on the empirical distribution function, the tests based on the probability plot, the tests based on the normalized spacings, the tests based on the Laplace transform and the likelihood based tests ...
Package: | EWGoF |
Type: | Package |
Version: | 2.2 |
Date: | 2017-09-08 |
License: | GPL (>=2.0) |
Imports: | Rcpp (>= 0.10.3) |
LazyLoad: | yes |
LinkingTo: | Rcpp |
Computes the p-value of the chosen test statistic, the value of the observed statistic and an estimation of the distribution parameters (either the parameter of the Exponential distribution or the shape and the scale Weibull parameters).
Meryam Krit Maintainer: Meryam Krit <[email protected]>
D'Agostino R.B. and Stephens M.A., Goodness-of-fit techniques, Marcel Dekker, 1986.
Henze N. and Meintanis S.G., Recent and classical tests for exponentiality: a partial review with comparisons, Metrika, 61, 29-45, 2005.
Liao M. and Shimokawa T., A new goodness-of-fit test for type-I extreme-value and 2-parameter Weibull distributions with estimated parameters, Journal of Statistical Computation and Simulation, 64 (1), 23-48, 1999.
Tiku M.L. and Singh M., Testing the two-parameter Weibull distribution, Communications in Statistics, 10, 907-918, 1981.
Mann N.R., Scheuer E.M. and Fertig K.W., A new goodness-of-fit test for the two-parameter Weibull or extreme-value distribution, Communications in Statistics, 2, 383-400, 1973.
Lockhart R.A., O'Reilly F. and Stephens M.A., Tests for the extreme-value and Weibull distributions based on normalized spacings, Naval Research Logistics Quarterly, 33, 413-421, 1986.
Cabana A. and Quiroz A.J., Using the empirical moment generating function in testing the Weibull and type 1 Extreme Value distributions, Test, 14(2), 417-431, 2005.
Krit M., Goodness-of-fit tests for the Weibull distribution based on the Laplace transform, J-SFdS, 2014.
Computes the Blom's estimators of the shape and scale parameters of the Weibull distribution from an i.i.d sample x.
It also gives the sample after using the logarithmic transformation (
, where
and
are the estimated shape and scale parameters).
BLOMEst(x)
BLOMEst(x)
x |
a numeric vector of data values. |
A list containing the following elements:
eta |
the Blom's estimator of the scale parameter of the Weibull distribution ( |
beta |
the Blom's estimator of the shape parameter of the Weibull distribution ( |
y |
the pseudo-observations |
Meryam KRIT
Blom G., Statistical Estimates and Transformed Beta-variables. New York: Wiley, 1958.
x <- rweibull(50,2,3) #Value of the Blom's estimator of the scale parameter BLOMEst(x)$eta #Value of the Blom's estimator of the shape parameter BLOMEst(x)$beta
x <- rweibull(50,2,3) #Value of the Blom's estimator of the scale parameter BLOMEst(x)$eta #Value of the Blom's estimator of the shape parameter BLOMEst(x)$beta
Computes the GoF tests based on the characteristic function of the Exponential distribution: Epps-Pulley (EP), Henze-Meintanis (W1, W2) and Meintanis-Iliopoulos test statistics (T1, T2).
CF.test(x, type = "EP", a = 1, nsim = 200)
CF.test(x, type = "EP", a = 1, nsim = 200)
x |
a numeric vector of data values. |
type |
the type of the test statistic used. "EP" is the default used test of Epps-Pulley,"W1" and "W2" for Henze and Meintanis, "T1" and "T2" for Meintanis-Iliopoulos test statistics. |
a |
parameter value to be adjusted for the test statistics ("W1", "W2", "T1" and "T2"). |
nsim |
an integer specifying the number of replicates used in Monte Carlo. |
The computation time of this function is quite long for the test statistics "W1", "W2", "T1" and "T2" because of their complex expression. The Monte-Carlo simulations take more time compared to the other tests. These tests are not defined for a=0.
An object of class htest.
Meryam KRIT
Epps T.W. and Pulley L.B., A test for exponentiality vs. monotone hazard alternatives derived from the empirical characteristic function, Journal of the Royal Statistical Society, Series B, 48, 206-213, 1986.
Henze N. and Meintanis S.G., Recent and classical tests for exponentiality: partial review with comparisons, Metrika, 61, 29-45, 2005.
Henze N. and Meintanis S.G., Goodness-of-fit tests based on a new characterization of the exponential distribution, Communications in Statistics, Theory and Methods, 31, 1479-1497, 2002.
Meintanis S.G. and Iliopoulos G., Characterizations of the exponential distribution based on certain properties of its characteristic function, Kybernetika, 39 (3), 295-298, 2003.
x <- rgamma(10,0.3) #Apply the Epps-Pulley test CF.test(x,type="EP") # Apply the test of Meintanis-Iliopoulos CF.test(x,type="T1",nsim=200) # Apply the test of Henze-Meintanis CF.test(x,type="W1",nsim=200)
x <- rgamma(10,0.3) #Apply the Epps-Pulley test CF.test(x,type="EP") # Apply the test of Meintanis-Iliopoulos CF.test(x,type="T1",nsim=200) # Apply the test of Henze-Meintanis CF.test(x,type="W1",nsim=200)
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.
EDF_NS.test(x, type = "AD", nsim = 200)
EDF_NS.test(x, type = "AD", nsim = 200)
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. |
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.
An object of class htest.
Meryam KRIT
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.
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")
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")
Computes the Exponential GoF tests based on the three following statistics: the score of Cox-Oakes (CO), Wald (W) and likelihood ratio (LR) GoF tests. These tests include the Exponential distribution in the Weibull distribution and apply a parametric test to check whether the shape parameter is equal to one.
LK.test(x, type = "CO", nsim = 200)
LK.test(x, type = "CO", nsim = 200)
x |
a numeric vector of data values. |
type |
the type of the test statistic used. "CO" is the default used test of Cox-Oakes,"W" for Wald, "LR" for likelihood ratio test statistic. |
nsim |
an integer specifying the number of replicates used in Monte Carlo. |
The test statistic of Cox and Oakes is equivalent to the score test applied to the shape parameter of the Weibull distribution. The expression of the score is given using the observed information matrix and not the exact one.
An object of class htest.
Meryam KRIT
Cox D.R. and Oakes D., Analysis of survival data, Chapman and Hall, 1984.
x <- rgamma(20,0.3) #Apply the Cox and Oakes test (score) test LK.test(x,type="CO") # Apply the test based on Wald LK.test(x,type="W") # Apply the test based on the likelihood ratio LK.test(x,type="LR")
x <- rgamma(20,0.3) #Apply the Cox and Oakes test (score) test LK.test(x,type="CO") # Apply the test based on Wald LK.test(x,type="W") # Apply the test based on the likelihood ratio LK.test(x,type="LR")
Computes the Weibull GoF tests based on the Laplace transform: Baringhaus-Henze (BH) and Henze (He). The test statistic of Klar (Kl) is based on the integrated distribution function. Two tests are based on the mean residual life (BHC, BHK).
LRI.test(x, type = "BH", a = 1, nsim = 200)
LRI.test(x, type = "BH", a = 1, nsim = 200)
x |
a numeric vector of data values. |
type |
the type of the test statistic used. "BH" is the default used test of Baringhaus-Henze,"He" for Henze, "Kl" for Klar, "BHC" and "BHK" for the tests based on the integrated distribution function. |
a |
parameter value to be adjusted for the test statistics. |
nsim |
an integer specifying the number of replicates used in Monte Carlo. |
An object of class htest.
Meryam KRIT
Baringhaus L. and Henze N., Tests of fit for exponentiality based on a characterization via the mean residual life function, Statistical Papers, 41, 225-236, 2000.
Baringhaus L. and Henze N., A class of consistent tests for exponentiality based on the empirical Laplace transform, Annals of the Institute of Statistical Mathematics, 43, 551-564, 1991.
Henze N., A new flexible class of omnibus tests for exponentiality, Communications in Statistics, Theory and Methods, 22, 115-133, 1993.
Klar B., Goodness-of-fit tests for the exponential and normal distribution based on the integrated distribution function, Annals of the Institute of Statistical Mathematics, 53, 338-353, 2001.
x <- rlnorm(50,0.3) #Apply the Baringhaus-Henze test LRI.test(x,type="BH") # Apply the test of Henze LRI.test(x,type="He") # Apply the test of Klar LRI.test(x,type="Kl") # Apply the test of Barighaus based on the integrated distribution function LRI.test(x,type="BHC")
x <- rlnorm(50,0.3) #Apply the Baringhaus-Henze test LRI.test(x,type="BH") # Apply the test of Henze LRI.test(x,type="He") # Apply the test of Klar LRI.test(x,type="Kl") # Apply the test of Barighaus based on the integrated distribution function LRI.test(x,type="BHC")
This function computes the Least Squares Estimators (LSEs) of the shape and scale parameters of the Weibull distribution, based on the probability plot, from an i.i.d sample x.
It also gives the sample after using the logarithmic transformation (
, where
and
are the estimated shape and scale parameters).
LSEst(x)
LSEst(x)
x |
a numeric vector of data values. |
The elements of the numeric vector should be positive. The support of the Weibull distribution is R+*. These estimators are used by Liao and Shimokawa; they are based on the probability plot and symmetrical ranks.
A list containing the following elements:
eta |
the least squares estimator of the scale parameter of the Weibull distribution ( |
beta |
the least squares estimator of the shape parameter of the Weibull distribution ( |
y |
the pseudo-observations |
Meryam KRIT
Liao M. and Shimokawa T., A new goodness-of-fit test for type-I extreme-value and 2-parameter Weibull distributions with estimated parameters, Journal of Statistical Computation and Simulation, 64 (1), 23-48, 1999.
Krit M., Gaudoin O., Xie M. and Remy E., Simplified likelihood goodness-of-fit tests for the Weibull distribution, Communications in Statistics - Simulation and Computation.
x <- rweibull(50,2,3) Est <- LSEst(x) #Value of the least squares estimator of the scale parameter Est$eta #Value of the lest squares estimator of the shape parameter Est$beta
x <- rweibull(50,2,3) Est <- LSEst(x) #Value of the least squares estimator of the scale parameter Est$eta #Value of the lest squares estimator of the shape parameter Est$beta
This function computes the Moment Estimators (MEs) of the shape and scale parameters of the Weibull distribution from an i.i.d sample x. It also gives the sample after using the logarithmic transformation (
, where
and
are the estimated shape and scale parameters).
MEst(x)
MEst(x)
x |
a numeric vector of data values. |
The elements of the numeric vector should be positive. The support of the Weibull distribution is R+*. These estimators are based on the moments of the extreme value distribution.
A list containing the following elements:
eta |
the moment estimator of the scale parameter of the Weibull distribution ( |
beta |
the moment estimator of the shape parameter of the Weibull distribution ( |
y |
the pseudo-observations |
Meryam KRIT
Rinne H., The Weibull distribution - A handbook, CRC-Chapman & Hall, 2009.
x <- rweibull(50,2,3) Est <- MEst(x) #Value of the moment estimator of the scale parameter Est$eta #Value of the moment estimator of the shape parameter Est$beta
x <- rweibull(50,2,3) Est <- MEst(x) #Value of the moment estimator of the scale parameter Est$eta #Value of the moment estimator of the shape parameter Est$beta
This function computes the Maximum Likelihood Estimators (MLEs) of the shape and scale parameters of the Weibull distribution from an i.i.d sample x.
It also gives the sample after using the logarithmic transformation (
, where
and
are the estimated shape and scale parameters).
MLEst(x)
MLEst(x)
x |
a numeric vector of data values. |
The elements of the numeric vector should be positive. The support of the Weibull distribution is R+*.
A list containing the following elements:
eta |
the maximum likelihood estimator of the scale parameter of the Weibull distribution ( |
beta |
the maximum likelihood estimator of the shape parameter of the Weibull distribution ( |
y |
the pseudo-observations |
Meryam KRIT
D'Agostino R.B. and Stephens M.A., Goodness-of-fit techniques, Marcel Dekker, 1986.
Krit M., Gaudoin O., Xie M. and Remy E., Simplified likelihood goodness-of-fit tests for the Weibull distribution, Communications in Statistics - Simulation and Computation.
x <- rweibull(50,2,3) Est <- MLEst(x) #Value of the maximum likelihood estimator of the scale parameter Est$eta #Value of the maximum likelihood estimator of the shape parameter Est$beta
x <- rweibull(50,2,3) Est <- MLEst(x) #Value of the maximum likelihood estimator of the scale parameter Est$eta #Value of the maximum likelihood estimator of the shape parameter Est$beta
Computes the Weibull GoF tests based on the empirical distribution function: Kolmogorov-Smirnov (KS), Cramer-Von-Mises (CM), Watson (W), Anderson-Darling (AD) and Liao-Shimokawa (LS) statistics using the three following estimation methods: Maximum Likelihood Estimators (MLE), Least Squares Estimators (LSE) and Moments Estimators (ME). A test statistic (KL) is added to this family but it is based on the Kullback-Leibler information; this test can also be computed with the three estimation methods.
WEDF.test(x, type = "AD", funEstimate = "MLE", paramKL = 2, nsim = 200)
WEDF.test(x, type = "AD", funEstimate = "MLE", paramKL = 2, nsim = 200)
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, "W" for Watson, "LS" for Liao-Shimokawa and "KL" for Kullback-Leibler. |
funEstimate |
the method used to estimate the two Weibull parameters. "MLE" is the default used method based on the maximum likelihood estimators, "LSE" for the least squares estimators and "ME" for the moment estimators. |
paramKL |
the value of the parameter m used in the expression of the statistic KL. |
nsim |
an integer specifying the number of replicates used in Monte Carlo. |
The above test statistics are known in the literature by using the maximum likelihood estimators except the test "LS" that Liao and Shimokawa recommend to use with the least squares estimators. Each of the tests can have three versions, depending on the estimation method used.
All these tests statistics can be used for small samples. The asymptotic distributions of the tests are known in some cases but the use of their quantiles for small samples may lead to wrong conclusions. That is why we use Monte-Carlo simulations to apply the tests.
An object of class htest.
Meryam KRIT
D'Agostino R.B. and Stephens M.A., Goodness-of-fit techniques, Marcel Dekker, 1986.
Liao M. and Shimokawa T., A new goodness-of-fit test for type-I extreme-value and 2-parameter Weibull distributions with estimated parameters, Journal of Statistical Computation and Simulation, 64 (1), 23-48, 1999.
Chandra M., Singpurwalla N.D and Stephens M.A, Kolmogorov statistics for tests of fit for the Extreme Value and Weibull distributions, Journal of American Statistical Association, 76 (375), 729-731, 1981.
Vaquera-Huerta P.P. and Villasenor-Alva J.A., A Goodness-of-fit test for the Gumbel distribution based on Kullback-Leibler information, Communications in Statistics, Theory and Methods, 38: 842-855, 2009.
x1 <- rweibull(50,2,3) #Apply Kolmogorov-Smirnov test with maximum likelihood estimators WEDF.test(x1,type="KS",funEstimate="MLE") x2 <- rlnorm(50,0.2) #Apply the Liao and Shimokawa test using the least squares estimators WEDF.test(x2,type="LS",funEstimate="LSE") #Apply the Cramer-von Mises test with the moment estimators WEDF.test(x2,type="CM",funEstimate="ME") #Apply the test based on the Kullback-Leibler information with the moment estimators WEDF.test(x2,type="KL",funEstimate="ME")
x1 <- rweibull(50,2,3) #Apply Kolmogorov-Smirnov test with maximum likelihood estimators WEDF.test(x1,type="KS",funEstimate="MLE") x2 <- rlnorm(50,0.2) #Apply the Liao and Shimokawa test using the least squares estimators WEDF.test(x2,type="LS",funEstimate="LSE") #Apply the Cramer-von Mises test with the moment estimators WEDF.test(x2,type="CM",funEstimate="ME") #Apply the test based on the Kullback-Leibler information with the moment estimators WEDF.test(x2,type="KL",funEstimate="ME")
Computes the Weibull GoF tests based on the three following statistics: the score, Wald and likelihood ratio GoF tests. These tests include the Weibull distribution in larger statistics and apply a parametric test to the additional parameter.
WLK.test(x, type = "GG1", funEstimate = "MLE", procedure = "S", nsim = 200, r=0)
WLK.test(x, type = "GG1", funEstimate = "MLE", procedure = "S", nsim = 200, r=0)
x |
a numeric vector of data values. |
type |
the type of the test statistic used:
|
funEstimate |
the method used to estimate the two Weibull parameters. "MLE" is the default used method based on the Maximum Likelihood Estimators, "LSE" for the Least Squares Estimators and "ME" for the Moment Estimators. |
procedure |
the procedure used as a default is the score "S". The procedure can be either "W" for the Wald test or "LR" for the test based on the likelihood ratio procedure. |
nsim |
an integer specifying the number of replicates used in Monte Carlo. |
r |
an integer specifying the number of right censored observations. |
The tests are based on different generalized Weibull families: the tests (GG1) and (GG2) are based on the Generalized Gamma distribution, the tests (EW) are based on the Exponentiated Weibull, (PGW) on the Power Generalized Weibull, (MO) on the Marshall-Olkin distribution and (MW) are based on the Modified Weibull distribution. Each family can have nine versions depending on the procedure used (score, Wald or likelihood ratio statistic) and on the parameters estimation methods: maximum likelihood, moment or least squares method, except GG1 which has only three versions using the maximum likelihood estimators.
The tests statistics and
are a combination between two Wald test statistics: PGW with ME (
) and MW with MLE (
) after they are centered with their mean values (
and
) and normalized by their standard deviations (respectively
and
).
The expressions of the statistics and
are as follows:
All the previous tests can be applied to type II right censored samples (simple censoring). The censoring is introduced in the MLEs.
A second statistic similar to
, is combining Wald and likelihood ratio tests based on the Generalized Gamma distribution:
An object of class htest.
Meryam KRIT
Krit M., Gaudoin O., Xie M. and Remy E., Simplified likelihood goodness-of-fit tests for the Weibull distribution, Communications in Statistics - Simulation and Computation.
x <- rlnorm(50,.3) #Apply some likelihood based tests WLK.test(x,type="GG1",funEstimate="MLE",procedure="W") WLK.test(x,type="PGW",funEstimate="ME",procedure="S") WLK.test(x,type="MO",funEstimate="LSE",procedure="LR") #Apply G to censored sample at right r=10 a<- sort(x[1:40]) ## Not run: WLK.test(a,type="G",r=10) ## End(Not run)
x <- rlnorm(50,.3) #Apply some likelihood based tests WLK.test(x,type="GG1",funEstimate="MLE",procedure="W") WLK.test(x,type="PGW",funEstimate="ME",procedure="S") WLK.test(x,type="MO",funEstimate="LSE",procedure="LR") #Apply G to censored sample at right r=10 a<- sort(x[1:40]) ## Not run: WLK.test(a,type="G",r=10) ## End(Not run)
Computes the Weibull GoF tests based on the Laplace transform: (CQ) Cabana-Quiroz with the two versions either with the Maximum Likelihood Estimators (MLE) or the Moment Estimators (ME) and (LT) based on the Laplace transform with discretization which has three versions, it can be computed either with the MLE, ME or the Least Squares Estimators (LSE).
WLP.test(x,type = "CQ",funEstimate="MLE",s1=-1,s2=0.4,mr=100,a=-5,nsim = 200)
WLP.test(x,type = "CQ",funEstimate="MLE",s1=-1,s2=0.4,mr=100,a=-5,nsim = 200)
x |
a numeric vector of data values. |
type |
the type of the test statistic used. "CQ" is the default used test of Cabana and Quiroz and "LT" is the test statistic based on the Laplace transform discretization. |
funEstimate |
the method used to estimate the two Weibull parameters. "MLE" is the default used method based on the maximum likelihood estimators, "LSE" for the least squares estimators and "ME" for the moment estimators. The test statistic "CQ" can be computed for MLE or ME only. |
s1 |
the first value where the quadratic form of the statistic "CQ" is computed. |
s2 |
the second value where the quadratic form of the statistic "CQ" is computed. |
mr |
the number of the discretizations done to compute the test "LT"; mr = 100 is the default value recommended. |
a |
the value of the adjusting parameter used in the statistic "LT"; a = -5 is the default value used. |
nsim |
an integer specifying the number of replicates used in Monte Carlo. |
An object of class htest.
Meryam KRIT
Cabana A. and Quiroz A.J., Using the empirical moment generating function in testing the Weibull and type 1 Extreme Value distributions, Test, 14(2), 417-431, 2005.
Krit M., Goodness-of-fit tests for the Weibull distribution based on the Laplace transform, J-SFdS, 2014.
# Xie data x<-c(5, 11, 21, 31, 46, 75, 98, 122, 145, 165, 195, 224, 245, 293, 321, 330, 350, 420) #Apply test of Cabana and Quiroz with the least squares estimators ## Not run: WLP.test(x, type="CQ*",funEstimate="LSE")
# Xie data x<-c(5, 11, 21, 31, 46, 75, 98, 122, 145, 165, 195, 224, 245, 293, 321, 330, 350, 420) #Apply test of Cabana and Quiroz with the least squares estimators ## Not run: WLP.test(x, type="CQ*",funEstimate="LSE")
Computes the Weibull GoF tests based on the normalized spacings: (TS) Tiku-Singh, (MSF) Mann-Scheuer-Fertig only with right censoring and (LOS) Lockhart-O'Reilly-Stephens test statistics.
WNS.test(x, type = "TS", s = 0, r = 0, nsim = 200)
WNS.test(x, type = "TS", s = 0, r = 0, nsim = 200)
x |
a numeric vector of data values. |
type |
the type of the test statistic used. "TS" is the default used test of Tiku-Singh,"MSF" for Mann-Scheuer-Fertig and "LOS" for Lockhart-O'Reilly-Stephens test statistic. |
s |
the index of the smallest observed value of x (s=0 if no left censoring). |
r |
the index of the largest observed value of x (r=0 if no right censoring). |
nsim |
an integer specifying the number of replicates used in Monte Carlo. |
For these tests statistics, there is no need to estimate the unknown values of the Weibull parameters and they are among the most powerful ones especially TS and LOS.
The p-value computed is not the exact p-value: the null hypothesis distribution of some statistics is known only asymptotically and sometimes is not even known. The asymptotic approximation is not correct especially for small samples. That is why Monte Carlo simulation is needed to compute the p-value.
An object of class htest.
Meryam KRIT
Tiku M.L. and Singh M., Testing the two-parameter Weibull distribution, Communications in Statistics, 10, 907-918, 1981.
Mann N.R., Scheuer E.M. and Fertig K.W., A new goodness-of-fit test for the two-parameter Weibull or extreme-value distribution, Communications in Statistics, 2, 383-400, 1973.
Lockhart R.A., O'Reilly F. and Stephens M.A., Tests for the extreme-value and Weibull distributions based on normalized spacings, Naval Research Logistics Quarterly, 33, 413-421, 1986.
x1 <- rweibull(50,2,3) #Apply the Tiku-Singh test with censored sample: 4 left censored and 5 right censored values ## Not run: WNS.test(x1,type="TS",s=4,r=5) ## End(Not run)
x1 <- rweibull(50,2,3) #Apply the Tiku-Singh test with censored sample: 4 left censored and 5 right censored values ## Not run: WNS.test(x1,type="TS",s=4,r=5) ## End(Not run)
Computes the GoF tests based on the Weibull probability plot (WPP). The test statistics are similar to the coefficient of determination of the regression on the WPP: (RSB) test statistic of Smith and Bain, (REJG) test statistic of Evans, Johnson and Green, (SPP) test statistic of Coles based on the stabilized probability plot.
The second family includes the Shapiro-Wilk type test statistics: (SB) Shapiro and Brain and (OK) Ozturk and Korukoglu test statistic.
Two additional statistics can also be computed: the first one (ST1) is based on the kurtosis and the second one (ST2) is based on the skewness coefficient.
WPP.test(x, type = "SB", nsim = 200)
WPP.test(x, type = "SB", nsim = 200)
x |
a numeric vector of data values. |
type |
the type of the test statistic used. "OK" is the test statistic of Ozturk and Korukoglu, "RSB" the test statistic of Smith and Bain, "REJG" the test statistic of Evans-Johnson and Green, "SPP" the test statistic of Coles based on the stabilized probability plot, "SB" the test statistic of Shapiro and Brain, "ST1" the test statistic based on the kurtosis and "ST2" the test statistic based on the skewness. |
nsim |
an integer specifying the number of replicates used in Monte Carlo. |
An object of class htest.
Meryam KRIT
Coles S.G., On goodness-of-fit tests for the two-parameter Weibull distribution derived from the stabilized probability plot, Biometrika, 76 (3), 593-598, 1989.
Evans J.W., Johnson R.A. and Green D.W., Two and three parameter Weibull goodness-of-fit tests, Research paper FPL-RP-493, U.S. Forest Products Laboratory, Madison, WI, 1989.
Ozturk A. and Korukoglu S., A new test for the extreme value distribution, Communications in Statistics - Simulation and Computation, 17, 1375-1393, 1988.
Smith R.M. and Bain L.J., Correlation type goodness-of-fit statistics with censored sampling, Communications in statistics, 5, 119-132, 1976.
Best D.J., Rayner J.C.W and Thas O., Comparison of five tests of fit for the extreme value distribution, Journal of Statistical Theory and Practice, 1 (1), 89-99, 2007.
x <- rlnorm(10,3) #Apply the Ozturk-Korukoglu test ## Not run: WPP.test(x,type="OK") ## End(Not run) # Apply the generalized smooth test based on the kurtosis ## Not run: WPP.test(x,type="ST1") ## End(Not run)
x <- rlnorm(10,3) #Apply the Ozturk-Korukoglu test ## Not run: WPP.test(x,type="OK") ## End(Not run) # Apply the generalized smooth test based on the kurtosis ## Not run: WPP.test(x,type="ST1") ## End(Not run)