x: a vector of size nx or a matrix of size c(nx, 1).
K_Kolmogorov, K_Kuiper, K_Watson, K_Watson_1976, K_Ajne: integer giving the truncation of the series present in the null asymptotic distributions. For the Kolmogorov-Smirnov-related series defaults to 25; for the others series defaults to a smaller number.
alternating: use the alternating series expansion for the distribution of the Kolmogorov-Smirnov statistic? Defaults to TRUE.
n: sample size employed for computing the statistic.
asymp_std: compute the distribution associated to the normalized Hodges-Ajne statistic? Defaults to FALSE.
exact: use the exact distribution for the Hodges-Ajne statistic? Defaults to TRUE.
second_term: use the second-order series expansion for the distribution of the Kuiper statistic? Defaults to TRUE.
Stephens: compute Stephens (1970) modification so that the null distribution of the is less dependent on the sample size? The modification does not alter the test decision.
abs_val: compute the distribution associated to the absolute value of the Darling's log gaps statistic? Defaults to TRUE.
N: number of points used in the Gauss-Legendre quadrature . Defaults to 40.
max_gap: compute the distribution associated to the maximum gap for the range statistic? Defaults to TRUE.
K_max: integer giving the truncation of the series that compute the asymptotic p-value of a Sobolev test. Defaults to 1e3.
thre: error threshold for the tail probability given by the the first terms of the truncated series of a Sobolev test. Defaults to 0 (no further truncation).
method: method for approximating the density, distribution, or quantile function of the weighted sum of chi squared random variables. Must be "I" (Imhof), "SW" (Satterthwaite--Welch), "HBE"
(Hall--Buckley--Eagleson), or "MC" (Monte Carlo; only for distribution or quantile functions). Defaults to "I".
...: further parameters passed to p_Sobolev or d_Sobolev (such as x_tail).
t: t parameter for the Rothman and Cressie tests, a real in (0,1). Defaults to 1 / 3.
rho: ρ parameter for the Poisson test, a real in [0,1). Defaults to 0.5.
q: q parameter for the Pycke "q-test", a real in (0,1). Defaults to 1 / 2.
s: s parameter for the s-Riesz test, a real in (0,2). Defaults to 1.
vk2: weights for the finite Sobolev test. A non-negative vector or matrix. Defaults to c(0, 0, 1).
kappa: κ parameter for the Softmax test, a non-negative real. Defaults to 1.
Returns
A matrix of size c(nx, 1) with the evaluation of the distribution or density function at x.
Details
Descriptions and references for most of the tests are available in García-Portugués and Verdebout (2018).
Examples
# Ajnecurve(d_cir_stat_Ajne(x), to =1.5, n =2e2, ylim = c(0,4))curve(p_cir_stat_Ajne(x), n =2e2, col =2, add =TRUE)# Bakshaevcurve(d_cir_stat_Bakshaev(x, method ="HBE"), to =6, n =2e2, ylim = c(0,1))curve(p_cir_stat_Bakshaev(x, method ="HBE"), n =2e2, add =TRUE, col =2)# Binghamcurve(d_cir_stat_Bingham(x), to =12, n =2e2, ylim = c(0,1))curve(p_cir_stat_Bingham(x), n =2e2, col =2, add =TRUE)# Greenwoodcurve(d_cir_stat_Greenwood(x), from =-6, to =6, n =2e2, ylim = c(0,1))curve(p_cir_stat_Greenwood(x), n =2e2, col =2, add =TRUE)# Hermans-Rassoncurve(p_cir_stat_Hermans_Rasson(x, method ="HBE"), to =10, n =2e2, ylim = c(0,1))curve(d_cir_stat_Hermans_Rasson(x, method ="HBE"), n =2e2, add =TRUE, col =2)# Hodges-Ajneplot(25:45, d_cir_stat_Hodges_Ajne(cbind(25:45), n =50), type ="h", lwd =2, ylim = c(0,1))lines(25:45, p_cir_stat_Hodges_Ajne(cbind(25:45), n =50), type ="s", col =2)# Kolmogorov-Smirnovcurve(d_Kolmogorov(x), to =3, n =2e2, ylim = c(0,2))curve(p_Kolmogorov(x), n =2e2, col =2, add =TRUE)# Kuipercurve(d_cir_stat_Kuiper(x, n =50), to =3, n =2e2, ylim = c(0,2))curve(p_cir_stat_Kuiper(x, n =50), n =2e2, col =2, add =TRUE)# Kuiper and Watson with Stephens modificationcurve(d_cir_stat_Kuiper(x, n =8, Stephens =TRUE), to =2.5, n =2e2, ylim = c(0,10))curve(d_cir_stat_Watson(x, n =8, Stephens =TRUE), n =2e2, lty =2, add =TRUE)n <- c(10,20,30,40,50,100,500)col <- rainbow(length(n))for(i in seq_along(n)){ curve(d_cir_stat_Kuiper(x, n = n[i], Stephens =TRUE), n =2e2, col = col[i], add =TRUE) curve(d_cir_stat_Watson(x, n = n[i], Stephens =TRUE), n =2e2, col = col[i], lty =2, add =TRUE)}# Maximum uncovered spacingcurve(d_cir_stat_Max_uncover(x), from =-3, to =6, n =2e2, ylim = c(0,1))curve(p_cir_stat_Max_uncover(x), n =2e2, col =2, add =TRUE)# Number of uncovered spacingcurve(d_cir_stat_Num_uncover(x), from =-4, to =4, n =2e2, ylim = c(0,1))curve(p_cir_stat_Num_uncover(x), n =2e2, col =2, add =TRUE)# Log gapscurve(d_cir_stat_Log_gaps(x), from =-1, to =4, n =2e2, ylim = c(0,1))curve(p_cir_stat_Log_gaps(x), n =2e2, col =2, add =TRUE)# Gine Fncurve(d_cir_stat_Gine_Fn(x, method ="HBE"), to =2.5, n =2e2, ylim = c(0,2))curve(p_cir_stat_Gine_Fn(x, method ="HBE"), n =2e2, add =TRUE, col =2)# Gine Gncurve(d_cir_stat_Gine_Gn(x, method ="HBE"), to =2.5, n =2e2, ylim = c(0,2))curve(p_cir_stat_Gine_Gn(x, method ="HBE"), n =2e2, add =TRUE, col =2)# Gini mean differencecurve(d_cir_stat_Gini(x), from =-4, to =4, n =2e2, ylim = c(0,1))curve(p_cir_stat_Gini(x), n =2e2, col =2, add =TRUE)# Gini mean squared differencecurve(d_cir_stat_Gini_squared(x), from =-10, to =10, n =2e2, ylim = c(0,1))curve(p_cir_stat_Gini_squared(x), n =2e2, col =2, add =TRUE)# PADcurve(d_cir_stat_PAD(x, method ="HBE"), to =3, n =2e2, ylim = c(0,1.5))curve(p_cir_stat_PAD(x, method ="HBE"), n =2e2, add =TRUE, col =2)# PCvMcurve(d_cir_stat_PCvM(x, method ="HBE"), to =4, n =2e2, ylim = c(0,2))curve(p_cir_stat_PCvM(x, method ="HBE"), n =2e2, add =TRUE, col =2)# PRtcurve(d_cir_stat_PRt(x, method ="HBE"), n =2e2, ylim = c(0,5))curve(p_cir_stat_PRt(x, method ="HBE"), n =2e2, add =TRUE, col =2)# Poissoncurve(d_cir_stat_Poisson(x, method ="HBE"), from =-1, to =5, n =2e2, ylim = c(0,2))curve(p_cir_stat_Poisson(x, method ="HBE"), n =2e2, col =2, add =TRUE)# Pyckecurve(d_cir_stat_Pycke(x), from =-5, to =10, n =2e2, ylim = c(0,1))curve(p_cir_stat_Pycke(x), n =2e2, col =2, add =TRUE)# Pycke qcurve(d_cir_stat_Pycke_q(x, method ="HBE"), to =15, n =2e2, ylim = c(0,1))curve(p_cir_stat_Pycke_q(x, method ="HBE"), n =2e2, add =TRUE, col =2)# Rangecurve(d_cir_stat_Range(x, n =50), to =2, n =2e2, ylim = c(0,4))curve(p_cir_stat_Range(x, n =50), n =2e2, col =2, add =TRUE)# Raocurve(d_cir_stat_Rao(x), from =-6, to =6, n =2e2, ylim = c(0,1))curve(p_cir_stat_Rao(x), n =2e2, col =2, add =TRUE)# Rayleighcurve(d_cir_stat_Rayleigh(x), to =12, n =2e2, ylim = c(0,1))curve(p_cir_stat_Rayleigh(x), n =2e2, col =2, add =TRUE)# Rieszcurve(d_cir_stat_Riesz(x, method ="HBE"), to =6, n =2e2, ylim = c(0,1))curve(p_cir_stat_Riesz(x, method ="HBE"), n =2e2, add =TRUE, col =2)# Rothmancurve(d_cir_stat_Rothman(x, method ="HBE"), n =2e2, ylim = c(0,5))curve(p_cir_stat_Rothman(x, method ="HBE"), n =2e2, add =TRUE, col =2)# Vacancycurve(d_cir_stat_Vacancy(x), from =-4, to =4, n =2e2, ylim = c(0,1))curve(p_cir_stat_Vacancy(x), n =2e2, col =2, add =TRUE)# Watsoncurve(d_cir_stat_Watson(x), to =0.5, n =2e2, ylim = c(0,15))curve(p_cir_stat_Watson(x), n =2e2, col =2, add =TRUE)# Watson (1976)curve(d_cir_stat_Watson_1976(x), to =1.5, n =2e2, ylim = c(0,3))curve(p_cir_stat_Watson_1976(x), n =2e2, col =2, add =TRUE)# Softmaxcurve(d_cir_stat_Softmax(x, method ="HBE"), to =3, n =2e2, ylim = c(0,2))curve(p_cir_stat_Softmax(x, method ="HBE"), n =2e2, col =2, add =TRUE)# Sobolevvk2 <- c(0.5,0)curve(d_cir_stat_Sobolev(x = x, vk2 = vk2), to =3, n =2e2, ylim = c(0,2))curve(p_cir_stat_Sobolev(x = x, vk2 = vk2), n =2e2, col =2, add =TRUE)
References
García-Portugués, E. and Verdebout, T. (2018) An overview of uniformity tests on the hypersphere. arXiv:1804.00286. tools:::Rd_expr_doi("10.48550/arXiv.1804.00286") .