Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

A question about "rescaled_pca_basis". #257

Open
chengkeli opened this issue May 1, 2019 · 1 comment
Open

A question about "rescaled_pca_basis". #257

chengkeli opened this issue May 1, 2019 · 1 comment
Assignees

Comments

@chengkeli
Copy link

chengkeli commented May 1, 2019

Hi,

I have one question about "rescaled_pca_basis" in the eos PcaModel class.
I find when you initialize PcaModel, you will multiply the orthonormal pca basis with square root of eigenvalues.
I didn't get the point why you implement in this way. For my understanding, it make sense that you rescale the basis with singular values. However, the singular values are not square root of eigenvalues as in the function:

"inline std::pair<Eigen::MatrixXf, Eigen::VectorXf> pca(const Eigen::Ref data, Covariance covariance_type = Covariance::AtA)"

The eigen value decomposition is applied on covariance matrix A'A/(N-1) so that the computed eigen values are 1/(N-1) times the square of singular values.

This means when you rescale the basis, there is an additional scalar sqrt(1/N-1) is applied on each basis in additional to singular value.

Would you please do me a favor to explain why you would like to introduce this scalar to rescale the basis?

Best regards,
Keli.

@patrikhuber
Copy link
Owner

Hi @chengkeli,

Sorry for not getting back to you yet! Thanks a lot for this clear and detailed write-up. I am quite sure that I got it right when I implemented this in eos, as I've implemented it very carefully and double-checked every formula. But it is of course not impossible that I've made a mistake. I am really busy currently, but I do hope to find the time to have a look at it in more details. Apologies again that it's taking so long. Please let me know in the meantime if you were able to find out anything more.

Best wishes!
Patrik

@patrikhuber patrikhuber self-assigned this May 28, 2019
@patrikhuber patrikhuber changed the title a question about "rescaled_pca_basis". A question about "rescaled_pca_basis". May 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants