# 用陶哲轩公式求解特征向量

Tao’s equation aims to get the eigenvectors from Hemi-matrix from the eigenvalues of the matrix as well as the sub matrix. This could allow to calculate the eigenvectors to be easy and more flexible.

# R code (Simple one)

set.seed(1992)
dat = mvtnorm::rmvnorm(100,sigma = diag(10))
dat.std = scale(dat)

# get variance-covariance matrix
A = cov(dat.std)

lam_A = eigen(A)$values n = nrow(A) res = rep(1, n) for (i in 1:n) { for (k in {1:n}[-i]) { res[i] = res[i] * (lam_A[i] - lam_A[k]) } } # get M_1,得到第一子矩阵 M_1 = A[-1, -1] lam_M_1 = eigen(M_1)$values
res2=rep(1, n)
for (i in 1:n) {
for (k in {1:(n-1)}) {
res2[i] = res2[i] * (lam_A[i] - lam_M_1[k])
}
}

# compare tao's eqation with eigenvector 1 using eigen() func
(tao = res2 / res)
(eigen(A)\$vectors[1,])^2