Computing P-Values of the One-Sample K-S Test and the Two-Sample K-S and Kuiper Tests for (Dis)Continuous Null Distribution
Overview
Contains functions to compute p-values for the one-sample and two-sample Kolmogorov-Smirnov (KS) tests and the two-sample Kuiper test for any fixed critical level and arbitrary (possibly very large) sample sizes. For the one-sample KS test, this package implements a novel, accurate and efficient method named Exact-KS-FFT, which allows the pre-specified cumulative distribution function under the null hypothesis to be continuous, purely discrete or mixed. In the two-sample case, it is assumed that both samples come from an unspecified (unknown) continuous, purely discrete or mixed distribution, i.e. ties (repeated observations) are allowed, and exact p-values of the KS and the Kuiper tests are computed. Note, the two-sample Kuiper test is often used when data samples are on the line or on the circle (circular data). To cite this package in publication: (for the use of the one-sample KS test) Dimitrina S. Dimitrova, Vladimir K. Kaishev, and Senren Tan. Computing the Kolmogorov-Smirnov Distribution When the Underlying CDF is Purely Discrete, Mixed, or Continuous. Journal of Statistical Software. 2020; 95(10): 1--42. doi:10.18637/jss.v095.i10. (for the use of the two-sample KS and Kuiper tests) Dimitrina S. Dimitrova, Yun Jia and Vladimir K. Kaishev (2024). The R functions KS2sample and Kuiper2sample: Efficient Exact Calculation of P-values of the Two-sample Kolmogorov-Smirnov and Kuiper Tests. submitted.
New interface
- Added
ks_c_cdf(n, A, B), a documented low-level interface to the Exact-KS-FFT boundary-crossing calculation. It accepts the lower (A) and upper (B) boundary vectors directly and does not use an intermediate file.
C++ source interface
- Added
src/KSgeneral.handsrc/KSgeneral.cppas the source-level C++ interface. The header uses only standard C++ types and can be included by users compiling the KSgeneral numerical sources directly. - Centralized all
Rcpp::exportattributes insrc/KSgeneral.cpp; the numerical implementation files no longer contain Rcpp wrappers. - Organized the numerical entry points as
src/k1sample.cpp/src/k1sample.hfor the one-sample implementation andsrc/k2sample.cppfor the two-sample KS and Kuiper implementations.
Show all changes in 2.1.0Hide the rest of the changes in 2.1.0
Internal changes
- Refactored the one-sample Exact-KS-FFT calculation so package functions pass boundary vectors directly to C++ instead of writing and reading
Boundary_Crossing_Time.txt. - Removed the package-internal working-directory side effect and the shared temporary-file dependency from continuous, discrete, and mixed one-sample calculations.
- Deprecated the historical file-based
ks_c_cdf_Rcpp(n)interface. It is retained temporarily for backward compatibility and now issues a deprecation warning directing users toks_c_cdf(n, A, B).
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-26
- NOTE12 OK, 2 NOTE2026-04-22
- ERROR11 OK, 2 NOTE, 1 ERROR2026-04-18
- NOTE12 OK, 2 NOTE2026-03-10
Documentation
- Help pages
- 17includes a package overview page
- Examples that run
- 100%14 run in a plain check
- Exported functions with examples
- 93%
- Documented parameters
- not tracked
- Return-value docs
- not tracked
- Help pages citing references
- 94%
Downloads
Repository
- PRs merged (all time)
- 33%
- Median days to close, 50 most recently updated closed issues
- 3
- Median days to close, 50 most recently updated closed PRs
- 3
Forks over time
PRs over time
Commits over time
3 development-tooling and community-health practices detected across 2 families in the upstream repository
Checks run against github.com/d-dimitrova/ksgeneral on 2026-10-22.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
Dependencies
Installing KSgeneral adds 2 packages (2 with compiled code, 1.8 MB of source tarballs). Heaviest: Rcpp 1.8 MB, dgof 14 KB.
Code & Tests
Datasets
People & History
Previously maintained by Senren Tan (0.1.0 to 1.1.2).
Show 3 peopleHide 3 people
Pick two releases to compare their code metrics.
- 2.1.0Latest
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- 2.0.22024-07-29 · diff ↗
- 2.0.12024-07-26 · diff ↗
- 2.0.02024-05-21 · diff ↗
- RR 4.4.0 released · 2024-04-24
- 1.1.32024-03-15 · diff ↗
- unarchivedReturned to CRAN2023-07-10
- 1.1.22023-07-10 · diff ↗
- RR 4.3.0 released · 2023-04-21
- archivedRemoved from CRAN2023-02-18configure issues were not corrected in time 'CXX' not set correctly
- RR 4.2.0 released · 2022-04-22
- 1.1.12022-03-20 · diff ↗
- unarchivedReturned to CRAN2021-12-05
- 1.1.02021-12-05 · diff ↗
Show 10 earlier eventsHide 10 earlier events
- archivedRemoved from CRAN2021-11-05check problems were not corrected in time
- RR 4.1.0 released · 2021-05-18
- 1.0.02020-10-02 · diff ↗
- RR 4.0.0 released · 2020-04-24
- 0.1.22020-02-11 · diff ↗
- RR 3.6.0 released · 2019-04-26
- 0.1.12018-05-14 · diff ↗
- RR 3.5.0 released · 2018-04-23
- 0.1.02018-01-08
- RR 3.4.0 released · 2017-04-21
Package metadata
- First published
- 2018-01-08
- Total releases
- 12 / 8 yrs
- License
- GPL (>= 2.0)
- Copyright
- Copyright holders of FFTW3: Copyright (c) 2003, 2007-11 Matteo Frigo; Copyright (c) 2003, 2007-11 Massachusetts Institute of Technology
- Minimum R
- ≥ 3.3.0
- Bundled data
- 0.6 KB / 1 file
- Download size
- 97 KB
Cite
Cite this package
Run in R for the authors' entry:
citation("KSgeneral")The package provides a citation file, so citation() returns the authors' own entry.
It points to 10.18637/jss.v095.i10.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.