Package 'dccpp'

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-20 06:25:41 UTC
Source: CRAN

Help Index


Distance Correlation

Description

Distance Correlation

Usage

dcor(x,y)

Arguments

x

numeric vector

y

numeric vector

Value

Returns a numeric value: the distance correlation between x and y.

Examples

## 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

Description

Distance Covariance

Usage

dcov(x,y)

Arguments

x

numeric vector

y

numeric vector

Details

Implements the algorithm described in Chaudhuri, Hu (2019) doi:10.1016/j.csda.2019.01.016 which only has O(n log(n)) complexity.

Value

Returns a numeric value: the distance covariance between x and y.

Examples

## Not run: 

set.seed(1)
x < -rnorm(1000)
y < -x ^ 2

dcov(x, y)
dvov(x, x)
dvov(y, y)


## End(Not run)