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

  • Post author:
  • Post category:其他


> 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


Λ



V










T













版权声明:本文为W_LAILAI原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。