Title: | Fast Computation of Distance Correlations |
---|---|
Description: | Fast computation of the distance covariance 'dcov' and distance correlation 'dcor'. The computation cost is only O(n log(n)) for the distance correlation (see Chaudhuri, Hu (2019) <arXiv:1810.11332> <doi:10.1016/j.csda.2019.01.016>). The functions are written entirely in C++ to speed up the computation. |
Authors: | Jonathan Berrisch [aut, cre] |
Maintainer: | Jonathan Berrisch <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.1.0 |
Built: | 2024-11-04 05:04:11 UTC |
Source: | https://github.com/berrij/dccpp |
Distance Correlation
dcor(x,y)
dcor(x,y)
x |
numeric vector |
y |
numeric vector |
Returns a numeric value: the distance correlation between x and y.
## Not run: set.seed(1) x < -rnorm(1000) y < -x ^ 2 dcor(x, y) # dcor shows dependence between x and y cor(x, y) # cor does not detect any depencence due to nonlinearity ## End(Not run)
## Not run: set.seed(1) x < -rnorm(1000) y < -x ^ 2 dcor(x, y) # dcor shows dependence between x and y cor(x, y) # cor does not detect any depencence due to nonlinearity ## End(Not run)
Distance Covariance
dcov(x,y)
dcov(x,y)
x |
numeric vector |
y |
numeric vector |
Implements the algorithm described in Chaudhuri, Hu (2019) doi:10.1016/j.csda.2019.01.016 which only has O(n log(n)) complexity.
Returns a numeric value: the distance covariance between x and y.
## Not run: set.seed(1) x < -rnorm(1000) y < -x ^ 2 dcov(x, y) dvov(x, x) dvov(y, y) ## End(Not run)
## Not run: set.seed(1) x < -rnorm(1000) y < -x ^ 2 dcov(x, y) dvov(x, x) dvov(y, y) ## End(Not run)