| ks_c_cdf | R Documentation |
Computes the complementary cumulative distribution function used by the one-sample Exact-KS-FFT method from pre-computed lower and upper boundary vectors, without using an intermediate file.
ks_c_cdf(n, A, B)
n |
A positive integer giving the sample size. |
A |
A numeric vector of length |
B |
A numeric vector of length |
The function evaluates the Exact-KS-FFT boundary-crossing calculation directly
from the vectors A_i and B_i. These vectors define the rectangular
region for the uniform order statistics,
A_i \le U_{(i)} \le B_i, \qquad i=1,\ldots,n.
It returns the complementary probability
1 - P(A_i \le U_{(i)} \le B_i,\ i=1,\ldots,n).
The boundary values can be constructed as in Steps 1 and 2 of the Exact-KS-FFT
method of Dimitrova, Kaishev and Tan (2020). For the standard two-sided
one-sample KS problem with a continuous null distribution and fixed q,
one may use
A_i = \max(0, i/n-q), \qquad
B_i = \min(1, (i-1)/n+q).
This interface replaces the historical package-internal mechanism that wrote the boundary vectors to ‘Boundary_Crossing_Time.txt’ before calling C++. The vectors are now passed directly to the C++ implementation.
A numeric value giving the complementary probability associated with the
specified boundary vectors. For boundaries corresponding to a one-sample KS
statistic at threshold q, this is the Exact-KS-FFT p-value
P(D_n \ge q).
Dimitrina S. Dimitrova, Vladimir K. Kaishev, Senren Tan. (2020) "Computing the Kolmogorov-Smirnov Distribution When the Underlying CDF is Purely Discrete, Mixed or Continuous". Journal of Statistical Software, 95(10), 1–42. doi:10.18637/jss.v095.i10.
Moscovich A., Nadler B. (2017). "Fast Calculation of Boundary Crossing Probabilities for Poisson Processes". Statistics and Probability Letters, 123, 177–182.
## Two-sided one-sample KS boundaries for a continuous null distribution
n <- 10
q <- 0.1
A <- pmax(0, (1:n) / n - q)
B <- pmin(1, ((1:n) - 1) / n + q)
ks_c_cdf(n, A, B)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.