| Title: | Multi-view Aggregated Two Sample Tests |
|---|---|
| Description: | This package is an implementation of the estimation and inference procedure of a multi-view aggregated two-sample test of equal distribution. |
| Authors: | Zexi Cai [aut, cre], Mingshuo Liu [aut, ctb], Wenbo Fei [aut, ctb], Doudou Zhou [aut, ctb] |
| Maintainer: | Zexi Cai <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.0.0.9000 |
| Built: | 2026-05-26 05:50:49 UTC |
| Source: | https://github.com/zexicai/mates |
This package is an implementation of the estimation and inference procedure of a multi-view aggregated two-sample test of equal distribution.
Maintainer: Zexi Cai [email protected]
Authors:
Mingshuo Liu [email protected] [contributor]
Wenbo Fei [email protected] [contributor]
Doudou Zhou [email protected] [contributor]
Useful links:
This function takes a list of numeric matrices and uses a C++ backend to find the permutation covariance
asy_cov(R_list, m, n)asy_cov(R_list, m, n)
R_list |
A list of numeric matrices with length S |
m |
An integer representing the number of sample in X |
n |
An integer representing the number of sample in Y |
A numeric matrix with row and column 2*S
This function takes a list of numeric matrices and uses a C++ backend to find the permutation mean.
asy_mean(R_list, m, n)asy_mean(R_list, m, n)
R_list |
A list of numeric matrices with length S |
m |
An integer representing the number of sample in X |
n |
An integer representing the number of sample in Y |
A numeric vector with length 2*S
This function is used in 'P_Knear_rank' to compute the degrees
degree_distribution(G, sampleIDs)degree_distribution(G, sampleIDs)
This function takes two data matrices (m x d and n x d) and other parameters to compute the MATES test statistic. It only implements the same distance, graph, and weight options across all views. For other combinations, please compute the corresponding view matrices (R_list) and use the MATES_stat function directly.
MATES( X, Y, S = 4, dt = "manhattan", gh = "NNG", wt = "kernel", pow = 0.8, perm = NULL )MATES( X, Y, S = 4, dt = "manhattan", gh = "NNG", wt = "kernel", pow = 0.8, perm = NULL )
X |
A numeric matrix of size m x d |
Y |
A numeric matrix of size n x d |
S |
An integer representing the number of moments to use |
dt |
A character string indicating the distance metric to use ("manhattan" or "Lp") |
gh |
A character string indicating the graph type to use ("NNG", "MST", or "rNNG") |
wt |
A character string indicating the weight function to use ("kernel", "rank", "distance", or "plain") |
pow |
A numeric representing the number of neighbors to use for graph, if pow = 0, then use default value 10; otherwise use round(N^pow) |
perm |
An integer indicating the number of permutation (default is NULL, which uses closed form) |
A list with the MATES test statistic (test.stat) and p-value (pval)
# MATES(X,Y,S=4,dt="manhattan",gh="NNG",wt="kernel",pow=0.8)# MATES(X,Y,S=4,dt="manhattan",gh="NNG",wt="kernel",pow=0.8)
This function takes a list of view matrices (R_list) and other parameters to compute the MATES test statistic.
MATES_test(UxUy, R_list, m, n, perm = NULL)MATES_test(UxUy, R_list, m, n, perm = NULL)
UxUy |
A numeric vector of length 2*S containing the Ux and Uy statistics for each view |
R_list |
A list of numeric matrices with length S |
m |
An integer representing the number of sample in X |
n |
An integer representing the number of sample in Y |
perm |
An integer indicating the number of permutation (default is NULL, which uses closed form) |
A list with the MATES test statistic (test.stat) and p-value (pval)
This function is used in 'P_Knear_rank'
optimalwithrank_curnode(k, cur_neis, neighbor, degree, lambda, rowrank)optimalwithrank_curnode(k, cur_neis, neighbor, degree, lambda, rowrank)
get outdirect nodes for each node
Out_direct(K, nodes)Out_direct(K, nodes)
This function builds penalized K nearest neighbor graphs with rank The output is a list containing the graph and the degree distribution
P_Knear_rank(M, K = round(nrow(M)^0.8), lambda = 0.3)P_Knear_rank(M, K = round(nrow(M)^0.8), lambda = 0.3)
M |
A numeric matrix representing the distance matrix |
K |
An integer representing the number of neighbors to use |
lambda |
A numeric representing the penalty parameter |
A list containing the truncated KNN graph (trun_KNN) and the degree distribution (degree)
Zhu, Y., & Chen, H. (2023). A new robust graph for graph-based methods. arXiv preprint arXiv:2307.15205.
This function computes the rank matrix based on the specified graph type and number of neighbors.
rank_mats(S, Dd, gtype, k)rank_mats(S, Dd, gtype, k)
S |
A numeric matrix representing the similarity matrix |
Dd |
A dist object representing the distance matrix |
gtype |
A character string indicating the graph type to use ("NNG", "MST", or "rNNG") |
k |
A numeric representing the number of neighbors to use for graph |
Zhu, Y., & Chen, H. (2023). A new robust graph for graph-based methods. arXiv preprint arXiv:2307.15205.
The rank function to calculate rank of elements of a matrix. Two possible methods: the overall rank and the row-wise rank.
Rise_Rank(S, method = "overall")Rise_Rank(S, method = "overall")
S |
A numeric matrix representing the similarity matrix |
method |
A character string indicating the ranking method to use ("overall" or "row") |
A numeric matrix representing the rank matrix