dcor.matrix {Pigengene} | R Documentation

## Computes distance correlation for give matrix

### Description

This function computes the distance correlation between every pair of columns of the input data matrix.

### Usage

    dcor.matrix(Data)

### Arguments

`Data` | A matrix containing the data

### Details

Using for loops, all pairs of columns are passed to `link[energy]{dcor}` function from `link[energy]{energy-package}`.

### Value

A numeric square matrix. The number of rows and columns is equal to the number of columns of `Data` and they are named accordingly.

### Note

This function uses for loops, which are not efficient for an input matrix with too many columns.

### Author(s)

Habil Zare

### References

Szekely, G.J., Rizzo, M.L., and Bakirov, N.K. (2007), Measuring and Testing Dependence by Correlation of Distances, _Annals of Statistics_, Vol. 35 No. 6, pp. 2769-2794.

<URL: http://dx.doi.org/10.1214/009053607000000505>

Szekely, G.J. and Rizzo, M.L. (2009), Brownian Distance Covariance, _Annals of Applied Statistics_, Vol. 3, No. 4, 1236-1265.

<URL: http://dx.doi.org/10.1214/09-AOAS312>

Szekely, G.J. and Rizzo, M.L. (2009), Rejoinder: Brownian Distance Covariance, _Annals of Applied Statistics_, Vol. 3, No. 4, 1303-1308.

### See Also

`link[energy]{dcor}`

### Examples

    ## Data:
    data(aml)
    dcor1 <- dcor.matrix(Data=aml[,1:5])
    dcor1

    ## Comparison with Pearson:
    cor1 <- abs(cor(aml[,1:5]))
    ## With 202 samples, distance and Pearson correlations do not differ much:
    dcor1-cor1
    dcor2 <- dcor.matrix(Data=aml[1:20,1:5])
    cor2 <- abs(cor(aml[1:20,1:5]))
    ## Distance correlation is more robust if fewer samples are available:
    dcor2-cor2
    plot(dcor2-cor1,cor1-cor2,xlim=c(-0.5,0.5),ylim=c(-0.5,0.5))

[Package Pigengene version 1.12.0 Index]