distcov.test: Performs a distance covariance test.

View source: R/distcov_test2.R

distcov.testR Documentation

Performs a distance covariance test.

Description

Performs a distance covariance test.

Usage

distcov.test(
  X,
  Y,
  method = "permutation",
  b = 499L,
  ln = 20,
  affine = FALSE,
  standardize = FALSE,
  bias.corr = FALSE,
  type.X = "sample",
  type.Y = "sample",
  metr.X = "euclidean",
  metr.Y = "euclidean",
  use = "all",
  return.data = FALSE,
  algorithm = "auto"
)

Arguments

X

contains either the first sample or its corresponding distance matrix.

In the first case, X can be provided either as a vector (if one-dimensional), a matrix or a data.frame (if two-dimensional or higher).

In the second case, the input must be a distance matrix corresponding to the sample of interest.

If X is a sample, type.X must be specified as "sample". If X is a distance matrix, type.X must be specified as "distance".

Y

see X.

method

specifies the type of test that is performed.

"permutation" performs a Monte Carlo Permutation test.

"gamma" performs a test based on a gamma approximation of the test statistic under the null \insertCitehuang2017statisticallydcortools. This test tends to be anti-conservative, if the “real” p-value is small

"conservative" performs a conservative two-moment approximation \insertCiteberschneider2018complexdcortools.

"bb3" performs a three-moment approximation \insertCiteberschneider2018complexdcortools. This is the most precise parametric option, but only available with the standard algorithm.

"wildbs1" and "wilbs2" perform wild bootstrap tests \insertCitechwialkowski2014wilddcortools; experimental at the moment.

b

integer; specifies the number of random permutations/bootstrap samples used for the permutation or wild bootstraps tests. Ignored for other tests.

ln

numeric; block size parameter for wild bootstrap tests. Ignored for other tests.

affine

logical; specifies if the affinely invariant distance covariance \insertCitedueck2014affinelydcortools should be calculated or not.

standardize

logical; specifies if X and Y should be standardized dividing each component by its standard deviations. No effect when affine = TRUE.

bias.corr

logical; specifies if the bias corrected version of the sample distance covariance \insertCitehuo2016fastdcortools should be calculated.

type.X

For "distance", X is interpreted as a distance matrix. For "sample", X is interpreted as a sample.

type.Y

see type.X.

metr.X

specifies the metric which should be used to compute the distance matrix for X (ignored when type.X = "distance").

Options are "euclidean", "discrete", "alpha", "minkowski", "gaussian", "gaussauto", "boundsq" or user-specified metrics (see examples).

For "alpha", "minkowski", "gauss", "gaussauto" and "boundsq", the corresponding parameters are specified via "c(metric, parameter)", c("gaussian", 3) for example uses a Gaussian metric with bandwidth parameter 3; the default parameter is 2 for "minkowski" and "1" for all other metrics.

See \insertCitelyons2013distance,sejdinovic2013equivalence,bottcher2017detecting;textualdcortools for details.

metr.Y

see metr.X.

use

specifies how to treat missing values. "complete.obs" excludes NAs, "all" uses all observations.

return.data

logical; specifies if the test object should contain the original data.

algorithm

specifies the algorithm used for calculating the distance covariance.

"fast" uses an O(n log n) algorithm if the observations are one-dimensional and metr.X and metr.Y are either "euclidean" or "discrete", see also \insertCitehuo2016fast;textualdcortools.

"memsave" uses a memory saving version of the standard algorithm with computational complexity O(n^2) but requiring only O(n) memory.

"standard" uses the classical algorithm. User-specified metrics always use the classical algorithm.

"auto" chooses the best algorithm for the specific setting using a rule of thumb.

Value

distcov.test object

References

\insertRef

berschneider2018complexdcortools

\insertRef

bottcher2017detectingdcortools

\insertRef

chwialkowski2014wilddcortools

\insertRef

dueck2014affinelydcortools

\insertRef

huang2017statisticallydcortools

\insertRef

huo2016fastdcortools

\insertRef

lyons2013distancedcortools

\insertRef

sejdinovic2013equivalencedcortools

\insertRef

szekely2007dcortools

\insertRef

szekely2009browniandcortools


dcortools documentation built on Dec. 10, 2022, 1:09 a.m.