> data(USArrests)
The covariance matrix is the diagonal matrix diag(sdev^2)
after scaling and rotation.
> sdev <- prcomp(USArrests, scale = TRUE)$sdev
> diag(sdev^2)
## [,1] [,2] [,3] [,4]
## [1,] 2.480242 0.0000000 0.0000000 0.0000000
## [2,] 0.000000 0.9897652 0.0000000 0.0000000
## [3,] 0.000000 0.0000000 0.3565632 0.0000000
## [4,] 0.000000 0.0000000 0.0000000 0.1734301
We can see that is is the same as the eigenvalues when not scaled.
> diag(prcomp(USArrests)$sdev^2)
## [,1] [,2] [,3] [,4]
## [1,] 7011.115 0.0000 0.00000 0.000000
## [2,] 0.000 201.9924 0.00000 0.000000
## [3,] 0.000 0.0000 42.11265 0.000000
## [4,] 0.000 0.0000 0.00000 6.164246
> C1 <- cov(USArrests)
> eigen(C1)$values
## [1] 7011.114851 201.992366 42.112651 6.164246