help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PCA related program?


From: Dirk Eddelbuettel
Subject: PCA related program?
Date: Sat, 21 Nov 1998 11:02:03 -0500 (EST)

  Fan> Analysis(PCA) related program for my project, either written in octave
  Fan> or MATLAB.  

Please see below for an answer provided last year:


From: address@hidden (Ted Harding)
To: address@hidden (Tom Goles)
Cc: address@hidden
Subject: Re: Principal component analysis
Date: Thu, 15 May 1997 20:02:01 +0100 (GMT+0100)

( Re Message From: Tom Goles )
> 
> Hi,
> Does anyone know if there are octave functions/libraries
> that do PCA (principal component analysis)?
> Any info on this is greatly appreciated.
> Thanks,
> Tomislav Goles

All you really need is the following very basic routine. The rest (what
you supply it with, and what you do with the output) is up to you.

Best wishes,
Ted.                                    (address@hidden)
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

function [V,v] = princomp(X)
# Given a (covariance or correlation) matrix X, returns
# V = matrix whose columns are the eigenvectors of X, corresponding to
# v = vector of eigenvalues of X, in decreasing order of size.

[V,v] = eig(X); [v,S] = sort(-diag(v)); V = V(:,S); v = -v;

endfunction




-- 
Linux is not only free; it is, arguably, a better operating system, offering
a degree of stability and an ability to scale up that NT cannot match.
                                             -- The Economist, Oct 3, 1998



reply via email to

[Prev in Thread] Current Thread [Next in Thread]