Learn R Programming

cdcsis (version 1.0)

bw: Bandwidth Selection in the Conditional Distance Correlation

Description

bw is used to select the bandwidth in the conditional distance correlation estimation.

Usage

bw(x, y, z, 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

index

exponent on Euclidean distance, in (0,2]

Value

The plug-in bandwidth.

Details

For univariate z, the univariate plug-in selector of Wand & Jones (1994) is used. That is, hpi function in the ks package is used.

For multivariate z, an diagonal matrix of the bandwidth is assumed, i.e., select the optimal bandwidth with hpi individually for each column of z.

References

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

Wand, M.P. & Jones, M.C. (1995) Kernel Smoothing. Chapman & Hall.

See Also

cdcor, cdcor.ada

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)
 bw(x,y,z)
 cdcor.ada(x,y,z)
 dcor(x,y)

 ## conditional dependent case
 x <- rnorm(100)
 y <- x + 0.1*rnorm(100)
 z <- rnorm(100)
 bw(x,y,z)
 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)
 bw(x,y,z)
 cdcor.ada(x,y,z)
 dcor(x,y)
# }

Run the code above in your browser using DataLab