Search code examples
rstatisticseigeneigenvectoreigenvalue

Eigen Analysis of this matrix in R


enter image description here

I'm doing eigen analysis of given matrix P in R. My MWE is

Minimum working example

P <-
 matrix(
  data=
    c(
        1, 0, 0, 0
      , 0.4, 0, 0.6, 0
      , 0.2, 0, 0.1, 0.7
      , 0, 0, 0, 1
      )
   , nrow=4
   , ncol=4
   , byrow=TRUE
   )

SPD <- eigen(P)
round(SPD$values, 3)
round(SPD$vectors, 3)

SVD <- svd(P)
round(SVD$d, 3)
round(SVD$u, 3)
round(SVD$v, 3)

Output

[1] 1.0 1.0 0.1 0.0


      [,1]  [,2]  [,3] [,4]
[1,] 0.866 0.000 0.000    0
[2,] 0.462 0.346 0.986    1
[3,] 0.192 0.576 0.164    0
[4,] 0.000 0.741 0.000    0

[1] 1.253 1.093 0.543 0.000


       [,1]   [,2]   [,3]   [,4]
[1,] -0.349  0.784 -0.502  0.108
[2,] -0.210  0.440  0.863  0.134
[3,] -0.577 -0.117  0.045 -0.807
[4,] -0.708 -0.422 -0.045  0.565


       [,1]   [,2]   [,3] [,4]
[1,] -0.438  0.857 -0.272    0
[2,]  0.000  0.000  0.000    1
[3,] -0.147  0.231  0.962    0
[4,] -0.887 -0.461 -0.024    0

For some reasons I'm not able to reproduce the results given the fig attached. Am I missing something here?


Solution

  • Your author seems to want to solve for the left eigenvectors. Since P is not symmetric, the matrix of left eigenvectors is not just the transpose of the matrix of right eigenvectors. The left eigenvectors are found as the eigenvectors of the transpose of P. See Wolfram http://mathworld.wolfram.com/Eigenvector.html . You can reproduce your author's example by using

    v <- eigen(t(P))$vectors
    

    which gives the left eigenvectors of P as the transpose of v, namely

    t(v)
               [,1]     [,2]       [,3]       [,4]
    [1,]  1.0000000 0.000000  0.0000000  0.0000000
    [2,]  0.0000000 0.000000  0.0000000  1.0000000
    [3,] -0.1727737 0.000000  0.7774816 -0.6047079
    [4,]  0.1075984 0.134498 -0.8069883  0.5648918
    

    After renormalizing rows 3 and 4 of the t(v), you get the author's result.