Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Incorrect eigenvalue normalization for SVD-PCA #183

Closed
wants to merge 1 commit into from

Conversation

r-de-r
Copy link

@r-de-r r-de-r commented Feb 14, 2022

loadings is different between method==:svd and method==:var

loadings is different between  method==:svd and method==:var
@wildart
Copy link
Collaborator

wildart commented Feb 14, 2022

Why would they be different? Eigenvalues from SVD are stored in formalized form.

@r-de-r
Copy link
Author

r-de-r commented Feb 14, 2022 via email

@wildart
Copy link
Collaborator

wildart commented Feb 14, 2022

Ah, I used my dev copy that has no error. The problem actually in the different line:

@inbounds v[i] = abs2(v[i]) / n

The eigenvalue should be scaled by n-1

@wildart wildart changed the title Update pca.jl Incorrect eigenvalue normalization for SVD-PCA Mar 3, 2022
wildart added a commit to wildart/MultivariateStats.jl that referenced this pull request Mar 3, 2022
@wildart wildart closed this in 1863cd5 Mar 3, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants