我下载了一个脚本来使用彩色圆圈绘制相关矩阵。该脚本允许使用 PCA 对变量进行排序,但我不确定它是如何工作的。负责订购的代码如下:
if (order) {
if(!n==m){
stop("The matrix must be squre if order is TRUE!")
}
x.eigen <- eigen(corr)$vectors[, 1:2]
e1 <- x.eigen[, 1]
e2 <- x.eigen[, 2]
alpha <- ifelse(e1 > 0, atan(e2/e1), atan(e2/e1) + pi)
corr <- corr[order(alpha), order(alpha)]
}
问题: 对这种排序的解释是什么,其背后的理论是什么?