Skip to content

"Kolmogorov-Smirnov" distribution #421

@evanmiller

Description

@evanmiller

I'm interested in contributing code needed to implement a Kolmogorov-Smirnov test. The distribution under the null is unofficially called a "Kolmogorov-Smirnov distribution" for lack of anything better.

This paper has a good overview of the various algorithms implementing the distribution in asymptotic and exact forms:

https://www.jstatsoft.org/article/view/v039i11

The exact form is (IMO) computationally prohibitive, requiring either FFT or eigendecomposition.

The asymptotic form comes in a couple of major flavors, Kolmogorov's original 1st order Taylor approximation or a 4th order approximation from Pelz and Good:

https://www.jstor.org/stable/2985019

I'm curious how I should handle the various orders of this equation. What I'd like to do is implement the 1st order equation now (this is fairly popular in stats software), but also have some flexibility to add higher order equations later. I'd also like to leave room in the API for an implementation of the exact distribution if someone smarter than me figures out a good way to support it.

So my question is one of API design. Would I call it one of:

  • kolmogorov_dist
  • kolmogorov_smirnov_dist
  • kolmogorov_asymptotic_dist
  • kolmogorov_smirnov_asymptotic_dist

And in the future, how should I handle the order of the Taylor expansion? Have an integer parameter specifying the order, defaulting to 1? Is there any precedent in any of the other distributions or special functions for specifying Taylor expansion order?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions