View source: R/distance_cov_cor.R

Distance variance and covariance | R Documentation |

Distance variance and covariances.

dvar(x) dcov(x, y)

`x` |
A numerical matrix or a vector. |

`y` |
A numerical matrix or a vector. |

The distance variance of a matrix/vector or the distance covariance of two matrices is calculated. For the distance variance of a vector we use the fast method of Huo and Szekely (2016).

The distance covariance or distance variance.

Manos Papadakis

R implementation and documentation: Michail Tsagris <mtsagris@uoc.gr> and Manos Papadakis <papadakm95@gmail.com>.

Szekely G.J., Rizzo M.L. and Bakirov N.K.(2007). Measuring and Testing Independence by Correlation of Distances. Annals of Statistics, 35(6):2769-2794.

Huo X. and Szekely G. J. (2016). Fast computing for distance covariance. Technometrics, 58(4): 435-447.

```
dcor, edist
```

x <- as.matrix(iris[1:50, 1:4]) y <- as.matrix(iris[51:100, 1:4]) res <- dcov(x, y) res <- dvar(x[, 1])

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.