New goodness-of-ﬁt tests for exponentiality based on a conditional moment characterisation

The exponential distribution plays a key role in the practical application of reliability theory, survival analysis, engineering and queuing theory. These applications often rely on the underlying assumption that the observed data originate from an exponential distribution. In this paper, two new tests for exponentiality are proposed, which are based on a conditional second moment characterisation. The proposed tests are compared to various established tests for exponentiality by means of a simulation study where it is found that the new tests perform favourably relative to the existing tests. The tests are also applied to real-world data sets with independent and identi-cally distributed data as well as to simulated data from a Cox proportional hazards model, to determine whether the residuals obtained from the ﬁtted model follow a standard exponential distribution.


Introduction
The exponential distribution is an important and commonly used statistical model for a multitude of real-life phenomena, such as lifetimes, time to default of loans, and many other time-to-event scenarios. As a result, this distribution plays a vital role in the practical application of reliability theory, survival analysis, engineering, and queuing theory (to name only a few), as the underlying theory governing these applications often assumes an exponential distribution for the data. Therefore, to effectively implement these applications, it is necessary to perform goodness-of-fit tests to determine whether these fundamental distributional assumptions are satisfied or not. Examples where the assumption of exponentiality is necessary (and hence the need to test for this assumption) range from the analysis of queuing networks [26], to cancer clinical trials [15], and the time-tofailure of systems of machines and operators [12]; for further examples of data sets see the papers by Shanker, Fesshaye, and Selvaraj [23,24].
Suppose that a random variable X follows an exponential distribution with scale parameter λ (written X ∼ Exp(λ)). This random variable has a number of unique distributional properties which include the forms of its cumulative distribution function (CDF), survival function, probability density function, and characteristic function (CF), which are given by F (x) = P(X < x) = 1 − e −λx , respectively, with x > 0 and where λ > 0 is the scale parameter, with E(X) = 1/λ. In addition, the exponential distribution also exhibits many other unique distributional properties, called characterisations. These characterisations help in the development of tests for exponentiality since, if one can verify that the data has these properties, then one can conclude that the data were obtained from an exponential distribution. One such property is the so-called 'memoryless' property which states that, if X follows an exponential distribution, then we can write for s, t > 0. This property implies that, if X represents the lifetime of a certain component, then the remaining lifetime of that component is independent of its current age. For components that suffer from wear-and-tear (i.e., where the lifetime is dependent on its current age), the exponential distribution would not be an appropriate model. A second property states that the exponential distribution uniquely has the feature that the hazard rate is a constant, that is, This feature is directly tied to the memoryless property since the failure rate is constant throughout the lifetime of the component.
Suppose now that X 1 , X 2 , . . . , X n are realisations from some random variable X with unknown distribution function F , then the process of testing whether or not this data are realisations from an exponential distribution with parameter λ involves the use of statistical inference via goodness-of-fit tests. The inferential question can be framed in the form of the following composite hypothesis statement: for some λ > 0, against the alternative hypothesis that the distribution of X is something other than exponential. Note that the tests that will be discussed in this paper all make use of a scaled version of the original data, defined as Y j = X j λ, j = 1, 2, . . . , n, where λ denotes the maximum likelihood estimator (MLE) of the parameter λ and is given by λ = 1/X n withX n = 1 n n j=1 X j . The motivation for the use of this scaling factor primarily comes from the fact that the distribution of exponential random variables is invariant to simple scale transformations, that is, X is exponentially distributed if, and only if, cX is also exponentially distributed for every constant c > 0. Therefore, conclusions drawn regarding exponentiality based on the sample Y 1 , Y 2 , . . . , Y n can reasonably be extended to the exponentiality of X (from which X 1 , X 2 , . . . , X n was obtained). Furthermore, many statistics discussed will also employ the order statistics of X j and Y j , defined as X (1) <X (2) <. . . <X (n) and Y (1) <Y (2) <. . . <Y (n) , respectively.
To test the hypothesis in (2), formal test statistics are used, some of which are general statistics that can be applied to test for almost any distribution, whereas others exploit the various unique characteristics of exponentially distributed data, such as the memoryless or constant hazard properties. Examples of general tests employed to test exponentiality include the Kolmogorov-Smirnov test and the Cramér-von Mises test, both of which are based on the same basic principle of measuring the discrepancies between the theoretical CDF of the exponential distribution and its empirical equivalent (see, e.g., Chapter 4 of D'Agostino and Stephens, 1986 [11]). Another class of general tests involves a similar approach, but replaces the CDF with the CF; examples of these include the test by Epps and Pulley [13], and the one by Meintanis, Swanepoel and Allison [21]. In addition, there are many goodness-of-fit tests based on the unique properties of the exponential distribution, which are occasionally desirable as they tend to focus on much more specific aspects of the distribution and are potentially more robust than the more general tests. For example, since the memoryless property uniquely characterises the exponential distribution, this implies that the exponentially distributed random variable X will have this property and conversely, if X exhibits this property it must be exponentially distributed. Therefore, a test based on this property will involve first determining sample estimates of the two probabilities appearing on either side of the expression of (1), and the test can then be designed to measure the equality of these two estimates. For examples of tests based on this characterisation, see [2], [5], and [6].
There are many more such unique characterisations of the exponential distribution and the literature on goodness-of-fit contains numerous test statistics based on these characterisations. For example, for tests based on the mean residual life, see [8], [25], [17], and [9]. For a test based on the Arnold-Villasenor characterisation, see [18], and for a test based on the Rossberg characterisation see [27]. For a comprehensive review of tests for exponentiality, the interested reader is referred to the review papers by Ascher [7], Henze and Meintanis [16], and Allison, Santana, Smit and Visagie [4].
The remainder of the paper is organised as follows: In Section 2 we propose new tests for exponentiality which are based on a conditional second moment characterisation of the exponential distribution and, in Section 3, the results of a brief Monte Carlo simulation are presented to compare the power performance of the newly proposed tests to some commonly used existing tests for exponentiality. The paper concludes in Section 4 where the tests are applied to some real-world data sets with independent and identically distributed random values, as well as to data simulated from a Cox proportional hazards model, to determine whether the residuals obtained from the fitted model follow a standard exponential distribution.

New tests for exponentiality based on a characterisation
Consider the following characterisation of the exponential distribution by Afify, Nofal and Ahmed [1]: Characterisation. Let X be a non-negative random variable with continuous distribution function F and density f . If E(X 2 ) < ∞, then X has an exponential distribution with parameter λ (that is, From this characterisation we can deduce the following corollary. Corollary 1 Let X be a non-negative random variable with continuous distribution function F . If E(X 2 ) < ∞, then X has an exponential distribution with parameter λ if, and only if, for all t > 0 where r λ (t) : and I(· ) denotes the indicator function.
Proof: Straightforward calculations yield that, for all t > 0, From the Characterisation, it follows that X has an exponential distribution with parameter λ if, and only if, for all t > 0, or equivalently if, and only if, for all t > 0, Based on Y , the characterisation in Corollary 1 can be restated as follows: Y is exponentially distributed if, and only if, where S(t) = P (Y > t) and r 1 (t) = 2 + h(t) t 2 + 2t , with h(t) the hazard rate of Y .
Based on this, a random variable Y has a standard exponential distribution if, and only if, or equivalently if, and only if, Naturally, ψ(t) is unknown and hence must be estimated from the data . . , n. Define two possible estimators for ψ(t) by Here, f (t) denotes the kernel density estimate of f (t), which is defined as where φ(· ) is the standard normal density function and h is a suitably chosen bandwidth (for an in-depth discussion on kernel density estimators, the interested reader is referred to the monograph by Wand and Jones [28]). The only difference between the estimators ψ n and ψ (2) n is that in ψ n we choose f (t) = e −t , the density function specified under the null hypothesis, whilst in ψ (2) n we estimate f by f . Now, if the observed data originated from an exponential distribution, then both ψ (1) n and ψ (2) n should be close to zero. This leads to the following two Cramér-von Mises type test statistics and where F n (t) = 1 n n i=1 I(Y i ≤ t) is the empirical distribution function of Y 1 , Y 2 , . . . , Y n and w(t) is a suitable, positive weight function satisfying some standard integrability conditions. For implementation of the proposed test statistics, we will use w(t) = e −at , where a > 0 is a user-defined tuning parameter.
With this choice of w(t) the following easily calculable form of the proposed test statistics S n and T n is obtained.
Both tests reject the null hypothesis in (2) for large values of the test statistics. The critical values for the test statistics can easily be calculated using the following Monte Carlo procedure.
3. Calculate the test statistic, say S = S n (Y 1 , Y 2 , . . . , Y n ). 4. Repeat steps 1-3 a large number of times, say M C times, to obtain M C copies of S denoted S 1 , S 2 , . . . , S M C . 5. Obtain the order statistics S (1) ≤ S (2) ≤ · · · ≤ S (M C) . 6. The critical value at a α% significance level is then given by where x denotes the largest integer less than or equal to x.

Simulation study and results
In this section Monte Carlo simulations are used to compare the finite-sample performance of the newly proposed tests T n,a and S n,a to the following existing tests for exponentiality.
• The traditional tests of Kolmogorov-Smirnov (KS n ) and Cramér-von Mises (CM n ), where the test statistics for these tests are given by Both of these tests reject the null hypothesis for large values of the test statistics • A Kolmogorov-Smirnov type test (KS n ) and a Cramér-von Mises type test (CM n ) based on the mean residual life, as developed by Baringhaus and Henze [8], with the following test statistics Both KS n and CM n reject the null hypothesis for large values. • The Epps and Pulley test EP n [13], which is based on the characteristic function, φ(x), and with the test statistic given by The null hypothesis is rejected for large values of |EP n |.

Simulation setting
A significance level of 5% was used throughout the study. Empirical critical values of all the tests were obtained from 10 000 independent Monte Carlo replications using the procedure given at the end of Section 2. Power estimates were calculated for sample sizes n = 20 and n = 30 using 10 000 independent Monte Carlo replications for the various alternative distributions given in Table 1.
The two new tests in which a tuning parameter appears were evaluated for a = 0.25 and a = 1. All calculations and simulations were performed in R [22]. Table 2 contains the percentage of the 10 000 Monte Carlo samples that resulted in the rejection of the null hypothesis in (2) rounded to the nearest integer. For each alternative the top row corresponds to the estimated powers obtained for n = 20 whereas the row below corresponds to the estimated powers for n = 30.

EL(θ)
Exponential geometric The highest power for each alternative distribution is highlighted for ease of comparison. From Table 2 it is clear that there is no single test that dominates all of the other tests. However, S n,a outperforms all its competitors for the EG(θ), EL(θ) and Γ(0.7) alternatives and for both sample sizes. No single test dominates for the majority of the other alternatives with the exception of T n,a , which performs well for the alternatives LF (4) and P W (1). Overall, the two newly proposed tests produce estimated powers which are competitive relative to the other tests and, hence, this limited Monte Carlo study shows that they can be used in practice to test whether observed data are realised from an exponential distribution.

Practical applications and conclusion
In this section all the tests considered in the simulation study will be applied to both real-world and simulated data sets. The two real-world data sets considered in this study respectively contain the failure times of air conditioning systems and the waiting times of bank customers. For these two data sets, the tests for exponentiality will be used to determine whether the observed values are realisations from an exponential distribution. On the other hand, the remaining two data sets that will be considered are simulated from a Cox proportional hazards (CPH) model and the tests for exponentiality will be used to determine the adequacy of a specific CPH model fitted to the data.

Practical application to real-world data sets
The first data set contains 30 failure times of the air conditioning system of an airplane as given by Linhart and Zucchini [20], whereas the second data set contains the waiting times  (in minutes) of 100 bank customers before service as obtained from Ghitany, Atieh and Nadarajah [14]; both data sets can be found in the Appendix in Tables 7 and 8. In Table  3 and 4 a summary of the results of all the different tests for exponentiality can be found. The summary contains the value of each test statistic and associated p-value used to test whether the data originated from an exponential distribution. For the failure time data, all of the tests, except the KS n test, do no reject the null hypothesis of exponentiality using a 5% significance level. In contrast, for the waiting time data, all of the tests reject the null hypothesis of exponentiality at the same significance level. This illustrates that the newly proposed test at least agrees with the more traditional tests for exponentiality.

Practical application to simulated data sets
The following two data sets, given in the Appendix in Tables 9 and 10, contain simulated lifetimes (t i , i = 1, 2, . . . , 100) together with a single covariate (x i , i = 1, 2, . . . , 100) which can take on the values 0, 1, 2 or 3. The first data set was obtained by simulating data from a CPH model with a Weibull cumulative baseline hazard function, whereas the second data set was simulated from a CPH model with a log-normal cumulative baseline hazard function.
Recall that the cumulative hazard function of the j th individual follows a CPH model with a single covariate if Λ j (t) = e βx j H(t), where H(· ) is some unspecified baseline cumulative hazard function, x j is the value of the covariate of the j th individual and β is an unknown regression parameter.
On the basis of the observed data (t j , x j ), j = 1, 2, . . . , 100 we wish to test the null hypothesis where H 0 (t; a, b) = t b a is the Weibull cumulative baseline hazard function with unknown parameters a and b.
We can now estimate the parameters β, a and b by their maximum likelihood estimators β, a and b. Based on these estimators we can obtain the (so-called) Cox-Snell residuals, defined as ε j = e βx j H 0 (t j ; a, b).
If the null hypothesis is true (i.e., if the cumulative baseline hazard was correctly specified as the Weibull cumulative baseline hazard) then the Cox-Snell residuals should (approximately) follow a standard exponential distribution (see, e.g., Chapter 11 of Klein and Moeschberger [19]). Hence any exponential test on the basis of ε j , j = 1, 2, . . . , 100 constitutes in effect a goodness-of-fit test for the CPH model itself.
It is, therefore, expected that tests for exponentiality will not reject the null hypothesis for the first simulated data set (recall that this data was generated from a CPH model with a Weibull cumulative baseline hazard), whereas the tests should reject the null hypothesis of exponentiality for the second simulated data set (which was generated from a CPH model with a log-normal cumulative baseline hazard).
The results of all the different tests for exponentiality for the two simulated data sets are summarised in Table 5 and 6, which display both the test statistics and associated p-values used to test whether the residuals originate from a standard exponential distribution, i.e., whether the cumulative baseline hazard is correctly specified as Weibull. Due to the fact that the null hypothesis in (3) involves unknown parameters -and hence must be estimated under H 0 -the p-values had to be obtained using the bootstrap algorithm described in Cockeran, Allison and Meintanis [10]. For the first simulated data set, the MLEs are β = 0.090, a = 0.880 and b = 0.763. Table 5 shows that all tests correctly do not reject the null hypothesis, which is expected, as the data was known to be generated using a Weibull cumulative baseline hazard.
The second simulated data set produced the following MLEs: β = 0.008, a = 0.854 and b = 3.302, and the resulting p-values displayed in Table 6 indicate that the null hypothesis was rejected by all of the tests. This is not surprising, since a good test for exponentiality should have the ability to detect the mis-specification of the Weibull cumulative baseline hazard when the data originated from a CPH model with a log-normal cumulative baseline hazard.
To ultimately use the two new tests for exponentiality, one would need to make a choice regarding the value of the tuning parameter a, however, from extensive simulation studies   conducted (not displayed here), it was concluded that a = 1 produces satisfactory results. If, however, one would prefer to rather use a data dependent choice of this parameter, one can employ the method outlined in Allison and Santana [3].