cdcov {cdcsis}R Documentation

Conditional Distance Covariance/Correlation Statistics

Description

Computes conditional distance covariance and conditional distance correlation statistics, which are multivariate measures of conditional dependence.

Usage

cdcov(x, y, z, width, index = 1, distance = FALSE)

cdcor(x, y, z, width, index = 1, distance = FALSE)

Arguments

x

a numeric vector, matrix, or dist object

y

a numeric vector, matrix, or dist object

z

z is a numeric vector or matrix. It is the variable being conditioned.

width

a user-specified positive value (univariate conditional variable) or vector (multivariate conditional variable) for gaussian kernel bandwidth. Its default value is relies on stats::bw.nrd0.

index

exponent on Euclidean distance, in (0,2]

distance

if distance = TRUE, x and y will be considered as distance matrices. Default: distance = FALSE.

Details

cdcov and cdcor compute conditional distance covariance and conditional distance correlation statistics. The sample sizes (number of rows or length of the vector) of the two variables must agree, and samples must not contain missing values. If we set distance = TRUE, arguments x, y can be a dist object recording distance between samples; otherwise, these arguments are treated as multivariate data.

Value

cdcov

conditional distance covariance test statistic.

cdcor

conditional distance correlation statistic.

cdc

conditional distance covariance/correlation vector.

Author(s)

Canhong Wen, Wenliang Pan, and Xueqin Wang

References

Wang, X., Pan, W., Hu, W., Tian, Y. and Zhang, H., 2015. Conditional distance correlation. Journal of the American Statistical Association, 110(512), pp.1726-1734.

See Also

cdcor

Examples

library(cdcsis)

############# Conditional Distance Covariance #############
set.seed(1)
x <- rnorm(25)
y <- rnorm(25)
z <- rnorm(25)
cdcov(x, y, z)
############# Conditional Distance Correlation #############
num <- 25
set.seed(1)
x <- rnorm(num)
y <- rnorm(num)
z <- rnorm(num)
cdcor(x, y, z)

[Package cdcsis version 2.0.3 Index]