- coeff = pca(X) returns the principal component coefficients, also known as loadings, for the n - by - p data matrix X. Rows of X correspond to observations and columns correspond to variables.
What is the difference between observation and variable in case of pca() function?
11 次查看(过去 30 天)
显示 更早的评论
I have a matrix with m rows and n columns that is built from n number of individuals for person identification. So, n is the number of person and m is the number of feature's value of the person or pixel's intensity values of the person's image.
Now I want to calculate pca using Matlab's pca() function. But, It makes me confused about observation and variables. What will I call n and m? Which one represents observation and which one represents variable?
0 个评论
采纳的回答
Star Strider
2017-11-22
From the documentation:
So each row is an observation and each column is a variable.
8 个评论
Star Strider
2017-11-23
My pleasure.
Principal components analysis is quite good for that. I actually once used it to design a filter when I did a linear discriminant analysis on short-time Fourier transforms of EEGs to classify what task the person was doing. The filter then isolated the relevant frequencies. making the classification much more efficient.
更多回答(1 个)
Image Analyst
2017-11-23
The person is treated as a variable and the feature value is the observation. The feature values for each person are listed in a column of the table. For example, maybe you have two people in a family and want to see if there is a relationship between the weight of the two people over time. You might be taking measurements every day (or month or whatever). So if you had 4 time points and 2 people, the array would be
w11, w21
w12, w22
w13, w23
w14, w24
where w1* are the weights of person #1, and w2* are the weights of person #2. The coefficients would be
coefficients = pca(weightsMatrix);
Where weightsMatrix is that 2-D array I gave above.
2 个评论
Image Analyst
2017-11-23
Please describe the measurements you are making. If the ID of persons is your observation then you may need logistic regression instead of PCA.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!