Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6717139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:49:02+00:00 2026-05-26T08:49:02+00:00

Does anyone know how to implement the Principal component analysis (PCA) on a m-by-n

  • 0

Does anyone know how to implement the Principal component analysis (PCA) on a m-by-n matrix in matlab for normalization?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:49:02+00:00Added an answer on May 26, 2026 at 8:49 am

    Assuming each column is a sample (that is, you have n samples each of dimension m), and it’s stored in a matrix A you first have to subtract off the column means:

          Amm = bsxfun(@minus,A,mean(A,2));
    

    then you want to do an eigenvalue decomposition on 1/size(Amm,2)*Amm*Amm' (you can use 1/(size(Amm,2)-1) as a scale factor if you want an interpetation as an unbiased covariance matrix) with:

          [v,d] = eig(1/size(Amm,2)*Amm*Amm');
    

    And the columns of v are going to be your PCA vectors. The entries of d are going to be your corresponding “variances”.

    However, if your m is huge then this is not the best way to go because storing Amm*Amm' is not practical. You want to instead compute:

          [u,s,v] = svd(1/sqrt(size(Amm,2))*Amm,'econ');
    

    This time u contains your PCA vectors. The entries of s are related to the entries of d by a sqrt.

    Note: there’s another way to go if m is huge, i.e. computing eig(1/size(Amm,2)*Amm
    '*Amm);
    (notice the switch of transposes as compared to above) and doing a little trickery, but it’s a longer explanation so I won’t get into it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know how to implement the standard bubble message that warns users whenever
Does anyone know how to implement an action badge, like the ones seen below
does anyone know is there a way to implement Windows Live ID authentication into
Does anyone know if it is possible to implement playback of an audio file
Does anyone know is there a way to implement Windows Live ID authentication into
Does anyone know how I can implement a single Touch Event. A simple, one
Does anyone know of a way to implement a drag and drop feature with
Does anyone know what the best way to implement a list/grid togglable view in
Does anyone know of a creative way to serialize objects that implement IDictionary? ...without
Does anyone know how to implement a rollback function in file copying when an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.