As far as I know, singular value decomposition (SVD) and eigendecomposition give the same result for symmetric square matrices. But when I check the results in R, that's not what I see. Please see below R code (I set the random seed for reproducibility purposes):
set.seed(111)
X = matrix(rnorm(50), nrow=5, ncol=10)
prinden = svd(X %*% t(X))
prineden = eigen(X %*% t(X))
> prinden$u
[,1] [,2] [,3] [,4] [,5]
[1,] -0.3812420 0.1714440 0.89298930 -0.1352677 0.09764363
[2,] -0.3086450 -0.1785482 0.05935694 0.9181008 -0.16256214
[3,] 0.2125363 0.8719446 -0.06555398 0.3011303 0.31553776
[4,] -0.6109540 0.4041138 -0.30752420 -0.2079534 -0.57062372
[5,] -0.5839147 -0.1230124 -0.31650973 -0.0697814 0.73407341
> prineden$vectors
[,1] [,2] [,3] [,4] [,5]
[1,] -0.3812420 -0.1714440 0.89298930 -0.1352677 0.09764363
[2,] -0.3086450 0.1785482 0.05935694 0.9181008 -0.16256214
[3,] 0.2125363 -0.8719446 -0.06555398 0.3011303 0.31553776
[4,] -0.6109540 -0.4041138 -0.30752420 -0.2079534 -0.57062372
[5,] -0.5839147 0.1230124 -0.31650973 -0.0697814 0.73407341
The 2nd columns of prinden$u and prineden$vectors are negative of each other, while other columns are the same. How come is this possible? What am I missing?