gmultidcov {steadyICA}R Documentation

Symmetric multivariate distance covariance for grouped components

Description

Calculate either the symmetric or asymmetric multivariate distance covariance statistic for a given grouping of the components.

Usage

gmultidcov(S,group=1:ncol(S),alpha=1,symmetric=TRUE)

Arguments

S

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

group

A length d vector which indicates group membership for each component

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

Suppose that the groups are numbered 1,2,...,C and that group is a vector indicating group membership for each component. If symmetric==TRUE, calculates: sum_i=1^C dcovustat(S[,group==i],S[,group!=i]) If symmetric==FALSE, calculates: sum_i=1^C-1 dcovustat(S[,group==i],S[,group>i])

Value

Returns a scalar equal to the multivariate distance covariance statistic for grouped components of S.

Author(s)

Nicholas James

See Also

dcovustat, energy::dcov

Examples


library(steadyICA)
S = matrix(rnorm(300),ncol=3)
group = c(1,2,2)
gmultidcov(S,group,TRUE) # close to zero
gmultidcov(S,group,FALSE) # sill close to zero

Sigma = matrix(c(1,0.7,0,0.7,1,-0.2,0,-0.2,1),ncol=3)
X = MASS::mvrnorm(100,rep(0,3),Sigma)
gmultidcov(X,group,TRUE) # further from zero
gmultidcov(X,group,FALSE) # further from zero


[Package steadyICA version 1.0 Index]