IDEAS home Printed from https://ideas.repec.org/a/jss/jstsof/v019i06.html
   My bibliography  Save this article

Rational Arithmetic Mathematica Functions to Evaluate the One-sided One-sample K-S Cumulative Sample Distribution

Author

Listed:
  • Brown, J. Randall
  • Harvey, Milton E.

Abstract

One of the most widely used goodness-of-fit tests is the Kolmogorov-Smirnov (KS) family of tests which have been implemented by many computer statistical software packages. To calculate a p value (evaluate the cumulative sampling distribution), these packages use various methods including recursion formulae, limiting distributions, and approximations of unknown accuracy developed over thirty years ago. Based on an extensive literature search for the one-sided one-sample K-S test, this paper identifies two direct formulae and five recursion formulae that can be used to calculate a p value and then develops two additional direct formulae and four iterative versions of the direct formulae for a total of thirteen formulae. To ensure accurate calculation by avoiding catastrophic cancelation and eliminating rounding error, each formula is implemented in rational arithmetic. Linear search is used to calculate the inverse of the cumulative sampling distribution (find the confidence interval bandwidth). Extensive tables of bandwidths are presented for sample sizes up to 2, 000. The results confirm the hypothesis that as the number of digits in the numerator and denominator integers of the rational number test statistic increases, the computation time also increases. In comparing the computational times of the thirteen formulae, the direct formulae are slightly faster than their iterative versions and much faster than all the recursion formulae. Computational times for the fastest formula are given for sample sizes up to fifty thousand.

Suggested Citation

  • Brown, J. Randall & Harvey, Milton E., 2007. "Rational Arithmetic Mathematica Functions to Evaluate the One-sided One-sample K-S Cumulative Sample Distribution," Journal of Statistical Software, Foundation for Open Access Statistics, vol. 19(i06).
  • Handle: RePEc:jss:jstsof:v:019:i06
    DOI: http://hdl.handle.net/10.18637/jss.v019.i06
    as

    Download full text from publisher

    File URL: https://www.jstatsoft.org/index.php/jss/article/view/v019i06/v19i06.pdf
    Download Restriction: no

    File URL: https://www.jstatsoft.org/index.php/jss/article/downloadSuppFile/v019i06/KS1SidedOneSampleRational.nb
    Download Restriction: no

    File URL: https://libkey.io/http://hdl.handle.net/10.18637/jss.v019.i06?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    References listed on IDEAS

    as
    1. Drew, John H. & Glen, Andrew G. & Leemis, Lawrence M., 2000. "Computing the cumulative distribution function of the Kolmogorov-Smirnov statistic," Computational Statistics & Data Analysis, Elsevier, vol. 34(1), pages 1-15, July.
    Full references (including those not matched with items on IDEAS)

    Citations

    Citations are extracted by the CitEc Project, subscribe to its RSS feed for this item.
    as


    Cited by:

    1. repec:jss:jstsof:39:i11 is not listed on IDEAS
    2. repec:jss:jstsof:26:i03 is not listed on IDEAS
    3. Fernández de Marcos Giménez de los Galanes, Alberto & García Portugués, Eduardo, 2022. "Data-driven stabilizations of goodness-of-fit tests," DES - Working Papers. Statistics and Econometrics. WS 35324, Universidad Carlos III de Madrid. Departamento de Estadística.
    4. repec:jss:jstsof:26:i02 is not listed on IDEAS

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. repec:jss:jstsof:19:i06 is not listed on IDEAS
    2. repec:jss:jstsof:26:i02 is not listed on IDEAS
    3. repec:jss:jstsof:08:i18 is not listed on IDEAS
    4. Leidjaira Lopes Juvanhol & Enirtes Caetano Prates Melo & Marilia Sá Carvalho & Dóra Chor & José Geraldo Mill & Rosane Härter Griep, 2017. "Job Strain and Casual Blood Pressure Distribution: Looking beyond the Adjusted Mean and Taking Gender, Age, and Use of Antihypertensives into Account. Results from ELSA-Brasil," IJERPH, MDPI, vol. 14(4), pages 1-19, April.
    5. repec:jss:jstsof:39:i11 is not listed on IDEAS
    6. Marsaglia, George & Tsang, Wai Wan & Wang, Jingbo, 2003. "Evaluating Kolmogorov's Distribution," Journal of Statistical Software, Foundation for Open Access Statistics, vol. 8(i18).

    More about this item

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:jss:jstsof:v:019:i06. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Christopher F. Baum (email available below). General contact details of provider: http://www.jstatsoft.org/ .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.