multidcov: Symmetric multivariate distance covariance

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Calculate either the symmetric or asymmetric multivariate distance covariance statistic.

Usage

1
multidcov(S,symmetric=TRUE,alpha=1)

Arguments

S

the n x d matrix for which you wish to calculate the dependence between d columns from n samples

alpha

A scaling parameter in the interval (0,2] used for calculating distances.

symmetric

logical; if TRUE (the default), calculates the symmetric version of the multivariate distance covariance. See details.

Details

If symmetric==TRUE, calculates: sum_i=1^d dcovustat(S[,i],S[,-i]) If symmetric==FALSE, calculates: sum_i=1^d-1 dcovustat(S[,i],S[,(i+1):d])

Value

returns a scalar equal to the multivariate distance covariance statistic for the columns of S

Author(s)

David Matteson

See Also

dcovustat, energy::dcov

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
nObs <- 1024
nComp <- 3

simM <- matrix(rnorm(nComp*nComp),nComp)

# simulate some data:
simS<-cbind(rgamma(nObs, shape = 1, scale = 2),
            rgamma(nObs, shape = 3, scale = 2),
            rgamma(nObs, shape = 9, scale = 0.5))


simS <- scale(simS) #Standardize variance for identifiability

#mix the sources:
xData <- simS %*% simM

multidcov(simS) #close to zero
multidcov(whitener(xData)$Z) #should be larger than simS
multidcov(xData) #greater than zero

Example output

Loading required package: Rcpp
Loading required package: MASS
Loading required package: clue
Loading required package: combinat

Attaching package: 'combinat'

The following object is masked from 'package:utils':

    combn

[1] -0.0006086827
[1] 0.07504765
[1] 0.974762

steadyICA documentation built on May 2, 2019, 7:30 a.m.