comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Algorithm for PCA transform in ENVI
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Algorithm for PCA transform in ENVI [message #80054] Thu, 10 May 2012 05:12 Go to next message
lecacheux.alain is currently offline  lecacheux.alain
Messages: 325
Registered: January 2008
Senior Member
On 10 mai, 11:17, ivitseva <eva.ivits-was...@jrc.ec.europa.eu> wrote:
> On May 9, 5:01 pm, "Kenneth P. Bowman" <k-bow...@null.edu> wrote:
>
>
>
>
>
>> In article < 0de35e20-3a9c-4593-8f06-ed3e6461f...@p21g2000vby.googlegroup s.com >,
>
>>  eva.ivits-was...@ext.jrc.ec.europa.eu wrote:
>>> Does anybody know what the algorithm for PCA transform in ENVI is?
>>> I've compared the eigenvectors and the spatial patterns of ENVI's PCA
>>> transform with IDL's eigenql, svdc and la_svd procedures. The first PC
>>> components are the same but from the second component on I have
>>> negative values where ENVI give positive values and vice versa.
>>> Accordingly, the first element in the diagonal of the eigenvector
>>> matrices has the same sign but the rest of the signs are just the
>>> oppostie comparing results from ENVI and IDL.
>>> Any clues?
>>> Thanks in advance,
>>> Eva
>
>> If you have a properly-constructed covariance matrix, the eigenvalues should all
>> be greater than or equal to zero.  If you are getting negative eigenvalues you
>> are doing something wrong.
>
>>   http://brunnur.vedur.is/pub/halldor/PICKUP/eof.pdf
>
>> Ken Bowman
>
> Hi Ken,
> Thanks.
> It is the eigenvectors and not the eigenvalues I was talking about
> (btw. the eigenvalues are all positive). And using the svdc function
> you do not use the covariance matrix but the centered time series.
> Anyway, the problem is that the signs in the spatial patterns (EOFs or
> the modes) are the opposite of that what ENVI reports, which is
> probably a question of rotation. However, I do not know what ENVI does
> and thus I cannot decide what the problem is. That is why I've posted
> the question.
>
> Eva
>
>

Eva,
SVD algorithm produces unique singular vectors, up to multiplication
by an unit phase factor (for the real case up to sign). That is the
same as saying that singular vector matrices must be unitary.
ENVI and IDL are not in contradiction. They are just doing different
arbitrary choices.
alain.
Re: Algorithm for PCA transform in ENVI [message #80059 is a reply to message #80054] Thu, 10 May 2012 02:17 Go to previous messageGo to next message
ivitseva is currently offline  ivitseva
Messages: 15
Registered: December 2009
Junior Member
On May 9, 5:01 pm, "Kenneth P. Bowman" <k-bow...@null.edu> wrote:
> In article < 0de35e20-3a9c-4593-8f06-ed3e6461f...@p21g2000vby.googlegroup s.com >,
>
>  eva.ivits-was...@ext.jrc.ec.europa.eu wrote:
>> Does anybody know what the algorithm for PCA transform in ENVI is?
>> I've compared the eigenvectors and the spatial patterns of ENVI's PCA
>> transform with IDL's eigenql, svdc and la_svd procedures. The first PC
>> components are the same but from the second component on I have
>> negative values where ENVI give positive values and vice versa.
>> Accordingly, the first element in the diagonal of the eigenvector
>> matrices has the same sign but the rest of the signs are just the
>> oppostie comparing results from ENVI and IDL.
>> Any clues?
>> Thanks in advance,
>> Eva
>
> If you have a properly-constructed covariance matrix, the eigenvalues should all
> be greater than or equal to zero.  If you are getting negative eigenvalues you
> are doing something wrong.
>
>   http://brunnur.vedur.is/pub/halldor/PICKUP/eof.pdf
>
> Ken Bowman
>
>

Hi Ken,
Thanks.
It is the eigenvectors and not the eigenvalues I was talking about
(btw. the eigenvalues are all positive). And using the svdc function
you do not use the covariance matrix but the centered time series.
Anyway, the problem is that the signs in the spatial patterns (EOFs or
the modes) are the opposite of that what ENVI reports, which is
probably a question of rotation. However, I do not know what ENVI does
and thus I cannot decide what the problem is. That is why I've posted
the question.

Eva
Re: Algorithm for PCA transform in ENVI [message #80063 is a reply to message #80059] Wed, 09 May 2012 08:01 Go to previous messageGo to next message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article <0de35e20-3a9c-4593-8f06-ed3e6461fe60@p21g2000vby.googlegroups.com>,
eva.ivits-wasser@ext.jrc.ec.europa.eu wrote:

> Does anybody know what the algorithm for PCA transform in ENVI is?
> I've compared the eigenvectors and the spatial patterns of ENVI's PCA
> transform with IDL's eigenql, svdc and la_svd procedures. The first PC
> components are the same but from the second component on I have
> negative values where ENVI give positive values and vice versa.
> Accordingly, the first element in the diagonal of the eigenvector
> matrices has the same sign but the rest of the signs are just the
> oppostie comparing results from ENVI and IDL.
> Any clues?
> Thanks in advance,
> Eva

If you have a properly-constructed covariance matrix, the eigenvalues should all
be greater than or equal to zero. If you are getting negative eigenvalues you
are doing something wrong.

http://brunnur.vedur.is/pub/halldor/PICKUP/eof.pdf

Ken Bowman
Re: Algorithm for PCA transform in ENVI [message #80196 is a reply to message #80054] Thu, 10 May 2012 07:39 Go to previous message
ivitseva is currently offline  ivitseva
Messages: 15
Registered: December 2009
Junior Member
On May 10, 2:12 pm, alx <lecacheux.al...@wanadoo.fr> wrote:
> On 10 mai, 11:17, ivitseva <eva.ivits-was...@jrc.ec.europa.eu> wrote:
>
>
>
>
>
>> On May 9, 5:01 pm, "Kenneth P. Bowman" <k-bow...@null.edu> wrote:
>
>>> In article < 0de35e20-3a9c-4593-8f06-ed3e6461f...@p21g2000vby.googlegroup s.com >,
>
>>>  eva.ivits-was...@ext.jrc.ec.europa.eu wrote:
>>>> Does anybody know what the algorithm for PCA transform in ENVI is?
>>>> I've compared the eigenvectors and the spatial patterns of ENVI's PCA
>>>> transform with IDL's eigenql, svdc and la_svd procedures. The first PC
>>>> components are the same but from the second component on I have
>>>> negative values where ENVI give positive values and vice versa.
>>>> Accordingly, the first element in the diagonal of the eigenvector
>>>> matrices has the same sign but the rest of the signs are just the
>>>> oppostie comparing results from ENVI and IDL.
>>>> Any clues?
>>>> Thanks in advance,
>>>> Eva
>
>>> If you have a properly-constructed covariance matrix, the eigenvalues should all
>>> be greater than or equal to zero.  If you are getting negative eigenvalues you
>>> are doing something wrong.
>
>>>   http://brunnur.vedur.is/pub/halldor/PICKUP/eof.pdf
>
>>> Ken Bowman
>
>> Hi Ken,
>> Thanks.
>> It is the eigenvectors and not the eigenvalues I was talking about
>> (btw. the eigenvalues are all positive). And using the svdc function
>> you do not use the covariance matrix but the centered time series.
>> Anyway, the problem is that the signs in the spatial patterns (EOFs or
>> the modes) are the opposite of that what ENVI reports, which is
>> probably a question of rotation. However, I do not know what ENVI does
>> and thus I cannot decide what the problem is. That is why I've posted
>> the question.
>
>> Eva
>
> Eva,
> SVD algorithm produces unique singular vectors, up to multiplication
> by an unit phase factor (for the real case up to sign). That is the
> same as saying that singular vector matrices must be unitary.
> ENVI and IDL are not in contradiction. They are just doing different
> arbitrary choices.
> alain.

Hi Alain,

I understand when you are saying that ENVI and IDL are just doing
different arbitrary choices. However, if I look at the second EOF mode
I will have negative values in ENVI reporting, using precipitation
anomalies as input, drought whereas I'll have positive values in IDL's
output reporting wetter than average conditions. Over the same pixels!
I still do not understand how the outcomes can be so different, I mean
COMPLETELY different up to the level of reporting a contradictory
meteorological phenomena! Sorry for being difficult....
Cheers,
Eva
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Widget to play and pause image stack display
Next Topic: EOS_SW_CREATE HDF function file path issue

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:45:28 PDT 2025

Total time taken to generate the page: 0.00459 seconds