Learn R Programming

exptest (version 1.2)

gini.exp.test: Test for exponentiality based on the Gini statistic

Description

Performs test for the composite hypothesis of exponentiality based on the Gini statistic, see e.g. Gail and Gastwirth (1978).

Usage

gini.exp.test(x, simulate.p.value=FALSE, nrepl=2000)

Arguments

x
a numeric vector of data values.
simulate.p.value
a logical value indicating whether to compute p-values by Monte Carlo simulation.
nrepl
the number of replications in Monte Carlo simulation.

Value

  • A list with class "htest" containing the following components:
  • statisticthe value of the Gini statistic.
  • p.valuethe p-value for the test.
  • methodthe character string "Test for exponentiality based on the Gini statistic".
  • data.namea character string giving the name(s) of the data.

Details

The test is based on the Gini statistic $$G_n = \frac{\sum_{i,j=1}^n |X_i-X_j|}{2n(n-1)\overline{X}}.$$ Under exponentiality, the normalized statistic $(12(n-1))^{1/2}(G_n-0.5)$ is asymptotically standard normal (see, e.g., Gail and Gastwirth (1978)).

References

Gail, M.H. and Gastwirth, J.L. (1978): A scale-free goodness-of-fit test for the exponential distribution based on the Gini statistic. --- J. R. Stat. Soc. Ser. B, vol. 40, No. 3, pp. 350--357.

Examples

Run this code
gini.exp.test(rexp(100))
gini.exp.test(runif(100, min = 0, max = 1))

Run the code above in your browser using DataLab