# Fixed-Point Algorithm for Solving the Critical Value and Upper Tail Quantile
of Kuiper’s Statistics

Hong-Yan Zhang, Wei Sun, Xiao Chen, Rui-Jia Lin and Yu Zhou

School of Information Science and Technology, Hainan Normal University, Haikou
571158, China Corresponding author: Hong-Yan Zhang; email:
<EMAIL_ADDRESS>ORCID: 0000-0002-4400-9133

###### Abstract

Kuiper’s statistic is a good measure for the difference of ideal distribution
and empirical distribution in the goodness-of-fit test. However, it is a
challenging problem to solve the critical value and upper tail quantile, or
simply Kuiper pair, of Kuiper’s statistics due to the difficulties of solving
the nonlinear equation and reasonable approximation of infinite series. In
this work, the contributions lie in three perspectives: firstly, the second
order approximation for the infinite series of the cumulative distribution of
the critical value is used to achieve higher precision; secondly, the
principles and fixed-point algorithms for solving the Kuiper pair are
presented with details; finally, finally, a mistake about the critical value
$c^{\alpha}_{n}$ for $(\alpha,n)=(0.01,30)$ in Kuiper’s distribution table has
been labeled and corrected where $n$ is the sample capacity and $\alpha$ is
the upper tail quantile. The algorithms are verified and validated by
comparing with the table provided by Kuiper. The methods and algorithms
proposed are enlightening and worth of introducing to the college students,
computer programmers, engineers, experimental psychologists and so on.
Kerwords: Kuiper’s statistic; Upper tail quantile; Fixed-point; Numerical
approximation; Algorithm Design; STEM education

###### Contents

  1. 1 Introduction
  2. 2 Preliminaries
    1. 2.1 Principle of Iterative Method for Fixed-Point
    2. 2.2 Unified Framework and Algorithm for Solving Fixed-point
  3. 3 Computational Method of Critical Value and Quantile for Kuiper’s Test
    1. 3.1 Computation of Kuiper’s Critical Value in $V_{n}$-test
      1. 3.1.1 Direct Iterative Method
      2. 3.1.2 Newton’s Iterative Method
      3. 3.1.3 Kuiper’s Pair for Kuiper’s $V_{n}$-test
    2. 3.2 Computation of the Pairs for Kuiper’s $V_{n,n}$-Test
  4. 4 Fixed-Point Algorithms for Solving the Pair of Kuiper’s Test
    1. 4.1 Auxiliary Procedures
    2. 4.2 Updating Mapping
    3. 4.3 Algorithms for Solving the Kuiper Pair for $V_{n}$-test and $V_{n,n}$-test
    4. 4.4 Algorithms for Solving the Upper/Lower Tail Quantile and Inverse of CDF
  5. 5 Verification and Validation
    1. 5.1 An Error in Kuiper’s Numerical Results
    2. 5.2 Table of Kuiper pair of $V_{n}$-test for $n=10$
    3. 5.3 Special case of Sufficiently Large Number of Samples
    4. 5.4 Kuiper pair for Kuiper’s $V_{n,n}$-test
    5. 5.5 Cumulative Distribution Function for Kuiper’s $V_{n}$-test
  6. 6 Discussion
    1. 6.1 An Alternative Choice of Non-linear Function for $V_{n}$-test
    2. 6.2 Choices of Initial Value for the Critical Value
    3. 6.3 Limitation of Kuiper’s First Order Approximation for the Cumulative Distribution Function
  7. 7 Conclusion

##  1 Introduction

In statistics, for two cumulative distribution functions (CDF) $F_{1}(x)$ and
$F_{2}(x)$, Kuiper’s test [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] is defined by

$V=D^{+}+D^{-}=\sup_{x}[F_{1}(x)-F_{2}(x)]+\sup_{x}[F_{2}(x)-F_{1}(x)]$ (1)

where the discrepancy statistics

$D^{+}=\sup_{x\in\mathbb{R}}[F_{1}(x)-F_{2}(x)],\quad
D^{-}=\sup_{x\in\mathbb{R}}[F_{2}(x)-F_{1}(x)]=-\inf_{x\in\mathbb{R}}[F_{1}(x)-F_{2}(x)]$
(2)

represent the maximum deviation above and below the two cumulative
distribution functions being compared, respectively. The trick with Kuiper’s
test is to use the quantity $D^{+}+D^{-}$ as the test statistic instead of
$\displaystyle\sup_{x}\left|F_{1}(x)-F_{2}(x)\right|$ in Kolmogrov-Smirnov
test. This small change makes Kuiper’s test as sensitive in the tails as at
the median and also makes it invariant under cyclic transformations of the
independent variable. The Kuiper’s test is useful for the goodness-of-fit
test, also named by distribution fitting test. Exactly speaking, there are two
types of Kuiper’s test [1]

  * •

$V_{n}$-test, which is used for comparing two distributions with $n$ samples;

  * •

$V_{n,m}$-test, which is used for comparing two distributions with $n$ and $m$
samples respectively.

Suppose that $F_{V_{n}}(x)$ is the CDF of the Kuiper’s statistic $V_{n}$,
$\alpha$ is the upper tail probability111The upper tail probability will be
the upper tail significance level or the probability of first type error in
hypothesis test. for the Kuiper’s test statistic and $v^{\alpha}_{n}$ is the
upper tail quantile (UTQ, also named upper tail fractile) for $V_{n}$, then

$\alpha=\Pr\left\\{V_{n}>v^{\alpha}_{n}\right\\}=1-\Pr\left\\{V_{n}\leq
v^{\alpha}_{n}\right\\}=1-F_{V_{n}}(v^{\alpha}_{n}).$ (3)

Formally, we have

$v^{\alpha}_{n}=F^{-1}_{V_{n}}(1-\alpha).$ (4)

For $\forall\alpha\in[0,1]$, we always have

$v_{1-\alpha}^{n}=v^{\alpha}_{n}$ (5)

where $v_{1-\alpha}^{n}$ is the lower tail quantile for the lower tail
probability $1-\alpha$. Therefore,

$v_{\alpha}^{n}=v^{1-\alpha}_{n}=F^{-1}_{V_{n}}(\alpha),\quad\forall\alpha\in[0,1],$
(6)

which implies that solving the lower or upper tail probability is equivalent
to solve the inverse of the CDF. Unfortunately, there is no simple expression
for $F_{V_{n}}(\cdot)$ and it is difficult to calculate the inverse
$F^{-1}_{V_{n}}(\cdot)$.

Moreover, for sufficiently large $n$, the statistic
$V_{n}=D^{+}_{n}+D^{-}_{n}$ will approach to $0$, which implies that the curve
of $F_{V_{n}}(x)$ will become more and more steep with the increasing of $n$
and

$\lim_{n\to\infty}F_{V_{n}}(x)=\left\\{\begin{aligned} 1,&&x\geq 0;\\\
0,&&x<0.\end{aligned}\right.$ (7)

Although the Kuiper’s test has been proposed for about 50 years, it is not
widely known to college students, computer programmers, engineers,
experimental psychologist and so on partly due to the difficulty of solving
the upper tail quantile and partly due to the lack of open software for
automatic calculation. Let

$K_{n}=\sqrt{n}\cdot V_{n}=\sqrt{n}\cdot(D^{+}_{n}+D^{-}_{n})$ (8)

be the Kuiper’s $K_{n}$ statistic of critical value for the $V_{n}$-test,
Kuiper [1, 11] pointed out that

$\displaystyle\Pr\left\\{K_{n}\leq
c\right\\}=1-\sum^{\infty}_{j=1}2(4j^{2}c^{2}-1)\mathrm{e}^{-2j^{2}c^{2}}+\frac{8}{3\sqrt{n}}c\sum^{\infty}_{j=1}j^{2}(4j^{2}c^{2}-3)\mathrm{e}^{-2j^{2}c^{2}}+\mathcal{O}\left(\frac{1}{n}\right),$
(9)

for the positive critical value $c$. It should be noted that the upper bound
for the approximation error is $\mathcal{O}\left(n^{-1}\right)$, which implies
this formula is appropriate for large sample capacity $n$. Kuiper’ s
approximation

$\alpha=\Pr\left\\{K_{n}>c\right\\}\approx\left[-2+\frac{8}{\sqrt{n}}c+8c^{2}-\frac{32}{3\sqrt{n}}c^{3}\right]\mathrm{e}^{-2c^{2}},\quad
c>\frac{6}{5},$ (10)

for solving $c$ is based on the terms in which $j=1$ of the two infinite
series in (9). There are some disadvantages for this approximation:

  * •

the terms in which $j=2$ in the two infinite series have been ignored, which
not only reduces the numerical precision of the solution $c$ due to the term
$\mathcal{O}\left(n^{-1}\right)$ for small $n$ but also reduces the feasible
region for the initial value of $c$, denoted by ${c}_{\mathrm{guess}}$, in
numerical computation;

  * •

the condition $c>6/5$ is not appropriate and smaller lower bound for $c$ is
allowed.

Stephens [2] proposed the modified statistic for the replacement of $V_{n}$,
but his approximation

$\alpha=(8c^{2}-2)\mathrm{e}^{-2c^{2}},$ (11)

is based on the first term of the first infinite series in (12). Obviously,
this approximation does not depend on the parameter $n$ and its precision will
be affected significantly. In other words, this approximation just works well
for sufficiently large $n$, which means that the number of random samples
should be large enough in the sense of data analysis. Furthermore, Kuiper
discussed the $V_{n,n}$-test but Stephens ignored it. It is a common dark side
of both Kuiper’s work and Stephens’s work that there are lack of numerical
algorithms for solving the numerical solution to the critical value $c$ for
the given upper tail probability $\alpha$ in the era of 1960s and 1970s when
only a few people can use computers and the computer science was not fully
developed.

It is easy to find that the two infinite sequences in (9) converge rapidly and
it is a better approximation if we consider the first two terms when compared
with the schemes taken by Kuiper and Stephens. By taking the first two terms
for the infinite series, we can deduce that

$\displaystyle\alpha$
$\displaystyle=\Pr\left\\{K_{n}>c\right\\}=\sum^{\infty}_{j=1}2(4j^{2}c^{2}-1)\mathrm{e}^{-2j^{2}c^{2}}-\frac{8}{3\sqrt{n}}c\sum^{\infty}_{j=1}j^{2}(4j^{2}c^{2}-3)\mathrm{e}^{-2j^{2}c^{2}}+\mathcal{O}\left(\frac{1}{n}\right)$
(12)
$\displaystyle\approx\left[2(4c^{2}-1)-\frac{8}{3\sqrt{n}}c(4c^{2}-3)\right]\mathrm{e}^{-2c^{2}}+\left[2(16c^{2}-1)-\frac{32}{3\sqrt{n}}c(16c^{2}-3)\right]\mathrm{e}^{-8c^{2}}$
$\displaystyle=\left[-2+\frac{8}{\sqrt{n}}c+8c^{2}-\frac{32}{3\sqrt{n}}c^{3}\right]\mathrm{e}^{-2c^{2}}+\left[-2+\frac{32}{\sqrt{n}}c+32c^{2}-\frac{512}{3\sqrt{n}}c^{3}\right]\mathrm{e}^{-8c^{2}}.$

This approximation is a second order approximation for infinite series about
the index $j$, which is more reasonable due to the term
$\mathcal{O}\left(n^{-1}\right)$ in (12).

In this paper, our emphasis is put on the numerical algorithms for automatic
approaches for solving the upper tail critical value and quantile of Kuiper’s
statistic. The contents of this paper are organized as follows: Section 2
gives the preliminaries about the principle and algorithm for fixed-point
equation; Section 3 focuses on the computational method for solving Kuiper’s
pairs of $V_{n}$-test and $V_{n,n}$-test; Section 4 presents the algorithms
with pseudo-code; Section 5 demonstrates the numerical results which is
comparable with Kuiper’s original results; Section 6 discussed the impact of
the choices of nonlinear equation and initial value on the numerical solution;
and finally Section 7 is the conclusion.

##  2 Preliminaries

###  2.1 Principle of Iterative Method for Fixed-Point

Although there are various fixed-point theorems [12, 13] for different
situation and applications, we just consider the fixed-point iterative method
for solving nonlinear equations according to our objective of solving Kuiper’s
pairs $\left\langle{c^{\alpha}_{n}},{v^{\alpha}_{n}}\right\rangle$ and
$\left\langle{c^{\alpha}_{n,n}},{v^{\alpha}_{n,n}}\right\rangle$.

For a nonlinear equation

$f(x)=0,\quad x\in[a,b]$ (13)

usually we can convert it into a fixed-point equation equivalently

$x=T(f,x),\quad x\in[a,b]$ (14)

where $f(\cdot)$ is a mapping and $T(\cdot,\cdot)$ is a contractive operator.
There are two typical categories of fixed-point equation:

  * (i)

Direct iterative scheme

$x_{i+1}=T({f}_{\mathrm{ctm}}(x_{i}),x_{i})={f}_{\mathrm{ctm}}(x_{i})$ (15)

which depends on the function ${f}_{\mathrm{ctm}}$.

  * (ii)

Newton’s iterative scheme

$x_{i+1}=T({f}_{\mathrm{nlm}}(x_{i}),x_{i})=x_{i}-\frac{{f}_{\mathrm{nlm}}(x_{i})}{{f}_{\mathrm{nlm}}^{\prime}(x_{i})},$
(16)

which depends not only on the equivalent nonlinear mapping
${f}_{\mathrm{nlm}}(x)$ from

$\phi(x)=0\Longleftrightarrow{f}_{\mathrm{nlm}}(x)=0$ (17)

but also on its derivative ${f}_{\mathrm{nlm}}^{\prime}(x)$.

We remark that the strings ”ctm” and ”nlm” in the subscripts means contractive
mapping and nonlinear mapping respectively.

The initial value, say ${x}_{\mathrm{guess}}$, should be set carefully since
there is a domain for the contractive mapping $T$ generally. For
mathematicians, it is necessary to prove the feasibility of choice
${x}_{\mathrm{guess}}$. For engineers and computer programmers, they may
prefer to draw the curve of $y=x-T(f,x)$ for $x\in[a,b]$ and observe the
interval for of the root to set the initial value ${x}_{\mathrm{guess}}$,
which is more intuitive and efficient than rigorous mathematical analysis.

The stopping condition for the iterative method is satisfied by the Cauchy’s
criteria for the convergent sequence $\left\\{x_{i}:i=0,1,2,3,\cdots\right\\}$

$d(x_{i+1},x_{i})<\epsilon$ (18)

where $\epsilon$ denotes the precision and $d(\cdot,\cdot)$ is a metric for
the difference of the current value of $x$, say ${x}_{\mathrm{guess}}$ and its
updated version, say ${x}_{\mathrm{improve}}$. The simplest choice of
$d(\cdot,\cdot)$ is the absolute value function for $x\in[a,b]\in\mathbb{R}$,
i.e.,

$d(x_{i},x_{i+1})=d(x_{i+1},x_{i})=\left|x_{i+1}-x_{i}\right|$ (19)

For practical problems arising in various fields, there may be some extra
parameters in the function $\phi$, say $\phi(x,\alpha,n)$ where $\alpha$ is a
real number, $n$ is an integer, where the order of $x,\alpha,n$ is not
important222In other words, both $\phi(x,\alpha,n)$ and $\phi(x,n,\alpha)$ are
feasible and correct for computer programming.. In general, we can use the
notations $\phi(x,\mu_{1},\cdots,\mu_{r}),f(x,\mu_{1}\cdots\mu_{r})$ and
$T(f,x,\mu_{1},\cdots,\mu_{r})$ to represent the scenario when there are some
extra parameters. We remark that the derivative of $f(x,\mu_{1},\cdots,m_{r})$
with respect to the variable $x$ should be calculated by

$f^{\prime}(x,\mu_{1},\cdots\mu_{r})=\lim_{\Delta x\to 0}\frac{f(x+\Delta
x,\mu_{1},\cdots,\mu_{r})-f(x,\mu_{1},\cdots,\mu_{r})}{\Delta x}$ (20)

for the Newton’s iterative method.

It should be remarked the abstraction level is essential for designing
feasible algorithm to solve the fixed-point of the form

$x=T(f,x,\mu_{1},\cdots,\mu_{r})=\mathcal{T}^{*}_{\star}(f,x),\quad x\in[a,b]$
(21)

for the contractive mapping $T$ or its equivalent form
$\mathcal{T}^{*}_{\star}$, which is called the updating function in
programming language. Note that the extra parameters $\mu_{1},\cdots,\mu_{r}$
are moved to upper subscript $*$ and subscript $\star$ such that
$(*,\star)=(\mu_{1},\cdots,\mu_{r})$ in order to emphasize the key variable
$x$ and function $f$. In the sense of functional analysis, the $T$ or
$\mathcal{T}^{*}_{\star}$ in (21) is an abstract function. By comparison, in
the sense of programming language in computer science, the $T$ or
$\mathcal{T}^{*}_{\star}$ is a high order function and $f$ is a function
object which is called a pointer to function in C/C++98, or a
$\lambda$-expression in Lisp/Haskell/Julia/Python/C++11/Java, or function
handle in Octave/MATLAB, and so on.

###  2.2 Unified Framework and Algorithm for Solving Fixed-point

We now give the pseudo-code for the fixed-point algorithms with the concepts
of high order function and function object, please see Algorithm 2.2. Note
that the order for the list of arguments can be set according to the
programmer’s preferences. If a default value for the ${x}_{\mathrm{guess}}$
should be configured, it is wise to set the ${x}_{\mathrm{guess}}$ as the last
formal argument for the convenience of implementation with some concrete
computer programming language such as the C++.

Algorithm 1 Unified Framework for Solving the Fixed-Point of
$x=\mathcal{T}^{*}_{\star}(f,x)=T(f,x,\mu_{1},\cdots,\mu_{r})$

1:Contractive mapping $T$ as the updator which is a high order function,
function object $f$ for the ${f}_{\mathrm{nlm}}$ or ${f}_{\mathrm{ctm}}$,
function object $d$ for the distance $d(x_{i},x_{i+1})$, precision $\epsilon$,
initial value ${x}_{\mathrm{guess}}$ and extra parameters
$\mu_{1},\cdots,\mu_{r}$ with the same or different data types.

2:Fixed-point $x$ such that
$x=\mathcal{T}^{*}_{\star}(f,x)=T(f,x,\mu_{1},\cdots,\mu_{r})$

3:function
FixedPointSolver($T,f,d,\epsilon,{x}_{\mathrm{guess}},\mu_{1},\cdots,\mu_{r}$)

4: ${x}_{\mathrm{improve}}\leftarrow
T(f,{x}_{\mathrm{guess}},\mu_{1},\cdots,\mu_{r})$;

5: while $d({x}_{\mathrm{improve}},{x}_{\mathrm{guess}})\geq\epsilon$ do

6: ${x}_{\mathrm{guess}}\leftarrow{x}_{\mathrm{improve}}$;

7: ${x}_{\mathrm{improve}}\leftarrow
T(f,{x}_{\mathrm{guess}},\mu_{1},\cdots,\mu_{r})$;

8: end while

9: return ${x}_{\mathrm{improve}}$;

10:end function

In the sense of programming language and discrete mathematics, $f$ is an
ordinary (first order) function, $T$ is a second order function and
FixedPointSolve is a third order function.

Algorithm 2 Calculate the distance of $x$ and $y$

1:$x,y\in\mathbb{R}$

2:The distance of $x$ and $y$, i.e., $d(x,y)$

3:function Distance($x,y$)

4: $\texttt{dist}\leftarrow\left|x-y\right|$; // if
$x,y\in\mathbb{R}^{{n}\times{1}}$, we can use the $\ell^{p}$-norm to get the
distance by ${\left\lVert x-y\right\rVert}_{p}$

5: return dist;

6:end function

##  3 Computational Method of Critical Value and Quantile for Kuiper’s Test

In this paper, our key issue here is to design algorithm to compute the
$F^{-1}_{V_{n}}(1-\alpha)$ for the given upper tail quantile $\alpha$ and the
integer $n$.

###  3.1 Computation of Kuiper’s Critical Value in $V_{n}$-test

Put

$A_{1}(c,n)=-2+\frac{8}{\sqrt{n}}c+8c^{2}-\frac{32}{3\sqrt{n}}c^{3},\quad
A_{2}(c,n)=-2+\frac{32}{\sqrt{n}}c+32c^{2}-\frac{512}{3\sqrt{n}}c^{3}$ (22)

and substitute (22) into (12), we can obtain the key equation for specifying
the critical value $c$ for the given $\alpha$ and $n$ as follows

$\boxed{2c^{2}+\ln\alpha=\ln\left[A_{1}(c,n)+A_{2}(c,n)\cdot\mathrm{e}^{-6c^{2}}\right]}.$
(23)

Let

${f}_{\mathrm{nlm1}}(c,\alpha,n)=2c^{2}+\ln\alpha-\ln\left[A_{1}(c,n)+A_{2}(c,n)\cdot\mathrm{e}^{-6c^{2}}\right],$
(24)

where the digit 1 in the string ”nlm1” means single $n$ for the notation
$V_{n}$, then the critical value $c_{\alpha}$ is the solution of the following
non-linear equation

${f}_{\mathrm{nlm1}}(c,\alpha,n)=0$ (25)

where ${f}_{\mathrm{nlm1}}$ is a concrete version of
$\phi(x,\mu_{1},\cdots,\mu_{r})=0$ with two extra parameters $\mu_{1}=\alpha$
and $\mu_{2}=n$. There are various methods for solving non-linear equation
(25) and our method is based on the fixed-point theorem [12] and iterative
algorithm.

A necessary condition for (12) is that $\alpha=\Pr\left\\{\sqrt{n}\cdot
V_{n}>c\right\\}>0$ for any $n\in\mathbb{N}$. Let $n\to\infty$, we immediately
have

$A_{1}(\infty,c)=-2+8c^{2}>0,\quad A_{2}(\infty,c)=-2+32c^{2}>0.$ (26)

Thus, we get the following necessary condition

$c>\frac{1}{2}$ (27)

for the function $g(c,\alpha,n)$. Kuiper [1] pointed out that a necessary
condition for $c$ is $c>6/5=1.2$ when the first term is considered in the
infinite series for (12). On the other hand, the larger the $n$ is, the larger
$c$ is feasible according to the definition of critical value in the sense of
large samples in statistics. Hence for fixed $\alpha$ and $n\to\infty$, we can
find that $c^{\alpha}_{\infty}$ gives the upper bound of the variable $c$. For
$\alpha=10^{-10}$, we can find that $c^{\alpha}_{\infty}\approx 3.7226<4$.

####  3.1.1 Direct Iterative Method

Let

${f}_{\mathrm{ctm1}}(c,\alpha,n)=\sqrt{\frac{\ln\left[A_{1}(c,n)+A_{2}(c,n)\cdot\mathrm{e}^{-6c^{2}}\right]-\ln\alpha}{2}},$
(28)

then (23) implies that

$c=\mathcal{A}^{\alpha}_{n}({f}_{\mathrm{ctm1}},c)={f}_{\mathrm{ctm1}}(c,\alpha,n).$
(29)

It is easy to verify that
$\mathcal{A}^{\alpha}_{n}({f}_{\mathrm{ctm1}},\cdot)$ is a contractive mapping
for the given positive integer $n$ and upper tail probability $\alpha\in(0,1)$
for appropriate domain of $c$, say $c\in(0.5,2.5)$. Consequently, the fixed-
point theorem implies that the iterative formula

$c_{i+1}=\mathcal{A}^{\alpha}_{n}({f}_{\mathrm{ctm1}},c_{i}),\quad
i=0,1,2,\cdots$ (30)

must converge if the initial value ${c}_{\mathrm{guess}}\in(0.5,2.5)$.

(a) $\alpha=0.10,n=30,c^{\alpha}_{n}=1.5503$

(b) $\alpha=0.05,n=30,c^{\alpha}_{n}=1.6758$

(c) $\alpha=0.02,n=30,c^{\alpha}_{n}=1.8235$

(d) $\alpha=0.01,n=30,c^{\alpha}_{n}=1.9252$

Figure 1: The intersection of $y=c$ and
$y=\mathcal{A}^{\alpha}_{n}({f}_{\mathrm{ctm1}},c)={f}_{\mathrm{ctm1}}(c,\alpha,n)$
for $\alpha\in\left\\{0.10,0.05,0.02,0.01\right\\}$ and $n=30$.

Figure 1 demonstrates the intersection of
$y=\mathcal{A}^{\alpha}_{n}({f}_{\mathrm{ctm1}},c)$ and $y=c$ clearly. It is
easy to find that the absolute value of the derivative
$\left|\frac{\operatorname{d}{}}{\operatorname{d}{c}}\mathcal{A}^{\alpha}_{n}({f}_{\mathrm{ctm1}},c)\right|<1$
(and it is small enough) for $c\in(0.5,3)$ such that
$\mathcal{A}^{\alpha}_{n}({f}_{\mathrm{ctm1}},c)$ is a good contractive
mapping. For $(\alpha,n)=(0.10,30)$ and $(\alpha,n)=(0.05,30)$, there are two
intersection points for the line $y=c$ and the curve
$y=\mathcal{A}^{\alpha}_{n}({f}_{\mathrm{ctm1}},c)$, and the solutions
$c^{\alpha}_{n}<0.5$ are discarded. For $(\alpha,n)=(0.02,30)$ and
$(\alpha,n)=(0.01,30)$, there is just one intersection point for the line
$y=c$ and the curve $y=\mathcal{A}^{\alpha}_{n}({f}_{\mathrm{ctm1}},c)$, and
the feasible solution $c^{\alpha}_{n}$ is larger than $1.5$. It is obvious
that for the fixed $n$, the smaller the $\alpha$ is, the larger the
$c^{\alpha}_{n}$ is.

####  3.1.2 Newton’s Iterative Method

The Newton’s iterative formula for Kuiper’s $V_{n}$-test can be written by

$c_{i+1}=\mathcal{B}^{\alpha}_{n}({f}_{\mathrm{nlm1}},c_{i})$ (31)

where

$\mathcal{B}^{\alpha}_{n}({f}_{\mathrm{nlm1}},c)=c-\frac{{f}_{\mathrm{nlm1}}(c,\alpha,n)}{{f}_{\mathrm{nlm1}}(c,\alpha,n)},$
(32)

is the Newton’s updating function. The mapping
$\mathcal{B}^{\alpha}_{n}({f}_{\mathrm{nlm1}},c)$ is a contractive mapping for
appropriate domain of $c$, say $c\in(1,2)$. The initial value for the Newton’s
iterative method could be set by ${c}_{\mathrm{guess}}=1.2$.

(a) $\alpha=0.10,n=30,c^{\alpha}_{n}=1.5503$

(b) $\alpha=0.05,n=30,c^{\alpha}_{n}=1.6758$

(c) $\alpha=0.02,n=30,c^{\alpha}_{n}=1.8235$

(d) $\alpha=0.01,n=30,c^{\alpha}_{n}=1.9252$

Figure 2: Curve and root of ${f}_{\mathrm{nlm1}}(c,\alpha,n)$ for
$\alpha\in\left\\{0.10,0.05,0.02,0.01\right\\}$ and $n=30$

Figure 2 shows the curve of ${f}_{\mathrm{nlm1}}(c,\alpha,n)$ for $c\in(0,3)$
and fixed $\alpha$ and $n$. It should be noted that the necessary condition
$c>1/2$ automatically rejects the possible root which lies in the open
interval $(0,0.5)$. Although the diagram in Figure 2 is different its
counterpart in Figure 1, the solution $c^{\alpha}_{n}$ obtained with the
Newton’s iterative method via ${f}_{\mathrm{nlm1}}(c,\alpha,n)$ is the same as
that obtained by the direct iterative method via
${f}_{\mathrm{ctm1}}(c,\alpha,n)$.

####  3.1.3 Kuiper’s Pair for Kuiper’s $V_{n}$-test

With the help of the two contractive mappings
$\mathcal{A}^{\alpha}_{n}({f}_{\mathrm{ctm1}},\cdot)$ and
$\mathcal{B}^{\alpha}_{n}({f}_{\mathrm{nlm1}},\cdot)$, the fixed-point
$c^{\alpha}_{n}$ for the equation (23) can be solved with the direct iterative
method or Newton’s iterative method, which is the critical value such that
$\alpha=\Pr\left\\{K_{n}>c^{\alpha}_{n}\right\\}$. The relation of the
critical value $c^{\alpha}_{n}$ and upper tail probability $v^{\alpha}_{n}$
can be expressed by

$v^{\alpha}_{n}=\frac{c^{\alpha}_{n}}{\sqrt{n}}$ (33)

since we have

$\alpha=\Pr\left\\{\sqrt{n}\cdot
V_{n}>c^{\alpha}_{n}\right\\}=\Pr\left\\{V_{n}>c^{\alpha}_{n}/\sqrt{n}\right\\}=\Pr\left\\{V_{n}>v^{\alpha}_{n}\right\\}$
(34)

by the definitions of critical value and upper tail probability. Once the
critical value is obtained, the computation of upper tail quantile can be
solved according to (33). This completes the computation of the Kuiper’s pair
$\left\langle{c^{\alpha}_{n}},{v^{\alpha}_{n}}\right\rangle$ with the fixed-
point method.

###  3.2 Computation of the Pairs for Kuiper’s $V_{n,n}$-Test

For the Kuiper’s $V_{n,n}$-test, there is also a formula for the upper tail
probability [1, 14]

$1-\alpha=\Pr\left\\{\sqrt{n}\cdot V_{n,n}\leq
c\right\\}=1-\sum^{\infty}_{j=1}2(2j^{2}c^{2}-1)\mathrm{e}^{-j^{2}c^{2}}+\frac{1}{6n}\left[1+\sum^{\infty}_{j=1}j^{2}c^{2}(2j^{2}c^{2}-7)\mathrm{e}^{-j^{2}c^{2}}\right]+\mathcal{O}\left(\frac{1}{n^{2}}\right).$
(35)

We can approximate the infinite series with the first and second term as done
for the $V_{n}$-test, which implies that

$\displaystyle\alpha$ $\displaystyle\approx
2(2c^{2}-1)\mathrm{e}^{-c^{2}}+2(8c^{2}-1)\mathrm{e}^{-4c^{2}}-\frac{1}{6n}\left[1+c^{2}(2c^{2}-7)\mathrm{e}^{-c^{2}}+4c^{2}(8c^{2}-7)\mathrm{e}^{-4c^{2}}\right]$
(36)
$\displaystyle=-\frac{1}{6n}+\left[2(2c^{2}-1)-\frac{c^{2}(2c^{2}-7)}{6n}\right]\mathrm{e}^{-c^{2}}+\left[2(8c^{2}-1)-\frac{2c^{2}(8c^{2}-7)}{3n}\right]\mathrm{e}^{-4c^{2}}.$

Let

$U_{1}(c,n)=2(2c^{2}-1)-\frac{c^{2}(2c^{2}-7)}{6n}-\frac{\mathrm{e}^{c^{2}}}{6n},\quad
U_{2}(c,n)=2(8c^{2}-1)-\frac{2c^{2}(8c^{2}-7)}{3n},$ (37)

then we can deduce that

$\boxed{c^{2}+\ln\alpha=\ln\left[U_{1}(c,n)+U_{2}(c,n)\mathrm{e}^{-3c^{2}}\right]}.$
(38)

Let

${f}_{\mathrm{nlm2}}(c,\alpha,n)=c^{2}+\ln\alpha-\ln\left[U_{1}(c,n)+U_{2}(c,n)\mathrm{e}^{-3c^{2}}\right]$
(39)

where the digit $2$ in the subscript ”nlm2” denotes the double $n$ in
$V_{n,n}$ and

$\mathcal{A}^{\alpha}_{n,n}({f}_{\mathrm{ctm2}},c)={f}_{\mathrm{ctm2}}(c,\alpha,n)=\sqrt{\ln\left[U_{1}(c,n)+U_{2}(c,n)\mathrm{e}^{-3c^{2}}\right]-\ln\alpha}$
(40)

We also can construct two iterative formulas for solving the nonlinear
equation

${f}_{\mathrm{nlm2}}(c,\alpha,n)=0$ (41)

to solve the $c^{\alpha}_{n,n}$ as follows:

  * •

Newton’s iterative method:

$c_{i+1}=\mathcal{B}^{\alpha}_{n,n}({f}_{\mathrm{nlm2}},c_{i})=c_{i}-\frac{{f}_{\mathrm{nlm2}}(c_{i},\alpha,n)}{{f}_{\mathrm{nlm2}}^{\prime}(c_{i},\alpha,n)}$
(42)

  * •

direct iterative method:

$c_{i+1}=\mathcal{A}^{\alpha}_{n,n}({f}_{\mathrm{ctm2}},c_{i})={f}_{\mathrm{ctm2}}(c_{i},\alpha,n)=\sqrt{\ln\left[U_{1}(c_{i},n)+U_{2}(c_{i},n)\mathrm{e}^{-3c_{i}^{2}}\right]-\ln\alpha}$
(43)

Just like the process of solving $c^{\alpha}_{n}$, the $c^{\alpha}_{n,n}$
defined by

$\alpha=\Pr\left\\{\sqrt{n}\cdot V_{n,n}>c^{\alpha}_{n,n}\right\\}$ (44)

is the limit of the sequence $c_{0},c_{1},c_{2},\cdots$ generated by
$\mathcal{A}^{\alpha}_{n,n}({f}_{\mathrm{ctm2}},c)$ and
$\mathcal{B}^{\alpha}_{n,n}({f}_{\mathrm{nlm2}},c)$. The initial value for
solving $c^{\alpha}_{n,n}$ can be observed from the figure of
$y={f}_{\mathrm{nlm2}}(c,\alpha,n)$ with the variable $c$ intuitively. It
should be noted that there is no modified version of the $V_{n,n}$-test due to
the error bound for the approximation in (35) is
$\mathcal{O}\left(n^{-2}\right)$ instead of $\mathcal{O}\left(n^{-1}\right)$.

(a) $\alpha=0.10,n=30,c^{\alpha}_{n}=2.2740$

(b) $\alpha=0.05,n=30,c^{\alpha}_{n}=2.4430$

(c) $\alpha=0.02,n=30,c^{\alpha}_{n}=2.6266$

(d) $\alpha=0.01,n=30,c^{\alpha}_{n}=2.7351$

Figure 3: Intersection of $y=c$ and
$y=\mathcal{A}^{\alpha}_{n,n}({f}_{\mathrm{ctm2}},\alpha,n)={f}_{\mathrm{ctm2}}(c,\alpha,n)$
for $\alpha\in\left\\{0.10,0.05,0.02,0.01\right\\}$ and $n=30$.

(a) $\alpha=0.10,n=30,c^{\alpha}_{n}=2.2740$

(b) $\alpha=0.05,n=30,c^{\alpha}_{n}=2.4430$

(c) $\alpha=0.02,n=30,c^{\alpha}_{n}=2.6266$

(d) $\alpha=0.01,n=30,c^{\alpha}_{n}=2.7351$

Figure 4: Curve and root of ${f}_{\mathrm{nlm2}}(c,\alpha,n)=0$ for
$\alpha\in\left\\{0.10,0.05,0.02,0.01\right\\}$ and $n=30$.

As an illustration, Figure 3 shows the critical value $c^{\alpha}_{n,n}$ of
the statistic $V_{n,n}$ with the direct iterative method via
${f}_{\mathrm{ctm2}}(c,\alpha,n)$, in which
$\alpha\in\left\\{0.10,0.05,0.02,0.01\right\\}$ and $n=30$. Similarly, Figure
4 shows the counterpart of $c^{\alpha}_{n,n}$ with the Newton’s iterative
method via ${f}_{\mathrm{nlm2}}(c,\alpha,n)$. It should be noted that when the
$\alpha$ decreases, the critical value $c^{\alpha}_{n,n}$ increases.

##  4 Fixed-Point Algorithms for Solving the Pair of Kuiper’s Test

###  4.1 Auxiliary Procedures

In order to reduce the structure complexity of our key algorithms for solving
the Kuiper’s pair
$\left\langle{c^{\alpha}_{n}},{v^{\alpha}_{n}}\right\rangle$, it is wise to
introduce some auxiliary procedures. The procedures FunA1cn and FunA2cn in
Algorithm 4.1 and Algorithm 4.1 are designed for computing $A_{1}(c,n)$ and
$A_{2}(c,n)$ respectively.

Algorithm 3 Calculating the value of $A_{1}(c,n)$ arising in the updating
function in $V_{n}$-test

1:Positive critical value $c$, positive integer $n$

2:The value of $A_{1}(c,n)$.

3:function FunA1cn($c,n$)

4: $A_{1}\leftarrow-2+8c/\sqrt{n}+8c^{2}-32c^{3}/(3\sqrt{n})$;

5: return $A_{1}$;

6:end function

Algorithm 4 Calculating the value of $A_{2}(c,n)$ arising in the $V_{n}$-test

1:Positive critical value $c$, positive integer $n$

2:The value of $A_{2}(c,n)$.

3:function FunA2cn($c,n$)

4: $A_{2}\leftarrow-2+32c/\sqrt{n}+32c^{2}-512c^{3}/(3\sqrt{n})$;

5: return $A_{2}$;

6:end function

The procedures FunFnlm1 and FunFnlm2 in Algorithm 4.1 and Algorithm 4.1 are
designed for computing the non-linear functions
${f}_{\mathrm{nlm1}}(c,\alpha,n)$ for the $V_{n}$-test and
${f}_{\mathrm{nlm2}}(c,\alpha,n)$ for the $V_{n,n}$-test respectively.

Algorithm 5 Calculating the value of ${f}_{\mathrm{nlm1}}(c,\alpha,n)$ for the
updating function in $V_{n}$-test

1:Positive critical value $c$, upper tail probability $\alpha$, integer $n$

2:The value of ${f}_{\mathrm{nlm1}}(c,\alpha,n)$.

3:function FunFnlm1($c,\alpha,n$)

4: $A_{1}\leftarrow\textsc{FunA1cn}(c,n)$;

5: $A_{2}\leftarrow\textsc{FunA2cn}(c,n)$;

6: $u\leftarrow
2c^{2}+\ln\alpha-\ln\left(A_{1}+A_{2}\cdot\mathrm{e}^{-6c^{2}}\right)$;

7: return $u$;

8:end function

Algorithm 6 Calculating the value of ${f}_{\mathrm{nlm2}}(c,\alpha,n)$ for the
updating function in $V_{n,n}$-test

1:Positive critical value $c$, upper tail probability $\alpha$, integer $n$

2:The value of ${f}_{\mathrm{nlm2}}(c,\alpha,n)$.

3:function FunFnlm2($c,\alpha,n$)

4: $x\leftarrow c^{2}$;

5: $U_{1}\leftarrow 2(2x-1)-x(2x-7)/(6n)-\mathrm{e}^{x}/(6n)$;

6: $U_{2}\leftarrow 2(8x-1)-2x(8x-7)/(3n)$;

7: $u\leftarrow x+\ln\alpha-\ln\left(U_{1}+U_{2}\cdot\mathrm{e}^{-3x}\right)$;

8: return $u$;

9:end function

The procedures FunFctm1 and FunFctm2 in Algorithm 4.1 and Algorithm 4.1 are
designed for computing the non-linear functions
${f}_{\mathrm{ctm1}}(c,\alpha,n)$ for the $V_{n}$-test and
${f}_{\mathrm{nct2}}(c,\alpha,n)$ for the $V_{n,n}$-test respectively.

Algorithm 7 Calculating the ${f}_{\mathrm{ctm1}}(c,\alpha,n)$ for the updating
operator $\mathcal{A}^{\alpha}_{n}(f,c)$ in $V_{n}$-test

1:Positive critical value $c$, upper tail probability $\alpha$, integer $n$

2:The value of the direct updating function $\mathcal{A}^{\alpha}_{n}(c)$.

3:function FunFctm1($c,\alpha,n$)

4: $A\leftarrow\textsc{FunA1cn}(c,n)$;

5: $B\leftarrow\textsc{FunA2cn}(c,n)$;

6:
$y\leftarrow\sqrt{\left(\ln(A+B\cdot\mathrm{e}^{-6c^{2}})-\ln\alpha\right)/2}$;

7: return $y$;

8:end function

Algorithm 8 Calculating the ${f}_{\mathrm{ctm2}}(c,\alpha,n)$ for the updating
operator $\mathcal{A}^{\alpha}_{n,n}(f,c)$ in $V_{n,n}$-test

1:Positive critical value $c$, pper tail probability $\alpha$, integer $n$

2:The value of the ${f}_{\mathrm{ctm2}}(c,\alpha,n)$.

3:function FunFctm2($c,\alpha,n$)

4: $x\leftarrow c^{2}$;

5: $U_{1}\leftarrow 2(2x-1)-x(2x-7)/(6n)-\mathrm{e}^{x}/(6n)$;

6: $U_{2}\leftarrow 2(8x-1)-2x(8x-7)/(3n)$;

7: $y\leftarrow\sqrt{\ln(U_{1}+U_{2}\cdot\mathrm{e}^{-3x})-\ln\alpha}$;

8: return $y$;

9:end function

###  4.2 Updating Mapping

The updating mapping is essential for the iterative scheme for solving the
fixed-point. The high order procedure UpdateMethodDirect in Algorithm 4.2 is
designed for computing the contractive mapping $\mathcal{A}^{\alpha}_{n}(f,c)$
for the $V_{n}$-test and $\mathcal{A}^{\alpha}_{n,n}(f,c)$ for the
$V_{n,n}$-test with a unified interface for the direct iterative method.

Algorithm 9 Calculating the Contractive Mapping
$\mathcal{A}^{\alpha}_{n}(f,c)$ and $\mathcal{A}^{\alpha}_{n,n}(f,c)$

1:Contractive function ${f}_{\mathrm{ctm}}(c,\alpha,n)$, critical value $c$,
upper tail probability $\alpha$, integer $n$

2:The value of the direct updating function
$\mathcal{A}^{\alpha}_{n}({f}_{\mathrm{ctm1}},c)$ or
$\mathcal{A}^{\alpha}_{n,n}({f}_{\mathrm{ctm2}},c)$.

  * •

if ${f}_{\mathrm{ctm}}={f}_{\mathrm{ctm1}}$, then we get
$\mathcal{A}^{\alpha}_{n}({f}_{\mathrm{ctm1}},c)$ in $V_{n}$-test and

  * •

if ${f}_{\mathrm{ctm}}={f}_{\mathrm{ctm2}}$, then we get
$\mathcal{A}^{\alpha}_{n,n}({f}_{\mathrm{ctm2}},c)$ in $V_{n,n}$-test.

3:function UpdateMethodDirect(${f}_{\mathrm{ctm}},c,\alpha,n$)

4: $u\leftarrow{f}_{\mathrm{ctm}}(c,\alpha,n)$;

5: return $u$;

6:end function

Similarly, The high order procedure UpdateMethodNewton in Algorithm 4.2 is
designed for computing the contractive mapping $\mathcal{B}^{\alpha}_{n}(f,c)$
for the $V_{n}$-test and $\mathcal{B}^{\alpha}_{n,n}(f,c)$ for the
$V_{n,n}$-test with a unified interface for the Newton iterative method.

Algorithm 10 Calculating the Newton’s updating functions
$\mathcal{B}^{\alpha}_{n}({f}_{\mathrm{nlm}},c)$ and
$\mathcal{B}^{\alpha}_{n,n}({f}_{\mathrm{nlm}},c)$

1:Nonlinear function ${f}_{\mathrm{nlm}}(\alpha,n,c)$, upper tail probability
$\alpha$, integer $n$, critical value $c$

2:The value of the Newton’s updating function
$\mathcal{B}^{\alpha}_{n}({f}_{\mathrm{nlm}},c)$ or
$\mathcal{B}^{\alpha}_{n,n}({f}_{\mathrm{nlm}},c)$.

  * •

if ${f}_{\mathrm{nlm}}={f}_{\mathrm{nlm1}}$, then we get
$\mathcal{B}^{\alpha}_{n}({f}_{\mathrm{nlm1}},c)$ in $V_{n}$-test and

  * •

if ${f}_{\mathrm{nlm}}={f}_{\mathrm{nlm2}}$, then we get
$\mathcal{B}^{\alpha}_{n,n}({f}_{\mathrm{nlm2}},c)$ in $V_{n,n}$-test.

3:function UpdateMethodNewton(${f}_{\mathrm{nlm}},\alpha,n,c$)

4: $h\leftarrow 10^{-5}$;

5:
$\texttt{slope}\leftarrow\left({f}_{\mathrm{nlm}}(c+h,\alpha,n)-{f}_{\mathrm{nlm}}(c,\alpha,n)\right)/h$;
// Calculate the derivative ${f}_{\mathrm{nlm}}^{\prime}(c,\alpha,n)$

6: ${c}_{\mathrm{new}}\leftarrow
c-{f}_{\mathrm{nlm}}(c,\alpha,n)/\texttt{slope}$;

7: return ${c}_{\mathrm{new}}$;

8:end function

###  4.3 Algorithms for Solving the Kuiper Pair for $V_{n}$-test and
$V_{n,n}$-test

It is significant for us to calculate the original Kuiper pair
$\left\langle{c^{\alpha}_{\star}},{v^{\alpha}_{\star}}\right\rangle$ for
Kuiper’s $V_{\star}$-test where $V_{\star}\in\left\\{V_{n},V_{n,n}\right\\}$.
The procedure KuiperPairSolver listed in Algorithm 4.3 provides a unified
framework for solving the Kuiper pair
$\left\langle{c^{\alpha}_{\star}},{v^{\alpha}_{\star}}\right\rangle$ with the
Direct or Newton’s iterative method.

Algorithm 11 Fixed-point iterative algorithm for solving the Kuiper’s pair
$\left\langle{c^{\alpha}_{n}},{v^{\alpha}_{n}}\right\rangle$ in $V_{n}$-test
or $\left\langle{c^{\alpha}_{n,n}},{v^{\alpha}_{n,n}}\right\rangle$ in
$V_{n,n}$-test with the while-do loop and direct/Newton iterative method

1:The number of samples $n$, upper tail probability $\alpha\in(0,1)$, guess of
the critical value ${c}_{\mathrm{guess}}$ with default value
${c}_{\mathrm{guess}}=2.45$, integer $\texttt{method}\in\left\\{1,2\right\\}$
for the Direct/Newton iterative method with default value $\texttt{method}=2$
for the Newton’s iterative method, integer
$\texttt{type}\in\left\\{1,2\right\\}$ for the $V_{n}$-test and $V_{n,n}$-test
with default value 1.

2:The Kuiper pair
$\left\langle{c^{\alpha}_{\star}},{v^{\alpha}_{\star}}\right\rangle$ such that
$\alpha=\Pr\left\\{\sqrt{n}\cdot
V_{\star}>c^{\alpha}_{\star}\right\\}=\Pr\left\\{V_{\star}\geq
v^{\alpha}_{\star}\right\\}$ for $V_{\star}\in\left\\{V_{n},V_{n,n}\right\\}$.

3:function
KuiperPairSolver(${c}_{\mathrm{guess}},\alpha,n,\texttt{type},\texttt{method}$)

4: if ($\texttt{method}==1\land\texttt{type == 1}$) then

5: $\textsc{T}\leftarrow\textsc{UpdateMethodDirect}$; // using direct
iterative method

6: $f\leftarrow\textsc{FunFctm1}$; // Solve the fixed-point by
$c=\mathcal{A}^{\alpha}_{n}({f}_{\mathrm{ctm1}},c)$ in $V_{n}$-test

7: end if

8: if ($\texttt{method}==1\land\texttt{type == 2}$) then

9: $T\leftarrow\textsc{UpdateMethodDirect}$; // using direct iterative method

10: $f\leftarrow\textsc{FunFctm2}$; // Solve the fixed-point by
$c=\mathcal{A}^{\alpha}_{n,n}({f}_{\mathrm{ctm2}},c)$ in $V_{n,n}$-test

11: end if

12: if ($\texttt{method}==2\land\texttt{type == 1}$) then

13: $T\leftarrow\textsc{UpdateMethodNewton}$; // using Newton’s iterative
method

14: $f\leftarrow\textsc{FunFnlm1}$; // solve the nonlinear eq.
${f}_{\mathrm{nlm1}}(c,\alpha,n)=0$ in $V_{n}$-test

15: end if

16: if ($\texttt{method}==2\land\texttt{type == 2}$) then

17: $T\leftarrow\textsc{UpdateMethodNewton}$; // using Newton’s iterative
method

18: $f\leftarrow\textsc{FunFnlm2}$; // solve the nonlinear eq.
${f}_{\mathrm{nlm2}}(c,\alpha,n)=0$ in $V_{n,n}$-test

19: end if

20: $\epsilon\leftarrow 10^{-5}$;

21: $d\leftarrow\textsc{Distance}$; // distance function

22:
$c^{\alpha}_{\star}\leftarrow\textsc{FixedPointSolver}(T,f,d,\epsilon,{c}_{\mathrm{guess}},\alpha,n)$;

23: $v^{\alpha}_{\star}\leftarrow c^{\alpha}_{\star}/\sqrt{n}$;

24: return
$\left\langle{c^{\alpha}_{\star}},{v^{\alpha}_{\star}}\right\rangle$; //
Kuiper pair for the $V_{\star}$-test

25:end function

###  4.4 Algorithms for Solving the Upper/Lower Tail Quantile and Inverse of
CDF

For most applications, we may have no interest in the critical value
$c^{\alpha}_{n}$ and our emphasis is put on the upper/lower tail quantile
$v^{\alpha}_{n}=v_{1-\alpha}^{n}$ in $V_{n}$-test. Moreover, it is enough to
choose the Newton’s iterative method in order to find the upper/lower tail
quantile. In Algorithm 4.4, the procedure KuiperUTQ is designed to solve the
upper tail quantile. We remark that in the implementation of KuiperUTQ, the
procedure FixedPointSolver is used instead of KuiperPairSolver.

Algorithm 12 Computing the upper tail quantile in Kuiper’s $V_{n}$-test

1:Upper tail probability $\alpha\in(0,1)$, capacity $n$ of the samples.

2:Upper tail quantile $v^{\alpha}_{n}$ for the $V_{n}$ statistic such that
$\alpha=\Pr\left\\{V_{n}>v\right\\}$.

3:function KuiperUTQ($\alpha,n$)

4: if $\alpha\geq 0.9999$ then

5: return $0.0$;

6: end if

7: $T\leftarrow\textsc{UpdateMethodNewton}$; // using Newton’s iterative
method

8: $f\leftarrow\textsc{FunFnlm1}$; // solve the nonlinear eq.
${f}_{\mathrm{nlm1}}(c,\alpha,n)=0$ in $V_{n}$-test

9: $\epsilon\leftarrow 10^{-5}$; // precision for the fixed-point

10: $d\leftarrow\textsc{Distance}$; // distance function

11: ${c}_{\mathrm{guess}}\leftarrow 2.45$; //
${c}_{\mathrm{guess}}\in(1.1,2.5)$ is OK.

12:
$c^{\alpha}_{n}\leftarrow\textsc{FixedPointSolver}(T,f,d,\epsilon,{c}_{\mathrm{guess}},\alpha,n)$;

13: $v^{\alpha}_{n}\leftarrow c^{\alpha}_{n}/\sqrt{n}$;

14: return $v^{\alpha}_{n}$;

15:end function

The lower tail quantile may become more attractive for some applications. The
procedure KuiperLTQ listed in Algorithm 4.4 is based on the procedures
KuiperPairSolver. An alternative implementation of KuiperLTQ can be done with
the equivalence of $v_{\alpha}^{n}=v^{1-\alpha}_{n}$. In other words, we have
$\textsc{KuiperLTQ}(\alpha,n)\equiv\textsc{KuiperUTQ}(1-\alpha,n)$ for any
$\alpha\in[0,1]$.

Algorithm 13 Compute the Lower Tail Quantile $v_{\alpha}^{n}$ in Kuiper’s
$V_{n}$-test

1:Lower tail probability $\alpha\in(0,1)$, capacity $n$ of the samples.

2:Lower tail quantile $v_{\alpha}^{n}$ in Kuiper’s $V_{n}$-test.

3:function KuiperLTQ($\alpha,n$)

4: if $\alpha\leq 0.0001$ then

5: return $0.0$;

6: end if

7: ${c}_{\mathrm{guess}}\leftarrow 2.45$; //
${v}_{\mathrm{guess}}\in(1.1,2.5)$ is OK

8: $\texttt{type}\leftarrow 1$; // Kuiper’s $V_{n}$-test

9: $\texttt{method}\leftarrow 2$; // Newton’s iterative method

10:
$\left\langle{c},{v}\right\rangle\leftarrow\textsc{KuiperPairSolver}({c}_{\mathrm{guess}},1-\alpha,n,\texttt{type},\texttt{method})$;

11: return $v$; // lower tail quantile, $v=v_{\alpha}=v^{1-\alpha}$

12:end function

For the applications of goodness-of-fit test where Kuiper’s $V_{n}$-test is
involved, it is the inverse of the CDF of $V_{n}$ that must be solved
according to (4) or (6). It is easy to find that

$v_{x}^{n}=F^{-1}_{V_{n}}(x),\quad\forall x\in[x,1]$ (45)

by the definitions of lower tail probability and CDF. Therefore, the inverse
of CDF can be obtained by the calling the procedure KuiperLTQ or KuiperUTQ
directly with proper argument. The procedure KuiperInvCDF in Algorithm 4.4 is
designed for computing the $F^{-1}_{V_{n}}(x)$ for any probability
$x\in[0,1]$.

Algorithm 14 Compute the inverse CDF $F^{-1}_{V_{n}}(x)$ for Kuiper’s
$V_{n}$-test

1:Probability $x\in[0,1]$, capacity $n$ of the samples

2:The value of $F^{-1}_{V_{n}}(x)$ of the Kuiper’s $V_{n}$-test.

3:function KuiperInvCDF($x,n$)

4: $y\leftarrow\textsc{KuiperUTQ}(1.0-x,n)$; //
$y\leftarrow\textsc{KuiperLTQ}(x,n)$ is OK.

5: return $y$;

6:end function

##  5 Verification and Validation

###  5.1 An Error in Kuiper’s Numerical Results

Kuiper [1] presented a table of the critical value $c^{\alpha}_{n}$ for
$\alpha\in\left\\{0.01,0.05,0.1\right\\}$ and
$n\in\left\\{10,20,30,40,100,+\infty\right\\}$, see Table 1.

Table 1: Kuiper’s critical value $c^{\alpha}_{n}$ such that $\alpha=\Pr\left\\{\sqrt{n}\cdot V_{n}>c^{\alpha}_{n}\right\\}$ $\alpha$ $n$ $c^{\alpha}_{n}$ | $10$ | $20$ | $30$ | $40$ | $100$ | $+\infty$
---|---|---|---|---|---|---
$0.10$ | $1.1877$ | $1.5322$ | $1.5503$ | $1.5608$ | $1.5839$ | $1.6196$
$0.05$ | $1.6066$ | $1.6564$ | $1.6760$ | $1.6869$ | $1.7110$ | $1.7473$
$0.01$ | $1.8391$ | $1.9027$ | $\bf{1.9153}$ | $1.9375$ | $1.9637$ | $2.0010$

For the configuration of $\alpha$ and $n$, the Kuiper pair for Kuiper’s
$V_{n}$-test can be computed by the algorithms above and code released on the
GitHub by the authors. Table 2 lists some typical results for the pair
$\left\langle{c^{\alpha}_{n}},{v^{\alpha}_{n}}\right\rangle$. Our results
coincide with Kuiper’s numerical results very well and the readers can check
the values in Table 2 and their counterparts in Table 1. It should be noted
that extra values for $n\in\left\\{180,10^{6}\right\\}$ are added in the
table. Moreover, the readers can get more effective digits with our code
released on the GitHub.

Table 2: Kuiper pair for Kuiper’s $V_{n}$-test where
$\alpha=\Pr\left\\{\sqrt{n}\cdot
V_{n}>c^{\alpha}_{n}\right\\}=\Pr\left\\{V_{n}>v^{\alpha}_{n}\right\\}$

$\alpha$ $n$ $(c^{\alpha}_{n},v^{\alpha}_{n})$ | $10$ | $20$ | $30$ | $40$ | $100$ | $180$ | $10^{6}$
---|---|---|---|---|---|---|---
$0.10$ | $(1.4877,0.4704)$ | $(1.5322,0.3426)$ | $(1.5503,0.2830)$ | $(1.5606,0.2468)$ | $(1.5838,0.1584)$ | $(1.5934,0.1188)$ | $(1.6193,0.0016)$
$0.05$ | $(1.6066,0.5080)$ | $(1.6563,0.3704)$ | $(1.6758,0.3060)$ | $(1.6868,0.2667)$ | $(1.7110,0.1711)$ | $(1.7208,0.1283)$ | $(1.7469,0.0017)$
$0.01$ | $(1.8401,0.5819)$ | $(1.9026,0.4254)$ | $\bf{(1.9252,0.3515)}$ | $(1.9374,0.3063)$ | $(1.9636,0.1964)$ | $(1.9739,0.1471)$ | $(2.0006,0.0020)$

It should be noted that there is an error in Kuiper’s table for
$(\alpha,n,c^{\alpha}_{n})=(0.01,30,1.9153)$. The comparison of Table 2 and
Table 1 shows that the value $c^{0.01}_{30}$ by Kuiper is wrong with the help
of our code released on GitHub. Obviously, the correct value should be
$c^{0.01}_{30}=1.9252$ by our algorithms and code or $c^{0.01}_{30}=1.9253$
according to Kuiper’s approximation in which only the term
$(\cdot)\mathrm{e}^{-2c^{2}}$ is considered for the infinite series. We deem
that this error might be a typo due to the manual work on editing the data
since in the 1960 era it is difficult for a researcher to find an automatic
tool for processing data.

###  5.2 Table of Kuiper pair of $V_{n}$-test for $n=10$

Kuiper [1] also presented a table of
$\left\langle{v^{\alpha}_{n}},{c^{\alpha}_{n}}\right\rangle$ for $n=10$ and
$c^{\alpha}_{n}\in\left\\{1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9\right\\}$.
Our programs also give similar numerical results, as shown in Table 3.

Table 3: Kuiper pair $\left\langle{v^{\alpha}_{n}},{c^{\alpha}_{n}}\right\rangle$ for $n=10$. Critical value | Upper Tail Quantile | Upper tail probability
---|---|---
$c^{\alpha}_{n}$ | $v^{\alpha}_{n}=c^{\alpha}_{n}/\sqrt{n}$ | $\alpha=\Pr\left\\{\sqrt{n}\cdot V_{n}>c^{\alpha}_{n}\right\\}$
$1.00$ | $0.3163$ | $0.6930$
$1.10$ | $0.3482$ | $0.5280$
$1.20$ | $0.3795$ | $0.3770$
$1.30$ | $0.4110$ | $0.2520$
$1.40$ | $0.4427$ | $0.1580$
$1.50$ | $0.4746$ | $0.0930$
$1.60$ | $0.5060$ | $0.0520$
$1.70$ | $0.5382$ | $0.0270$
$1.80$ | $0.5692$ | $0.0135$
$1.90$ | $0.6006$ | $0.0063$

###  5.3 Special case of Sufficiently Large Number of Samples

If the number of samples is large enough, we can let $n$ approach to infinity.
Therefore,

$\begin{cases}A_{1}(c,\infty)=-2+8c^{2}\\\ A_{2}(c,\infty)=-2+32c^{2}\\\
\mathcal{A}^{\alpha}_{\infty}(f,c)=\sqrt{\frac{\ln\left[-2+8c^{2}+(-2+32c^{2})\mathrm{e}^{-6c^{2}}\right]-\ln\alpha}{2}}\end{cases}$
(46)

The Kuiper’s critical value is the fixed-point of

$c=\mathcal{A}^{\alpha}_{\infty}(f,c).$ (47)

We start the iterative procedure with initial value ${c}_{\mathrm{guess}}=1.2$
and set $n=10^{8}$, and provide the $c^{\alpha}_{\infty}$ for typical values
of $\alpha$ in Table 4, which also coincides with Kuiper’s original results
for $\alpha\in\left\\{0.1,0.05,0.01\right\\}$ very well but our results
illustrate more possible values of $\alpha$.

Table 4: Kuiper’s critical value for $n\to\infty$ (e.g., we can set $n=10^{8}$
in computer program)

$\alpha$ | $0.10$ | $0.09$ | $0.08$ | $0.07$ | $0.06$ | $0.05$ | $0.04$ | $0.03$ | $0.02$ | $10^{-2}$ | $10^{-6}$ | $10^{-10}$
---|---|---|---|---|---|---|---|---|---|---|---|---
$c^{\alpha}_{\infty}$ | $1.6196$ | $1.6400$ | $1.6623$ | $1.6871$ | $1.7150$ | $1.7472$ | $1.7855$ | $1.8331$ | $1.8974$ | $2.0009$ | $3.0056$ | $3.7226$

###  5.4 Kuiper pair for Kuiper’s $V_{n,n}$-test

Table 5 demonstrates the Kuiper pair for
$\alpha\in\left\\{0.01,0.02,\cdots,0.10\right\\}$ and
$n\in\left\\{10,20,30,40,100,10^{8}\right\\}$ with the help of the procedure
KuiperPairSolver in Algorithm 4.3. We remark that the corresponding values for
$\alpha$ proposed by Kuiper [1] is $\alpha\in\left\\{0.10,0.05,0.01\right\\}$
and the values of $v^{\alpha}_{n,n}$ is not listed.

Table 5: Kuiper pair for Kuiper’s $V_{n,n}$-test where
$\alpha=\Pr\left\\{\sqrt{n}\cdot
V_{n,n}>c^{\alpha}_{n,n}\right\\}=\Pr\left\\{V_{n,n}>v^{\alpha}_{n,n}\right\\}$

$\alpha$ $n$ $(c^{\alpha}_{n,n},v^{\alpha}_{n,n})$ | $10$ | $20$ | $30$ | $40$ | $100$ | $10^{8}$
---|---|---|---|---|---|---
$0.10$ | $(2.2431,0.7093)$ | $(2.2660,0.5067)$ | $(2.2740,0.4152)$ | $(2.2780,0.3602)$ | $(2.2854,0.2285)$ | $(2.2905,0.0002)$
$0.09$ | $(2.2682,0.7173)$ | $(2.2929,0.5127)$ | $(2.3015,0.4202)$ | $(2.3058,0.3646)$ | $(2.3139,0.2314)$ | $(2.3193,0.0002)$
$0.08$ | $(2.2953,0.7258)$ | $(2.3220,0.5192)$ | $(2.3314,0.4257)$ | $(2.3362,0.3694)$ | $(2.3449,0.2345)$ | $(2.3509,0.0002)$
$0.07$ | $(2.3248,0.7352)$ | $(2.3540,0.5264)$ | $(2.3643,0.4317)$ | $(2.3696,0.3747)$ | $(2.3793,0.2379)$ | $(2.3860,0.0002)$
$0.06$ | $(2.3572,0.7454)$ | $(2.3896,0.5343)$ | $(2.4011,0.4384)$ | $(2.4070,0.3806)$ | $(2.4180,0.2418)$ | $(2.4255,0.0002)$
$0.05$ | $(2.3933,0.7568)$ | $(2.4298,0.5433)$ | $(2.4430,0.4460)$ | $(2.4497,0.3873)$ | $(2.4623,0.2462)$ | $(2.4710,0.0002)$
$0.04$ | $(2.4343,0.7698)$ | $(2.4764,0.5537)$ | $(2.4918,0.4549)$ | $(2.4998,0.3952)$ | $(2.5147,0.2515)$ | $(2.5251,0.0003)$
$0.03$ | $(2.4819,0.7849)$ | $(2.5321,0.5662)$ | $(2.5508,0.4657)$ | $(2.5607,0.4049)$ | $(2.5793,0.2579)$ | $(2.5924,0.0003)$
$0.02$ | $(2.5393,0.8030)$ | $(2.6021,0.5819)$ | $(2.6266,0.4796)$ | $(2.6397,0.4174)$ | $(2.6650,0.2665)$ | $(2.6834,0.0003)$
$0.01$ | $(2.6124,0.8261)$ | $(2.6986,0.6034)$ | $(2.7351,0.4994)$ | $(2.7556,0.4357)$ | $(2.7973,0.2797)$ | $(2.8297,0.0003)$

###  5.5 Cumulative Distribution Function for Kuiper’s $V_{n}$-test

With the help of (6) and Algorithm 4.4, we can compute the
$x=F^{-1}_{V_{n}}(y)$ by calling the procedure KuiperInvCDF as follows

$x_{i}\leftarrow\textsc{KuiperInvCDF}(y_{i},n),\quad
i=1,2,\cdots,{i}_{\mathrm{size}}$ (48)

Thus for each capacity $n$ of the random samples $\left\\{X_{t}:1\leq t\leq
n\right\\}$ and probability sequence

$\left\\{y_{i}=F_{V_{n}}(x_{i}):1\leq i\leq{i}_{\mathrm{size}}\right\\},$

we can draw the curve of CDF with the pairs $\left\\{(x_{i},y_{i}):1\leq
i\leq{i}_{\mathrm{size}}\right\\}$ such that $y_{i}=\Pr\left\\{V_{n}\leq
x_{i}\right\\}=F_{V_{n}}(x_{i})$.

Figure 5 illustrates the CDF of $V_{n}$ statistic for various sample capacity
$n$. It is obvious that with the increasing of $n$, the curve of CDF becomes
more and more steep, which coincides with (7). Moreover, the horizontal line
$p=F_{V_{n}}(v)=0.05$ shows the upper tail probability $\alpha=1-p=0.05$. The
intersection points of the line with the CDF are the upper tail quantile
$v^{\alpha}_{n}$ for $\alpha=0.05$ where
$n\in\left\\{5,10,30,50,100,180,1000\right\\}$.

Figure 5: CDF of $V_{n}$-statistic for various sample capacity $n$

We remark that there are three equivalent ways for computing the inverse of
CDF. Actually, we have

$\displaystyle x$ $\displaystyle=F_{V_{n}}^{-1}(y)$ (49)
$\displaystyle=\textsc{KuiperInvCDF}(y,n)$
$\displaystyle=\textsc{KuiperLTQ}(y,n)$
$\displaystyle=\textsc{KuiperUTQ}(1-y,n)$

for ant $y\in[0,1]$.

##  6 Discussion

###  6.1 An Alternative Choice of Non-linear Function for $V_{n}$-test

The disadvantage of Newton’s iterative method for solving root lies in two
aspects: firstly, derivative of the objective function is required and the
method will fail if the derivative is near to 0. Actually, if we take the
following alternative equivalent nonlinear equation for $c$

${\hat{f}}_{\mathrm{nlm1}}(c,\alpha,n)=A_{1}(c,n)\cdot\mathrm{e}^{-2c^{2}}+A_{2}(c,n)\mathrm{e}^{-8c^{2}}-\alpha=0\Longleftrightarrow{f}_{\mathrm{nlm1}}(c,\alpha,n)=0$
(50)

then for the fixed $\alpha$ and $n$ the function
${\hat{f}}_{\mathrm{nlm1}}(c,\alpha,n)$ will have a flat region where the
derivative
${\hat{f}}_{\mathrm{nlm}}^{\prime}(c,\alpha,n)=\operatorname{d}{\hat{f}}_{\mathrm{nlm1}}(c,\alpha,n)/\operatorname{d}c$
will be near zero, thus the Newton’s iterative method may fail if the initial
value ${c}_{\mathrm{guess}}$ is larger than the root. Figure 6 demonstrates
this situation clearly in which for $c>c^{\alpha}_{n}$ the curve of
${\hat{f}}_{\mathrm{nlm1}}(c,\alpha,n)$ is very flat.

Figure 6: Curve and root of ${\hat{f}}_{\mathrm{nlm1}}(c,\alpha,n)$ for
$\alpha\in\left\\{0.10,0.05,0.02,0.01\right\\}$ and $n=30$ in Kuiper’s
$V_{n}$-test.

###  6.2 Choices of Initial Value for the Critical Value

Theoretical and numerical experiments indicate the way for setting the initial
value for solving the Kuiper pair. Our suggestions are listed as follows:

  * •

for the $V_{n}$-test, we can set: ${c}_{\mathrm{guess}}\in(0.5,2.5)$ for the
direct iterative method based on $\mathcal{A}^{\alpha}_{n}$ and
${c}_{\mathrm{guess}}\in(1.1,2.5)$ for the Newton’s iterative method based on
$\mathcal{B}^{\alpha}_{n}$;

  * •

fort the $V_{n,n}$-test, we can set: ${c}_{\mathrm{guess}}\in(2.4,2.6)$ for
the direct iterative method based on $\mathcal{A}^{\alpha}_{n,n}$ and
${c}_{\mathrm{guess}}\in(2.2,2.6)$ for the Newton’s iterative method based on
$\mathcal{B}^{\alpha}_{n,n}$.

In summary, if we set ${c}_{\mathrm{guess}}\in[2.4,2.5]$, then the algorithms
proposed could work well for both $V_{n}$-test and $V_{n,n}$-test.

###  6.3 Limitation of Kuiper’s First Order Approximation for the Cumulative
Distribution Function

The limitation of Kuiper’s first order approximation for the cumulative
distribution function is that the approximation error is bounded by
$\mathcal{O}\left(n^{-1}\right)$. Thus for small $n$, the numerical precision
is not high. Although Stephens [2] proposed the modified statistic
$T_{n}=(\sqrt{n}+0.155+0.24/\sqrt{n})V_{n}$ for replacing the $V_{n}$ for
small $n$, the bound of approximation error is not discussed. Essentially,
what we need is a more precise formula for (9) with smaller approximation
error, say $\mathcal{O}\left(n^{-2}\right)$ or
$\mathcal{O}\left(n^{-3}\right)$, instead of using $T_{n}$ directly without
verification and validation.

##  7 Conclusion

The computation of the critical value and upper tail quantile, Kuiper pair for
simplification, is equivalent to solve the fixed-point of the nonlinear
equation
$\alpha=\Pr\left\\{K_{n}>c\right\\}=\Pr\left\\{\sqrt{n}V_{n}>c\right\\}$ which
involves two infinite series by iterative method for Kuiper’s statistic
$V_{n}$ or $V_{n,n}$. The Kuiper’s pair
$\left\langle{c^{\alpha}_{\star}},{v^{\alpha}_{\star}}\right\rangle$ can be
solved with the following steps:

  * (1)

simplifying the nonlinear equation $\alpha=\Pr\left\\{\sqrt{n}\cdot
V_{\star}>c\right\\}$ with second order approximation for
$V_{\star}\in\left\\{V_{n},V_{n,n}\right\\}$ in the asymptotic expansion;

  * (2)

converting the nonlinear equation to a fixed-point equation with the form
$c=T(f,c,\alpha,n)$ by setting the updating operator $T$, the function object
$f(c,\alpha,n)$ and initial value ${c}_{\mathrm{guess}}$ properly via the
direct iterative scheme
$c_{i+1}=\mathcal{A}^{\alpha}_{\star}(c)=f(c_{i},\alpha,n)$ or the Newton’s
scheme
$c_{i+1}=\mathcal{B}^{\alpha}_{\star}(f,c)=c_{i}-f(c_{i},\alpha,n)/f^{\prime}_{c}(c_{i},\alpha,n)$;

  * (3)

designing algorithms for solving the fixed-point equation in order to compute
the critical value $c^{\alpha}_{\star}$ and the upper tail quantile
$v^{\alpha}_{\star}$;

For the convenience of implementation with concrete computer programming
languages such as C, C++, Python, Octave, MATLAB and so on, the pseudo-code
for the algorithms are provided with details. There are some advantages for
our methods and algorithms:

  * (1)

a unified theoretic framework for solving fixed-point, based on the concept of
functional in mathematics and the high order function in computer science, is
discussed in detail by combining the merits of mathematics and computer
science, which is general and elastic enough for solving lots of fixed-point
problems arising in science, technology, engineering and mathematics;

  * (2)

a unified interface is set for solving the Kuiper’s pairs in the $V_{n}$-test
and $V_{n,n}$-test;

  * (3)

procedures for solving the upper/lower tail quantile are provided for the
potential applications of the Kuiper’s statistic in the goodness-of-fit test;

  * (4)

the computational complexity is linear since there is no nested loops in the
algorithm, and the reader can test the running time with the help of the C
code released on GitHub;

  * (5)

the methods proposed in this paper can be modified slightly to solve the
Kolmogrov-Smirmov test, $\chi^{2}$-test and normal test since the difference
behind these different tests lies in the concrete form of the nonlinear
equation $\alpha=\Pr\left\\{Z>z\right\\}$ for the given upper tail
significance level $\alpha$ and the CDF $F_{Z}(\cdot)$ encountered for the
population $Z$ and random samples $\left\\{Z_{t}:1\leq t\leq n\right\\}$.

Our verification and validation shows that there is a mistake in Kuiper’s
table of critical value $c^{\alpha}_{n}$ for $(\alpha,n)=(0.01,30)$. The
correct value for $c^{0.01}_{30}$ should be $1.9252$ or $1.9253$ instead of
$1.9153$. It might be a typo introduced by manual work on editing the data in
the 1960 era.

In the sense of STEM education, the topic of this paper can be used as a
comprehensive project for training the college students’ ability of solving
complex problems by combining the mathematics and computer programming.

#### Acknowledgements

This work was supported in part by the Hainan Provincial Natural Science
Foundation of China under grant numbers 720RC616 and 2019RC199, and in part by
the National Natural Science Foundation of China under grant number 62167003.

### Code availability statement

The code for the implementations of the algorithms discussed in this paper can
be downloaded from the following GitHub website:
https://github.com/GrAbsRD/KuiperVnStatistic.

## References

  * [1] Nicolas H. Kuiper.  Tests concerning random points on a circle.  In Proceedings of the Koninklijke Nederlandse Akademie van Wetenschappen, volume 63 of A: Mathemaical Statistics, pages 38–47, 1960\.  Available online: https://core.ac.uk/download/pdf/82631793.pdf.
  * [2] M. A. Stephens.  Use of the Kolmogorov-Smirnov, Cramer-Von mises and related statistics without extensive tables.  Journal of the Royal Statistical Society, Series B (Methodological), 32(1):115–122, 1970.
  * [3] E. S. Pearson and H. O. Hartley, editors.  Biometrika Tables for Statisticians, volume 2.  Cambridge University Press, 1972.
  * [4] Yadolah Dodge.  The Concise Encyclopedia of Statistics, pages 283–287.  Springer New York, New York, 2008.  https://doi.org/10.1007/978-0-387-32833-1_214.
  * [5] Donald E. Knuth.  The Art of Computer Programming: Vol.2 Seminumerical Algorithms.  Addison-Wesley Professional, New York, 1997.
  * [6] Xiaohang Jin, Tommy W. S. Chow, Yi Sun, Jihong Shan, and Bill C. P. Lau.  Kuiper test and autoregressive model-based approach for wireless sensor network fault diagnosis.  Wireless Netwwork, 21(9):829–839, 2015.  https://doi.org/10.1007/s11276-014-0820-0.
  * [7] W. H. Press, B. P. Flannery, S. A. Teukolsky, and W. T. Vetterling.  Numerical Recipes in C++: The Art of Scientific Computing, pages 625–633.  Addison-Wesley Professional, Cambridge University Press, 2nd edition, 2002\.
  * [8] Christoffer Koch and Ken Okamura.  Benford’s Law and COVID-19 reporting.  Economics Letters, 196(11):1/109573–4/109573, 2020.  https://doi.org/10.1016/j.econlet.2020.109573.
  * [9] Connor Dowd.  A New ECDF Two-Sample Test Statistic, 2007.  arxiv: 2007.01360 [stat], http://arxiv.org/abs/2007.01360.
  * [10] John R. Lanzante.  Testing for differences between two distributions in the presence of serial correlation using the Kolmogorov–Smirnov and Kuiper’s tests.  International Journal of Climatology, 41(14):6314–6323, 2021.  https://onlinelibrary.wiley.com/doi/10.1002/joc.7196.
  * [11] D. A. Darling.  The Kolmogorov-Smirnov, Cramer-von Mises Tests.  The Annals of Mathematical Statistics, 28(4):823–838, 1957.  http://www.jstor.org/stable/2237048, published by Institute of Mathematical Statistics.
  * [12] Eberhard Zeidler.  Applied Functional Analysis: Applications to Mathematical Physics, Vol. 1, volume 108 of Applied Mathemaical Sciences.  Springer, New York, 3rd edition, 1995.
  * [13] Kendall Atkinson and Weimin Han.  Theoretical Numerical Analysis: A Functional Analysis Framework, volume 39 of Texts in Applied Mathematics.  Springer, New York, 3rd edition, 2009.
  * [14] J. H. B. Kemperman.  Asymptotic expansions for the Smirnov test and for the range of cumulative sums.  The Annals of Mathematical Statistics, 30(2):448–462, Jun. 1959\.  https://www.jstor.org/stable/2237092.