Code covered by the BSD License  

Highlights from
Distance correlation

4.5
4.5 | 2 ratings Rate this file 29 Downloads (last 30 days) File Size: 1.48 KB File ID: #39905

Distance correlation

by

Shen Liu (view profile)

 

Distance correlation calculation

| Watch this File

File Information
Description

This function calculates the distance correlation between two samples x and y.

It is especially useful when x and y have weak linear dependence but strong nonlinear dependence.

For example, if
x = -10:10; x = x'
y = x.^2;
then corr(x,y) is approximately zero. However, the distance correlation between x and y is nearly 0.5.

Note: distance correlation is zero if and only if x and y are statistically independent.

Author: Shen Liu
Date: 18/01/2013
Reference: http://en.wikipedia.org/wiki/Distance_correlation

Acknowledgements

This file inspired Dcorr( X, Y ).

Required Products MATLAB
MATLAB release MATLAB 7.14 (R2012a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (4)
10 Mar 2015 Paolo Inglese  
13 Jun 2014 Jorge

Jorge (view profile)

What is he reason for validation of dimension?

Comment only
13 Jun 2014 Jorge

Jorge (view profile)

What is he reason for validation of dimension?

13 Jun 2014 precuneus

Using bsxfun you could get this function more efficient, e.g.
A = a - bsxfun(@plus,mean(a),mean(a,2))+mean(a(:));

Comment only

Contact us