mdd {MDCcure} | R Documentation |
Martingale Difference Divergence (MDD)
Description
mdd
computes the squared martingale difference divergence (MDD) between response variable(s) Y
and explanatory variable(s) X
, measuring conditional mean dependence.
Usage
mdd(X, Y, center = "U")
Arguments
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:
Default is |
Value
Returns the squared Martingale Difference Divergence of Y
given X
.
References
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. doi:10.1080/01621459.2014.887012.
Examples
# Generate example data
set.seed(123)
n <- 50
x <- matrix(rnorm(n * 5), nrow = n) # multivariate explanatory variables
y_vec <- rbinom(n, 1, 0.5) # univariate response
y_mat <- matrix(rnorm(n * 2), nrow = n) # multivariate response
# Compute MDD with vector Y and U-centering
mdd(x, y_vec, center = "U")
# Compute MDD with matrix Y and double-centering
mdd(x, y_mat, center = "D")