Description Usage Arguments Details Value Author(s) Examples
An implementation of N-distance (N-statistic) functions. A permutation test based on the N-distance can be viewed as a nonparametric and omnibus alternative to Mahalanobis distance. This test has been successfully used in detecting differentially expressed genes, differentially associated genes, etc.
1 2 3 | Ndist(Xlist, Ylist, kernels=c("L1", "L2", "Linf"))
Ndist.perm(Xlist, Ylist, combs, kernels=c("L1", "L2", "Linf"))
|
Xlist, Ylist |
Two lists of multivariate samples to be compared. As an example, Xlist can be several FA maps sampled from the control group and Ylist can be FA maps sampled from the treatment group. arrays/vectors. The elements in these lists must be either R vectors or arrays. |
kernels |
A list of kernels used in the N-distance. Since the computational cost is very small, by default it computes them all. |
combs |
A list of permutations/combinations which can be
generated by either |
N-distance is numerically stable (no matrix inverse involved at all) and quite capable of detecting location shift (almost as powerful as t-test). These functions are implemented in C for efficiency.
A list of N-distances using different kernels (Ndist()
) or
an K by N dimensional matrix of N-distances (Ndist.perm()
),
where each row represents one permutation and each column a kernel.
Xing Qiu
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Generate some FA maps
N.x <- 32; N.y <- 32; N.z <- 3
for (i in 1:8) assign(paste("FA",i,sep=""), array(rnorm(N.x*N.y*N.z), c(N.x,N.y,N.z)))
grids <- list(2*(1:N.x)-1, 2*(1:N.y)-1, 2*(1:N.z)-1)
Xlist <- list(FA1, FA2, FA3, FA4); Ylist <- list(FA5, FA6, FA7, FA8)
Ndist(Xlist, Ylist) # a vector of length 3
## Now generate a list of 70 possible combinations.
combs <- combn(8, 4, function(x) c(x,setdiff(1:8,x)), simplify=FALSE)
Ndist.perm(Xlist, Ylist, combs) # a 70x3 matrix.
## You can also use a list of random permutations
combs2 <- foreach(icount(10)) %do% sample(8)
Ndist.perm(Xlist, Ylist, combs2) # a 10x3 matrix.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.