Computes the test statistic and p-values of the one-sample and two-sample Hausdorff (H) goodness-of-fit tests. The H statistic measures the Hausdorff distance under the Chebyshev (l-infinity) metric, between the two cumulative distribution functions (cdfs) underlying the corresponding one-sample and two-sample null hypothesis. It coincides to the side length of the largest axis-aligned square (hypercube) that can be inscribed between the two cdfs. The following cases are covered: (i) one-sample, univariate; (ii) two-sample univariate; and (iii) two-sample bivariate. Exact one-sample p-values are computed in O(n^2 log n) time via the 'Exact-KS-FFT' method of Dimitrova, Kaishev, and Tan (2020) <doi:10.18637/jss.v095.i10>; two-sample p-values are obtained by permutation. A key advantage of the H test is that its sensitivity can be directed towards the left tail, body, or right tail of the distribution by tuning a scale parameter sigma, and therefore maximizing its power which as shown numerically is significantly higher than the power of the classical tests such as the Kolmogorov-Smirnov, Cramer-von Mises, and Anderson-Darling test, especially when the right tail of the distribution is targeted. The sensitivity of the test (left tail, body, or right tail) is governed by two parameters psi1 and psi2, whose values needs to be input. Then the optimal value of the scale parameter sigma is automatically computed.
| Version: | 0.3.0 |
| Depends: | R (≥ 3.5.0) |
| Imports: | Rcpp (≥ 0.12.12), KSgeneral, stats, utils, withr |
| LinkingTo: | Rcpp, RcppEigen |
| Published: | 2026-05-15 |
| DOI: | 10.32614/CRAN.package.HausdorffGoF (may not be active yet) |
| Author: | Dimitrina S. Dimitrova [aut], Yun Jia [aut, cre], Vladimir K. Kaishev [aut] |
| Maintainer: | Yun Jia <yunjia2019 at gmail.com> |
| License: | GPL (≥ 3) |
| Copyright: | Dimitrina S. Dimitrova, Yun Jia, and Vladimir K. Kaishev own
the copyright of the original R and C++ code in this package.
Portions of the C++ source code (src/fastCDF.cpp,
src/fastCDF.h, src/fastCDFOnSample.cpp, src/fastCDFOnSample.h,
src/nDDominanceAlone.cpp) are derived from the StOpt library
and are Copyright (C) 2020 EDF - Electricite de France,
published under the GNU Lesser General Public License (LGPL-3).
See the file inst/COPYRIGHTS for full details. HausdorffGoF copyright details |
| URL: | https://github.com/fakecloudsjy/HausdorffGoF |
| NeedsCompilation: | yes |
| CRAN checks: | HausdorffGoF results |
| Reference manual: | HausdorffGoF.html , HausdorffGoF.pdf |
| Package source: | HausdorffGoF_0.3.0.tar.gz |
| Windows binaries: | r-devel: not available, r-release: not available, r-oldrel: not available |
| macOS binaries: | r-release (arm64): not available, r-oldrel (arm64): not available, r-release (x86_64): not available, r-oldrel (x86_64): not available |
Please use the canonical form https://CRAN.R-project.org/package=HausdorffGoF to link to this page.