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 |
y |
a numeric vector, matrix, or |
z |
|
width |
a user-specified positive value (univariate conditional variable) or vector (multivariate conditional variable) for
gaussian kernel bandwidth. Its default value is relies on |
index |
exponent on Euclidean distance, in |
distance |
if |
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
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)