Thread Subject: Can't perform PCA

Subject: Can't perform PCA

From: Dave Krebs

Date: 7 Dec, 2007 23:14:15

Message: 1 of 5

My data set is too large for me to use the built-in Matlab
functions such as "processpca" to compute principal
components due to memory limitations.

Does anyone have an m-file that performs PCA interatively,
returning one component at a time, or any algorithm that
allows PCA to be performed in some way without computing
the entire covariance matrix?

Thanks

Subject: Can't perform PCA

From: Bruno Luong

Date: 7 Dec, 2007 23:26:09

Message: 2 of 5

"Dave Krebs" <djk37@mathworks.com> wrote in message
<fjck47$91t$1@fred.mathworks.com>...
> My data set is too large for me to use the built-in Matlab
> functions such as "processpca" to compute principal
> components due to memory limitations.
>
> Does anyone have an m-file that performs PCA interatively,
> returning one component at a time, or any algorithm that
> allows PCA to be performed in some way without computing
> the entire covariance matrix?
>

I don't (not in MATLAB), but you are better chance to find
what you are looking for with keywords such as "Lanczos" and
"Krylov's space".

Bruno


Subject: Can't perform PCA

From: Greg Heath

Date: 8 Dec, 2007 00:54:29

Message: 3 of 5

On Dec 7, 6:14 pm, "Dave Krebs" <dj...@mathworks.com> wrote:
> My data set is too large for me to use the built-in Matlab
> functions such as "processpca" to compute principal
> components due to memory limitations.
>
> Does anyone have an m-file that performs PCA interatively,
> returning one component at a time, or any algorithm that
> allows PCA to be performed in some way without computing
> the entire covariance matrix?

Go to Google Groups and search on

nipals -oliver

Hope this helps.

Greg

Subject: Can't perform PCA

From: Peter Perkins

Date: 8 Dec, 2007 04:52:33

Message: 4 of 5

Dave Krebs wrote:
> My data set is too large for me to use the built-in Matlab
> functions such as "processpca" to compute principal
> components due to memory limitations.
>
> Does anyone have an m-file that performs PCA interatively,
> returning one component at a time, or any algorithm that
> allows PCA to be performed in some way without computing
> the entire covariance matrix?

Dave, do you have access to the Statistics Toolbox? There is no good reason to
compute the cov matrix, and at least two reasons not to. The PRINCOMP function
computes a PCA directly from the data. If your data are wide, you'll want to
use the 'econ' flag:

 >> help princomp
  PRINCOMP Principal Components Analysis.
[snip]
     [...] = PRINCOMP(X,'econ') returns only the elements of LATENT that are
     not necessarily zero, i.e., when N <= P, only the first N-1, and the
     corresponding columns of COEFF and SCORE. This can be significantly
     faster when P >> N.

Since you mention computing the cov matrix as the problem, I'm guessing your
data _are_ wide.

That being said, there are any number of implementations of the NIPALS algorithm
in MATLAB out there; that may be what you're looking for, but I'd look at
PRINCOMP first.

Hope this helps.

- Peter Perkins
   The MathWorks, Inc.

Subject: Can't perform PCA

From: Bruno Luong

Date: 8 Dec, 2007 07:53:03

Message: 5 of 5

I never use it, but svds() can potentially solve your problem.

Bruno

Tags for this Thread

Everyone's Tags:

pca

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
pca Dave Krebs 7 Dec, 2007 18:15:04
rssFeed for this Thread

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com