Skip to content

Commit

Permalink
fix eigenvalue calculation
Browse files Browse the repository at this point in the history
- now computed as sum of squared scores for each component
  • Loading branch information
grlloyd committed Jul 20, 2023
1 parent 099d712 commit eff76e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/PCA_class.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ setMethod(f="model_train",
colnames(P)=varnames
output_value(M,'loadings')=P

E=data.frame('Eigenvalues'=sqrt(model$d[1:A]))
E=data.frame('Eigenvalues'=colSums(scores^2))
rownames(E)=varnames
output_value(M,'eigenvalues')=E

Expand Down

0 comments on commit eff76e6

Please sign in to comment.