Learn R Programming

MDCcure (version 0.1.0)

pmdc: Partial Martingale Difference Correlation (pMDC)

Description

pmdd measures conditional mean dependence of Y given X, adjusting for the dependence on Z.

Usage

pmdc(X, Y, Z)

Value

Returns the squared partial martingale difference correlation of Y given X, adjusting for the dependence on Z.

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.

Z

A vector or matrix where rows represent samples and columns represent variables.

References

Park, T., Shao, X., and Yao, S. (2015). Partial martingale difference correlation. Electronic Journal of Statistics, 9(1), 1492-1517. tools:::Rd_expr_doi("10.1214/15-EJS1047").

Examples

Run this code
# Generate example data
set.seed(123)
n <- 50
x <- matrix(rnorm(n * 5), nrow = n)  # explanatory variables
y <- matrix(rnorm(n), nrow = n)      # response variable
z <- matrix(rnorm(n * 2), nrow = n)  # conditioning variables

# Compute partial MDD
pmdd(x, y, z)

Run the code above in your browser using DataLab