Package 'EWGoF'

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

Help Index


Goodness-of-Fit Tests for the Exponential and Two-Parameter Weibull Distributions

Description

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 ...

Details

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).

Author(s)

Meryam Krit Maintainer: Meryam Krit <[email protected]>

References

  • 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.


Blom's estimators of the two parameters of the Weibull distribution

Description

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 yˇ\check{y} after using the logarithmic transformation (yˇ=(shapeˇ)ln(x/scaleˇ)\check{y}=(\check{shape})\ln(x/\check{scale}), where shapeˇ\check{shape} and scaleˇ\check{scale} are the estimated shape and scale parameters).

Usage

BLOMEst(x)

Arguments

x

a numeric vector of data values.

Value

A list containing the following elements:

eta

the Blom's estimator of the scale parameter of the Weibull distribution (scaleˇ\check{scale}).

beta

the Blom's estimator of the shape parameter of the Weibull distribution (shapeˇ\check{shape}).

y

the pseudo-observations yˇ\check{y} after using the logarithmic transformation and the Blom's estimators.

Author(s)

Meryam KRIT

References

Blom G., Statistical Estimates and Transformed Beta-variables. New York: Wiley, 1958.

Examples

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

GoF tests based on the empirical characteristic function for the Exponential distribution

Description

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).

Usage

CF.test(x, type = "EP", a = 1, nsim = 200)

Arguments

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.

Details

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.

Value

An object of class htest.

Author(s)

Meryam KRIT

References

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.

Examples

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)

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")

GoF tests based on the likelihood for the Exponential distribution

Description

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.

Usage

LK.test(x, type = "CO", nsim = 200)

Arguments

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.

Details

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.

Value

An object of class htest.

Author(s)

Meryam KRIT

References

Cox D.R. and Oakes D., Analysis of survival data, Chapman and Hall, 1984.

Examples

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")

GoF tests based on the Laplace transform, the mean residual life and the integrated distribution function for the Exponential distribution

Description

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).

Usage

LRI.test(x, type = "BH", a = 1, nsim = 200)

Arguments

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.

Value

An object of class htest.

Author(s)

Meryam KRIT

References

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.

Examples

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")

Least Squares Estimators of the two parameters of the Weibull distribution

Description

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 y~\tilde{y} after using the logarithmic transformation (y~=(shape~)ln(x/scale~)\tilde{y}=(\widetilde{shape})\ln(x/\widetilde{scale}), where shape~\widetilde{shape} and scale~\widetilde{scale} are the estimated shape and scale parameters).

Usage

LSEst(x)

Arguments

x

a numeric vector of data values.

Details

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.

Value

A list containing the following elements:

eta

the least squares estimator of the scale parameter of the Weibull distribution (scale~\widetilde{scale}).

beta

the least squares estimator of the shape parameter of the Weibull distribution (shape~\widetilde{shape}).

y

the pseudo-observations y~\tilde{y} after using the logarithmic transformation and the LSEs.

Author(s)

Meryam KRIT

References

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.

Examples

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

Moment Estimators of the two parameters of the Weibull distribution

Description

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 y˘\breve{y} after using the logarithmic transformation (y˘=(shape˘)ln(x/scale˘)\breve{y}=(\breve{shape})\ln(x/\breve{scale}), where shape˘\breve{shape} and scale˘\breve{scale} are the estimated shape and scale parameters).

Usage

MEst(x)

Arguments

x

a numeric vector of data values.

Details

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.

Value

A list containing the following elements:

eta

the moment estimator of the scale parameter of the Weibull distribution (scale˘\breve{scale}).

beta

the moment estimator of the shape parameter of the Weibull distribution (shape˘\breve{shape}).

y

the pseudo-observations y˘\breve{y} after using the logarithmic transformation and the MEs.

Author(s)

Meryam KRIT

References

Rinne H., The Weibull distribution - A handbook, CRC-Chapman & Hall, 2009.

Examples

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

Maximum Likelihood Estimators of the two parameters of the Weibull distribution

Description

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 y^\hat{y} after using the logarithmic transformation (y^=(shape^)ln(x/scale^)\hat{y}=(\hat{shape})\ln(x/\hat{scale}), where shape^\hat{shape} and scale^\hat{scale} are the estimated shape and scale parameters).

Usage

MLEst(x)

Arguments

x

a numeric vector of data values.

Details

The elements of the numeric vector should be positive. The support of the Weibull distribution is R+*.

Value

A list containing the following elements:

eta

the maximum likelihood estimator of the scale parameter of the Weibull distribution (scale^\hat{scale}).

beta

the maximum likelihood estimator of the shape parameter of the Weibull distribution (shape^\hat{shape}).

y

the pseudo-observations y^\hat{y} after using the logarithmic transformation and the MLEs.

Author(s)

Meryam KRIT

References

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.

Examples

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

GoF tests based on the empirical distribution function for the Weibull distribution

Description

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.

Usage

WEDF.test(x, type = "AD", funEstimate = "MLE", paramKL = 2, 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, "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.

Details

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.

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.

  • 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.

Examples

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")

GoF tests based on the likelihood for the Weibull distribution

Description

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.

Usage

WLK.test(x, type = "GG1", funEstimate = "MLE", procedure = "S", nsim = 200, r=0)

Arguments

x

a numeric vector of data values.

type

the type of the test statistic used:

  • "GG1" is the default used test based on the Generalized Gamma distribution,

  • "GG2" is also based on the Generalized Gamma distribution after a transformation,

  • "EW" for the tests based on the Exponentiated Weibull,

  • "PGW" for the tests based on the Power Generalized Weibull,

  • "MO" for the tests based on the Marshall-Olkin distribution,

  • "MW" for the tests based on the Modified Weibull distribution,

  • "T1" for a combination of two tests "PGW" and "MW" (max),

  • "T2" for a combination of two tests "PGW" and "MW" (sum),

  • "G" for a combination of two tests based on "GG1" (Wald and likelihood ratio).

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.

Details

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 T1T1 and T2T2 are a combination between two Wald test statistics: PGW with ME (PGW˘w\breve{PGW}_w) and MW with MLE (MW^w\hat{MW}_w) after they are centered with their mean values (PGW˘w\overline{\breve{PGW}}_w and MW^w\overline{\hat{MW}}_w) and normalized by their standard deviations (respectively sd(PGW˘w)sd(\breve{PGW}_w) and sd(MW^w)sd(\hat{MW}_w)).

The expressions of the statistics T1T1 and T2T2 are as follows:

T1=max(PGW˘wPGW˘wsd(PGW˘w),MW^wMW^wsd(MW^w))T1=max(\left|\frac{\breve{PGW}_w-\overline{\breve{PGW}_w}}{sd(\breve{PGW}_w)}\right|,\left|\frac{\hat{MW}_w-\overline{\hat{MW}_w}}{sd(\hat{MW}_w)}\right|)

T2=0.5PGW˘wPGW˘wsd(PGW˘w)+0.5MW^wMW^wsd(MW^w)T2=0.5\left|\frac{\breve{PGW}_w-\overline{\breve{PGW}_w}}{sd(\breve{PGW}_w)}\right|+0.5\left|\frac{\hat{MW}_w-\overline{\hat{MW}_w}}{sd(\hat{MW}_w)}\right|

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 GG similar to TT, is combining Wald and likelihood ratio tests based on the Generalized Gamma distribution:

G=0.5GG^l1GG^l1sd(GG^l1)+0.5GG^w1GG^w1sd(GG^w1)G=0.5\left|\frac{\hat{GG}^1_l-\overline{\hat{GG}^1_l}}{sd(\hat{GG}^1_l)}\right|+0.5\left|\frac{\hat{GG}^1_w-\overline{\hat{GG}^1_w}}{sd(\hat{GG}^1_w)}\right|

Value

An object of class htest.

Author(s)

Meryam KRIT

References

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.

Examples

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)

GoF tests based on the Laplace transform for the Weibull distribution

Description

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).

Usage

WLP.test(x,type = "CQ",funEstimate="MLE",s1=-1,s2=0.4,mr=100,a=-5,nsim = 200)

Arguments

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.

Value

An object of class htest.

Author(s)

Meryam KRIT

References

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.

Examples

# 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")

GoF tests based on the normalized spacings for the Weibull distribution

Description

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.

Usage

WNS.test(x, type = "TS", s = 0, r = 0, nsim = 200)

Arguments

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.

Details

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.

Value

An object of class htest.

Author(s)

Meryam KRIT

References

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.

Examples

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)

GoF tests based on the Weibull probability plot for the Weibull distribution

Description

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.

Usage

WPP.test(x, type = "SB", nsim = 200)

Arguments

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.

Value

An object of class htest.

Author(s)

Meryam KRIT

References

  • 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.

Examples

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)