mdc | R Documentation |
mdc
computes the squared martingale difference correlation between a response variable Y
and explanatory variable(s) X
, measuring conditional mean dependence.
X
can be either univariate or multivariate.
mdc(X, Y, center = "U")
X |
A vector or matrix where rows represent samples and columns represent variables. |
Y |
A vector or matrix where rows represent samples and columns represent variables. |
center |
Character string indicating the centering method to use. One of:
|
Returns the squared martingale difference correlation of Y
given X
.
Shao, X., and Zhang, J. (2014). Martingale difference correlation and its use in high-dimensional variable screening. Journal of the American Statistical Association, 109(507), 1302-1318. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/01621459.2014.887012")}.
mdd
, mdc_test
# Generate example data
set.seed(123)
n <- 50
x <- matrix(rnorm(n * 5), nrow = n) # multivariate data with 5 variables
y <- rbinom(n, 1, 0.5) # binary covariate
# Compute MDC with U-centering
mdc(x, y, center = "U")
# Compute MDC with double-centering
mdc(x, y, center = "D")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.