| Title: | Rank in Similarity Graph Edge-Count Two-Sample Test (RISE) |
|---|---|
| Description: | Implements the Rank In Similarity Graph Edge-count two-sample test (RISE) for high-dimensional and non-Euclidean data. The method constructs similarity-based graphs, such as k-nearest neighbor graph (k-NNG), k-minimum spanning tree (k-MST), and k-minimum distance non-bipartite pairing (k-MDP), and evaluates rank-based within-sample edge counts with asymptotic and permutation p-values. For methodological details, see Zhou and Chen (2023) <https://proceedings.mlr.press/v195/zhou23a.html>. |
| Authors: | Doudou Zhou [aut, cre] (ORCID: <https://orcid.org/0000-0002-0830-2287>), Hao Chen [aut] (ORCID: <https://orcid.org/0000-0002-4597-2773>) |
| Maintainer: | Doudou Zhou <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 0.1 |
| Built: | 2026-05-11 07:47:44 UTC |
| Source: | https://github.com/cran/GraphRankTest |
RISE constructs a nonnegative, symmetric rank/graph matrix from
two samples and (or from a pre-computed similarity matrix ),
then computes a Hotelling-type quadratic statistic with an asymptotic
chi-square p-value. Optionally, a permutation p-value is returned.
RISE( X = NULL, Y = NULL, S = NULL, sample1ID = NULL, sample2ID = NULL, k = 10, rank.type = "RgNN", perm = 0 )RISE( X = NULL, Y = NULL, S = NULL, sample1ID = NULL, sample2ID = NULL, k = 10, rank.type = "RgNN", perm = 0 )
X |
Numeric matrix of size |
Y |
Numeric matrix of size |
S |
Numeric similarity matrix of size |
sample1ID |
Integer indices (length |
sample2ID |
Integer indices (length |
k |
Positive integer tuning parameter.
For |
rank.type |
Character, one of |
perm |
Integer, number of permutations for a permutation p-value (default |
From (or from , ), the procedure constructs a
symmetric matrix with zero diagonal using one of the supported
graph/ranking schemes. It then forms the within-group edge sums
and
.
The expectation vector and covariance matrix of are
derived under the permutation null distribution. The test statistic is
where are the expected values and is the
covariance matrix. Under the null hypothesis, is asymptotically
chi-square distributed with 2 degrees of freedom.
A list with components:
test.statistic: quadratic form .
pval.approx: asymptotic p-value (chi-square, df = 2).
pval.perm: permutation p-value (present only if perm > 0).
Zhou, D. and Chen, H. (2023). A new ranking scheme for modern data and its application to two-sample hypothesis testing. In Proceedings of the 36th Annual Conference on Learning Theory (COLT 2023), PMLR, pp. 3615–3668.
set.seed(1) X <- matrix(rnorm(50*100, mean = 0), nrow=50) Y <- matrix(rnorm(50*100, mean = 0.3), nrow=50) # RgNN: graph-induced ranks from the k-nearest-neighbor graph out.RgNN <- RISE(X = X, Y = Y, k = 10, rank.type = "RgNN", perm = 1000) out.RgNN # RoNN: overall ranks obtained by ordering edges from the k-NN graph out.RoNN <- RISE(X = X, Y = Y, k = 10, rank.type = "RoNN", perm = 1000) out.RoNN # RgMST: graph-induced ranks from layered minimum spanning trees out.RgMST <- RISE(X = X, Y = Y, k = 10, rank.type = "RgMST", perm = 1000) out.RgMST # RoMST: overall ranks obtained by ordering edges in the MST out.RoMST <- RISE(X = X, Y = Y, k = 10, rank.type = "RoMST", perm = 1000) out.RoMST # RoMDP: overall ranks obtained by ordering edges from minimum-distance pairings out.RoMDP <- RISE(X = X, Y = Y, k = 10, rank.type = "RoMDP", perm = 1000) out.RoMDPset.seed(1) X <- matrix(rnorm(50*100, mean = 0), nrow=50) Y <- matrix(rnorm(50*100, mean = 0.3), nrow=50) # RgNN: graph-induced ranks from the k-nearest-neighbor graph out.RgNN <- RISE(X = X, Y = Y, k = 10, rank.type = "RgNN", perm = 1000) out.RgNN # RoNN: overall ranks obtained by ordering edges from the k-NN graph out.RoNN <- RISE(X = X, Y = Y, k = 10, rank.type = "RoNN", perm = 1000) out.RoNN # RgMST: graph-induced ranks from layered minimum spanning trees out.RgMST <- RISE(X = X, Y = Y, k = 10, rank.type = "RgMST", perm = 1000) out.RgMST # RoMST: overall ranks obtained by ordering edges in the MST out.RoMST <- RISE(X = X, Y = Y, k = 10, rank.type = "RoMST", perm = 1000) out.RoMST # RoMDP: overall ranks obtained by ordering edges from minimum-distance pairings out.RoMDP <- RISE(X = X, Y = Y, k = 10, rank.type = "RoMDP", perm = 1000) out.RoMDP