Description Usage Arguments Examples

View source: R/mdcov.R View source: R/RcppExports.R

Marginal distance covariance This function implements the method of calculating distance covariance between y and each column in x

1 2 3 |

`y` |
the matrix of y |

`x` |
the matrix of x, distance covariance is calculated for each variable in x with y. |

`type` |
"V" or "U", for V- or U-statistics of distance covariance or correlation. The default value is "V". |

1 2 3 4 5 6 7 8 9 10 11 12 13 | ```
n = 200; p = 10
y = matrix(rnorm(n*2),n,2)
x = matrix(rnorm(n*p),n,p)
res1 = mdcov(y,x)
res2 = numeric(p)
for(j in 1:p){res2[j] = dcov::dcov(y,x[,j])}
# res1 is same with res2
res1 - res2
res3 = mdcor(y,x)
res4 = numeric(p)
for(j in 1:p){res4[j] = dcov::dcor(y,x[,j])}
# res3 is same with res4
res3-res4
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.