Data
library(BGLR)
data(wheat)
W <- wheat.X
Eigen decomposition
Wsc <- scale(W, center = TRUE, scale = TRUE)
G <- tcrossprod(Wsc)/ncol(Wsc)
eigenG <- eigen(G)
PC <- eigenG$vectors
head(eigenG$values)
[1] 67.77047 29.96076 24.98672 19.79620 14.07452 12.93837
tail(eigenG$values)
[1] 3.269161e-03 3.175619e-03 2.644044e-03 2.492276e-03 1.103516e-03
[6] 3.808504e-13
sum(eigenG$values[1:10])/sum(eigenG$values)
[1] 0.3569195