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

2 visualizzazioni (ultimi 30 giorni)
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(30x4) 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.

Risposta accettata

John D'Errico
John D'Errico il 28 Dic 2016
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 30x4 parameters.
So the input to PCA is a 54x120 matrix, 54 data points, living in 120 dimensions.
  1 Commento
Radhika Bhagwat
Radhika Bhagwat il 29 Dic 2016
@John Thank You for the reply. About trying to understand PCA, yes I am doing serious reading on it so as to understand it better. The confusion was because one of the feature (EF coefficients), I am using is of the form (30x4) and the other is not. And I think sometimes, trying to implement things gives better understanding than just reading. Thanks again for your reply and suggestions.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Dimensionality Reduction and Feature Extraction in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by