Heller-Heller-Gorfine multivariate test of association
inversions.c
must be compiled from C source code into a MEX file.
This code was tested in MATLAB R2017b. A MATLAB-compatible C compiler is required, as is the MATLAB Statistics and Machine Learning Toolbox.
HHGPermutationTest
takes five input arguments:
X
: The first input data matrix. Rows are assumed to represent samples, and columns are assumed to represent dimensions.Y
: The second input data matrix.Y
must contain the same number of samples asX
.nperm
: The number of permutations to perform. The default value is 100.maxN
: The maximum sample size for which the full distance matrices will be held in memory. If the sample size exceedsmaxN
, the distance matrices will be computed incrementally and stored on disk.
Once computation is completed, HHGPermutationTest
returns up to three output arguments:
p
: The p-value of the permutation test. Ifp < 1/nperm
, a value of 0 is returned.t
: The value of the HHG test statistic.pstat
: The values of the HHG test statistic for each permutation.
- Heller, R., Heller, Y., & Gorfine, M. (2012). "A consistent multivariate test of association based on ranks of distances." Biometrika, 100(2), 503-510. (Link)
This project is licensed under the MIT License.