MATLAB: How to give elliptical fourier coefficients as input to Principal Component Analysis(PCA)

MATLAB: How to give elliptical fourier coefficients as input to Principal Component Analysis(PCA)

elliptical fourier descriptorsimage processingMATLABprincipal component analysis

I am using Elliptical fourier descriptors as feature for classification of plant species. I am using 18 leaves for each specie and have 3 such species making total of 54 leaves. I am done with EF descriptors and have coefficients (an,bn,cn,dn) for all leaves. I have calculated 30 harmonics. For each leaf I have a matrix(30×4) of coeficients. Now I want to use principal component analysis (PCA) . According to what I have read about PCA, the input should have rows correspond to observations and columns to variables. Now I am not able to understand which ones are the observation and which are variable. According to me the 30 harmonics would be rows and a,b,c,d would be the columns for each leaf. I have 54 leaves making the columns (4*54= 216). So the input to PCA would be a matrix of size 30X216 (30 rows and 216 columns). Am I right in doing this, as the largest eigenvalue I get after calculations is 2.4746 and second largest is 0.0494. I am trying to implement PCA myself in Matlab.

Best Answer

  • First, do not implement tools that you do not understand, to solve a problem that you need to solve.
    Learn to use the tools first, THEN if you want to, spend the time to learn how you might implement it. At least, do some serious reading, enough to understand PCA.
    If you are trying to implement PCA and do it incorrectly then you don’t know whether your problems are due to having done something wrong in the PCA code, or if you did not even know what to pass in!
    Anyway, writing your own code when you have code written by professionals available to you is a bad idea in general. So unless you don’t have the stats toolbox, then re-writing PCA is a silly thing to do.
    Ok, as far as your problem goes (which is not even about MATLAB at this point, but understanding PCA) you have 54 leaves. Each leaf is an independent realization of some process that you want to study. On each leaf, you apparently have measured a matrix of 30×4 parameters.
    So the input to PCA is a 54×120 matrix, 54 data points, living in 120 dimensions.
  • Add a Comment

    Your email address will not be published. Required fields are marked *