.wassersteinTestSp {waddR} | R Documentation |
Two-sample test to check for differences between two distributions (conditions) using the 2-Wasserstein distance: Semi-parametric implementation using a permutation test with a generalized Pareto distribution (GPD) approximation to estimate small p-values accurately
.wassersteinTestSp(x, y, permnum = 10000)
x |
univariate sample (vector) representing the distribution of condition A |
y |
univariate sample (vector) representing the distribution of condition B |
permnum |
number of permutations used in the permutation testing procedure |
This is the semi-parametric version of wasserstein.test, for the asymptotic procedure see .wassersteinTestAsy
Details concerning the permutation testing procedure with GPD approximation to estimate small p-values accurately can be found in Schefzik and Goncalves (2019).
A vector concerning the testing results, precisely (see Schefzik and Goncalves (2019) for details)
d.wass: 2-Wasserstein distance between the two samples computed by quantile approximation
d.wass^2: squared 2-Wasserstein distance between the two samples computed by quantile approximation
d.comp^2: squared 2-Wasserstein distance between the two samples computed by decomposition approximation
d.comp: 2-Wasserstein distance between the two samples computed by decomposition approximation
location: location term in the decomposition of the squared 2-Wasserstein distance between the two samples
size: size term in the decomposition of the squared 2-Wasserstein distance between the two samples
shape: shape term in the decomposition of the squared 2-Wasserstein distance between the two samples
rho: correlation coefficient in the quantile-quantile plot
pval: p-value of the semi-parametric 2-Wasserstein distance-based test
p.ad.gpd: in case the GPD fitting is performed: p-value of the Anderson-Darling test to check whether the GPD actually fits the data well (otherwise NA). NOTE: GPD fitting is currently not supported!
N.exc: in case the GPD fitting is performed: number of exceedances (starting with 250 and iteratively decreased by 10 if necessary) that are required to obtain a good GPD fit (i.e. p-value of Anderson-Darling test greater or eqaul to 0.05) (otherwise NA) NOTE: GPD fitting is currently not supported!
perc.loc: fraction (in overall squared 2-Wasserstein distance obtained by the decomposition approximation
perc.size: fraction (in overall squared 2-Wasserstein distance obtained by the decomposition approximation
perc.shape: fraction (in overall squared 2-Wasserstein distance obtained by the decomposition approximation
decomp.error: relative error between the squared 2-Wasserstein distance computed by the quantile approximation and the squared 2-Wasserstein distance computed by the decomposition approximation
Schefzik, R. and Goncalves, A. (2019).