Principal component analysis-matlab

  • Thread starter Thread starter nikki92
  • Start date Start date
  • Tags Tags
    Component
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:
There are two things I don't understand about this problem. First, when finding the nth root of a number, there should in theory be n solutions. However, the formula produces n+1 roots. Here is how. The first root is simply ##\left(r\right)^{\left(\frac{1}{n}\right)}##. Then you multiply this first root by n additional expressions given by the formula, as you go through k=0,1,...n-1. So you end up with n+1 roots, which cannot be correct. Let me illustrate what I mean. For this...
Back
Top