Learn R Programming

steadyICA (version 1.0)

multidcov: Symmetric multivariate distance covariance

Description

Calculate either the symmetric or asymmetric multivariate distance covariance statistic.

Usage

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.

Value

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

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])

See Also

dcovustat, energy::dcov

Examples

Run this code
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

Run the code above in your browser using DataLab