Learn R Programming

cdcsis (version 1.0)

cdcor.ada: Conditional Distance Correlation with Adaptive Bandwidth

Description

Performs conditional distance correlation with adaptive bandwidth.

Usage

cdcor.ada(x, y, z, tol = 0.1,index = 1)

Arguments

x

a numeric vector or matrix

y

a numeric vector or matrix with compatible dimensions to x

z

the variable being conditioned. z is a numeric vector or matrix with compatible dimensions to x

tol

the tolerance used in the bandwidth selection

index

exponent on Euclidean distance, in (0,2]

Value

Returns an object with

cdcor

conditional distance correlation

width

bandwidth used in cor. It is determined by the bw function.

Details

It performs conditional distance correlation with adaptive bandwidth. The bandwidth is determined by the bw function.

References

Canhong Wen, Wenliang Pan, Mian Huang and Xueqin Wang(2014). Conditional distance correlation sure independence screening for ultrahigh dimensional data. Submitted to Biostatistics.

See Also

cdcor

Examples

Run this code
# NOT RUN {
 set.seed(1)
 # load the distance correlation for comparison
 require(energy) 

 ## independent case
 x <- rnorm(100)
 y <- rnorm(100)
 z <- rnorm(100)
 cdcor.ada(x,y,z)
 dcor(x,y)

 ## conditional dependent case
 x <- rnorm(100)
 y <- x + 0.1*rnorm(100)
 z <- rnorm(100)
 cdcor.ada(x,y,z)
 dcor(x,y)

 ## conditional independent case: x and z are correlated
 require(MASS)
 data <- mvrnorm(100,rep(0,2),matrix(c(1,0.8,0.8,1),2,2))
 x <- data[,1]
 z <- data[,2]
 y <- z + 0.1*rnorm(100)
 cdcor.ada(x,y,z)
 dcor(x,y)

# }

Run the code above in your browser using DataLab