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
Cite As
Shen Liu (2026). Distance correlation (https://www.mathworks.com/matlabcentral/fileexchange/39905-distance-correlation), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- AI and Statistics > Statistics and Machine Learning Toolbox > Descriptive Statistics and Visualization > Statistical Visualization > Box Plots >
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
