Plot the ECDF of a uniform sample with Kolmogorov-Smirnov bounds
This plot function takes a univariate sample that should be tested for
a U(0,1) distribution, plots its empirical cumulative distribution
ecdf), and adds a confidence band by inverting
the corresponding Kolmogorov-Smirnov test (
uniform distribution is rejected if the ECDF is not completely inside
the confidence band.
ks.plot.unif(U, conf.level = 0.95, exact = NULL, col.conf = "gray", col.ref = "gray", xlab = expression(u[(i)]), ylab = "Cumulative distribution")
numeric vector containing the sample. Missing values are (silently) ignored.
confidence level for the K-S-test (defaults to 0.95), can also be a vector of multiple levels.
colour of the confidence lines.
colour of the diagonal reference line.
- xlab, ylab
Michael Höhle and Sebastian Meyer.
The code contains segments originating from the source of the ks.test function
which is Copyright (C) 1995-2012 The R Core Team available under GPL-2
(or later) and C functionality from
which is copyright (C) 1999-2009 the R Core Team and available under
GPL-2 (or later). Somewhat hidden in their
ks.c file is a statement
that part of their code is based on code published in
Marsaglia et al. (2003).
George Marsaglia and Wai Wan Tsang and Jingbo Wang (2003): Evaluating Kolmogorov's distribution. Journal of Statistical Software, 8 (18). doi: 10.18637/jss.v008.i18