The classical algorithm counts the integer lattice paths from (0, 0)
to (m, n) which satisfy |x/m - y/n| < h / lcm(m, n).
The paths make steps of size +1 in either positive x or positive y
directions.
We are, however, interested in 1 - proportion to computes p-values,
so we change the recursion to compute 1 - p directly while staying
within the "inside method" a described by Hodges.
We generally follow Hodges' treatment of Drion/Gnedenko/Korolyuk.
Hodges, J.L. Jr.,
"The Significance Probability of the Smirnov Two-Sample Test,"
Arkiv fiur Matematik, 3, No. 43 (1958), 469-86.
For the recursion for 1-p see
Viehmann, T.: "Numerically more stable computation of the p-values
for the two-sample Kolmogorov-Smirnov test," arXiv: 2102.08037
Examples
See :
Local connectivity graph
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows
or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted
(or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library
they belong to, and scaled with the number of references pointing them