-
Notifications
You must be signed in to change notification settings - Fork 5
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
Subject: Request for Guidance on Calculating Explained Variance for PCA Plot #7
Comments
head *.eigenval the top 2 is PC1 and PC2 |
Dear hewm2008, Thank you for your support. I truly appreciate your help. I have a question regarding the eigenval file. When examining the file, I sometimes notice negative values below the figure. I understand that the first column represents #eval and the second column represents eval%. Could you please explain what these negative values indicate? I look forward to your response. |
Generally, it is sufficient to consider the first three principal components (PCs), as the weights (or contributions) of the later components typically become smaller. Once the contribution approaches zero, subsequent components can be disregarded, meaning there is no need to include so many PCs. In PCA (Principal Component Analysis), the contributions or variances explained by each principal component are generally positive because they represent the proportion of the total variance accounted for by each component. These contributions are derived from the eigenvalues of the covariance matrix, which are always non-negative. Encountering negative contribution rates can be confusing, but here is the possible reasons for this occurrence: Numerical Errors: During numerical computations, particularly with floating-point arithmetic, very small negative values can appear due to rounding errors. These values are essentially negligible and can be treated as zero. If negative values are very small, they can indeed be considered as zero. For example, -0.00186% can be treated as 0%. Yes, a negative contribution rate like -0.00186% is practically negligible and can be regarded as zero. This is likely due to numerical precision limitations in the calculations. In practice, you can treat it as zero percent contribution. I hope this clarifies the issue with contribution rates in PCA analysis. |
I have a couple of questions regarding PCA. First, I understand that negative PC values can appear due to numerical computation errors. Is this correct? Additionally, I would like to create an elbow plot using eigenvalue and eigenvector files. Could you please guide me on how to do this? Thank you for your time and assistance. I appreciate your help. |
1 Yes
|
Dear hewm2008,
I hope this message finds you well.
I am currently attempting to create a PCA plot based on the eigenvector file obtained from using VCF2PCACluster.
However, I would like to add the explained variance for PC1 and PC2 to the plot.
Could you kindly guide me on how to calculate or obtain the explained variance for PC1 and PC2?
I appreciate your assistance.
Thank you in advance.
Best regards,
Jeong-Woon Park
The text was updated successfully, but these errors were encountered: