Principal component analysis-matlab

  • Thread starter Thread starter nikki92
  • Start date Start date
  • Tags Tags
    Component
Click For Summary
SUMMARY

The discussion focuses on implementing Principal Component Analysis (PCA) in MATLAB, specifically addressing how to calculate the error of PCA using the Mean Squared Error (MSE). The user employs MATLAB functions such as randn for data generation and svd for Singular Value Decomposition. The principal components are derived from the eigenvalues, and the user seeks clarification on comparing PCA results with different component counts (3, 4, 5) to compute the Frobenius norm. The notation and methodology for calculating the error are key points of confusion.

PREREQUISITES
  • Understanding of Principal Component Analysis (PCA)
  • Familiarity with MATLAB programming
  • Knowledge of Singular Value Decomposition (SVD)
  • Concept of Mean Squared Error (MSE)
NEXT STEPS
  • Learn how to implement PCA in MATLAB using the pca function
  • Research the calculation of Frobenius norm in the context of PCA
  • Explore the interpretation of eigenvalues and eigenvectors in PCA
  • Study the implications of choosing different numbers of components in PCA
USEFUL FOR

Data scientists, statisticians, and machine learning practitioners looking to implement and understand PCA in MATLAB, particularly those interested in error analysis and dimensionality reduction techniques.

nikki92
Messages
37
Reaction score
0

Homework Statement


How do I find the error of the PCA?

||x1hat - x1||^2 + ...+ ||xnhat-xn||^2 so xnhat is the pca one. What is xn?
 
Last edited:
Physics news on Phys.org
can you elaborate more? having some trouble guessing what your notation means.
 
Basically x= randn(100,15)
x_centered=(eye(100)-(1/100)*ones(100,100))*x to subtract the mean to center the data
[s,d,v]=svd(x_centered);

I need to find the principal components
which just the eigenvalues but according to my professor {divi}for i = 1 to 15.
Then I am asked what is the pca with 3, 4, 5 components. For 3 components is it just [d1v1 d2v2 d3v3]

Then I am asked to find the mse of it. I am confused what do I compare the PCA of 3 components to to take the F- norm?
 
Last edited:

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 16 ·
Replies
16
Views
3K
Replies
1
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
3
Views
2K