R语言求特征值和特征向量

> a=diag(4)+1

> a
     [,1] [,2] [,3] [,4]
[1,]    2    1    1    1
[2,]    1    2    1    1
[3,]    1    1    2    1
[4,]    1    1    1    2

> a.e=eigen(a,symmetric=T)

> a.e
eigen() decomposition
$`values`
[1] 5 1 1 1

$vectors
     [,1]       [,2]       [,3]       [,4]
[1,] -0.5  0.8660254  0.0000000  0.0000000
[2,] -0.5 -0.2886751 -0.5773503 -0.5773503
[3,] -0.5 -0.2886751 -0.2113249  0.7886751
[4,] -0.5 -0.2886751  0.7886751 -0.2113249

>a.e$vectors%*%diag(a.e$values)%*%t(a.e$vectors)
     [,1] [,2] [,3] [,4]
[1,]    2    1    1    1
[2,]    1    2    1    1
[3,]    1    1    2    1
[4,]    1    1    1    2

最后一个是 A = V Λ V T A=V\Lambda V^T A=VΛVT

你可能感兴趣的:(统计学基础)