Learn R Programming

uniftest (version 1.1)

dudewicz.unif.test: Dudewicz-van der Meulen test for uniformity

Description

Performs Dudewicz-van der Meulen test for the hypothesis of uniformity.

Usage

dudewicz.unif.test(x, nrepl=2000,m=length(x)/2)

Arguments

x
a numeric vector of data values.
nrepl
the number of replications in Monte Carlo simulation.
m
a parameter of the test (see below).

Value

  • A list with class "htest" containing the following components:
  • statisticthe value of the Dudewicz-van der Meulen statistic.
  • p.valuethe p-value for the test.
  • methodthe character string "Dudewicz-van der Meulen test for uniformity".
  • data.namea character string giving the name(s) of the data.

Details

The Dudewicz-van der Meulen test for uniformity is based on the following statistic: $$H(m, n) = -\frac{1}{n}\sum_{i=1}^{n}{\log_2{\frac{n}{2m}(x_{(i+m)}-x_{(i-m)})}}$$ The p-value is computed by Monte Carlo simulation.

References

Dudewicz E. J., van der Meulen E. C. (1981): Entropy-based tests of uniformity. --- JASA, vol. 76, pp. 967--974.

Examples

Run this code
dudewicz.unif.test(runif(100,0,1))
dudewicz.unif.test(runif(100,0.1,0.9))

Run the code above in your browser using DataLab