Re: PCOMP function [message #17372] |
Tue, 05 October 1999 00:00 |
m218003
Messages: 56 Registered: August 1999
|
Member |
|
|
In article <7t9v2m$lf5$1@almendralejo.unex.es>,
"Mhyst" <aplaza@unex.es> writes:
> Hello!
> I'm having some trouble with PCOMP function, which is used to perform
> Principal Component Analysis. I have 8 different values associated with each
> pixel of a 791x1128 image. This is a lot of information, and I want to
> reduce it by PCA. My questions are:
> 1) How do I allocate this information to apply the PCOMP function? The input
> to the function must be an NxM array.
> 2) This function seems to be very slow. I have tried applying the function
> to a 256x256 array and it took it almost two hours in a Pentium 200 MHz with
> 64Mb RAM. Is this normal?
> Many thanks in advance...
>
I have never used PCOMP in IDL, but what I know from Principal component
analysis suggests to me that you should assign the number of variables (8 in
your case) to M and the values to N. You will have to treat your array as
a vector, e.g. by converting it as follows:
s = size(data)
vector = reform(data,s*s)
Or if you have IDL 5.2 and your data already stored as array(8,791,1128):
s = size(data,/DIMENSIONS)
pcarr = reform(data,8,s*s[2])
Hope this helps a little,
Martin
--
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[[ Martin Schultz Max-Planck-Institut fuer Meteorologie [[
[[ Bundesstr. 55, 20146 Hamburg [[
[[ phone: +49 40 41173-308 [[
[[ fax: +49 40 441787 [[
[[ martin.schultz@dkrz.de [[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
|
|
|