# Simple linear relationship x1 <- -20:20 y1 <- x1 rnorm(41,0,4) plot(y1~x1, pch =18) cor(x1,y1) distanceCorrelation(x1,y1) MIC(x1,y1)
- Pearson's r = 0.95
- 距离相关性 = 0.95
- MIC = 0.89
简单二次函数
# y ~ x**2 x2 <- -20:20 y2 <- x2**2 rnorm(41,0,40) plot(y2~x2, pch = 18) cor(x2,y2) distanceCorrelation(x2,y2) MIC(x2,y2)
- Pearson's r = 0.003
- 距离相关性 = 0.474
- MIC = 0.594
三次函数
# Cosine x3 <- -20:20 y3 <- cos(x3/4) rnorm(41,0,0.2) plot(y3~x3, type='p', pch=18) cor(x3,y3) distanceCorrelation(x3,y3) MIC(x3,y3)
- Pearson's r =- 0.035
- 距离相关性 = 0.382
- MIC = 0.484
圆函数
# Circle n <- 50 theta <- runif (n, 0, 2*pi) x4 <- append(cos(theta), cos(theta)) y4 <- append(sin(theta), -sin(theta)) plot(x4,y4, pch=18) cor(x4,y4) distanceCorrelation(x4,y4) MIC(x4,y4)
- Pearson's r < 0.001
- 距离相关性 = 0.234
- MIC = 0.218