ind_test: Test for Complete Multivariate Independence

View source: R/ind_test.R

ind_testR Documentation

Test for Complete Multivariate Independence

Description

Performs a test of total independence of the components of a multivariate random vector. The test is an L2-type statistic based on characteristic functions, with optional score transformations and resampling-based p-values.

Usage

ind_test(X, n.rep = 200, score = "Identity", weight = "Gauss",
         strategy = "bootstrap", ncores = NULL, iseed = NULL)

Arguments

X

Matrix or data frame of numeric data; rows correspond to observations and columns to variables.

n.rep

Number of bootstrap replications or permutations used to approximate the null distribution.

score

Score transformation applied marginally to the data: "Identity" (raw data), "Rank" (componentwise ranks), or "VdW" (van der Waerden/normal scores).

weight

Weight function used in the L2-type statistic: "Gauss" (Gaussian) or "Laplace" (Laplace).

strategy

Resampling strategy used to obtain p-values: "bootstrap" or "permutation".

ncores

Number of CPU cores to use for resampling computations. If NULL, computation is done sequentially.

iseed

Optional integer seed for reproducibility of resampling.

Details

The null hypothesis of the test is that all components of the random vector represented by X are mutually independent. The test statistic is constructed as an L2-type distance between the empirical joint characteristic function of the data and the product of the corresponding empirical marginal characteristic functions.

Score transformations. The test may be applied directly to the data (score = "Identity") or after marginal score transformations. With score = "Rank", each marginal variable is replaced by its scaled ranks, leading to a test that is invariant under strictly increasing marginal transformations and distribution-free under the null hypothesis. With score = "VdW", van der Waerden (normal) scores are used to enhance power under a broad class of alternatives.

Weight functions. The L2-type statistic involves integration with respect to a weight function on the characteristic function domain. Gaussian and Laplace weights are available via weight. van der Waerden scores are currently implemented only for Gaussian weights.

P-values via resampling. The null distribution of the test statistic is approximated using resampling:

  • strategy = "permutation" independently permutes the observations within each variable, thereby destroying cross-component dependence while preserving marginal distributions.

  • strategy = "bootstrap" generates a reference distribution using resampling with replacement under an independence structure.

The p-value is computed as the proportion of resampled statistics at least as large as the observed one.

Value

An object of class "htest" containing:

statistic

The observed value of the test statistic.

p.value

Approximate p-value based on resampling.

method

A character string describing the test, including score, weight, and resampling strategy.

data.name

Name of the input data X.

alternative

A character string describing the alternative hypothesis (lack of mutual independence).

parameter

The number of resampling replicates n.rep.

References

Hallin, M., Meintanis, S.G. and Nordhausen, K. (2024), Consistent distribution free affine invariant tests for the validity of independent component models. arXiv:2404.07632.

See Also

icm_test

Examples

# in practice, the number of resamples should be much larger
n <- 100
X <- matrix(rnorm(n * 3), ncol = 3)

res <- ind_test(X)
res

TICM documentation built on Feb. 12, 2026, 1:07 a.m.