Distance correlation t-test of multivariate and functional independence (wrapper functions of energy package).
dcor.xy(x,y,test=TRUE,metric.x,metric.y,par.metric.x,
par.metric.y,n)
dcor.test(D1,D2,n)
bcdcor.dist(D1,D2,n)
dcor.dist(D1, D2)
data (fdata, matrix or data.frame class) of first sample.
data (fdata, matrix or data.frame class) of second sample.
if TRUE, compute bias corrected distance correlation statistic and the corresponding t-test, else compute distance correlation statistic.
Name of metric or semi-metric function used for compute the
distances of x
and y
object respectively. By default, metric.lp
for functional data and metric.dist
for multivariate data.
List of parameters for the corresponding metric function.
The sample size used in bias corrected version of distance correlation, by default is the number of rows of x
.
Distances of first sample.
Distances of second sample.
dcor.test
returns a list with class htest
containing
description of test
observed value of the test statistic
degrees of freedom
bias corrected distance correlation bcdcor(x,y)
p-value of the t-test
description of data
dcor.xy returns the previoius list with class htest and
the distance matrix of x
the distance matrix of y
These wrapper functions extend the functions of the energy
package for multivariate data to functional data.
Distance correlation is a measure of dependence between random vectors introduced by Szekely, Rizzo, and Bakirov (2007).
dcor.xy
performs a nonparametric t-test of
multivariate or functional independence in high dimension. The distribution of
the test statistic is approximately Student t with \(n(n-3)/2-1\)
degrees of freedom and for \(n \geq 10\) the statistic is approximately
distributed as standard normal. Wrapper function of energy:::dcor.ttest
. The t statistic is a transformation of a bias corrected version of distance correlation (see SR 2013 for details). Large values (upper tail) of the t statistic are significant.
dcor.test
similar to dcor.xy
but only for distance matrix.
dcor.dist
compute distance correlation statistic. Wrapper function of
energy:::dcor
but only for distance matrix.
bcdcor.dist
compute bias corrected distance correlation statistic. Wrapper function of energy:::bcdcor
but only for distance matrix.
Szekely, G.J. and Rizzo, M.L. (2013). The distance correlation t-test of independence in high dimension. Journal of Multivariate Analysis, Volume 117, pp. 193-213. http://dx.doi.org/10.1016/j.jmva.2013.02.012
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. http://dx.doi.org/10.1214/009053607000000505
metric.lp
amd metric.dist
.
# NOT RUN {
x<-rproc2fdata(100,1:50)
y<-rproc2fdata(100,1:50)
dcor.xy(x, y,test=TRUE)
dx <- metric.lp(x)
dy <- metric.lp(y)
dcor.test(dx, dy)
bcdcor.dist(dx, dy)
dcor.xy(x, y,test=FALSE)
dcor.dist(dx, dy)
# }
Run the code above in your browser using DataCamp Workspace