Re: Algorithm for PCA transform in ENVI [message #80054] |
Thu, 10 May 2012 05:12  |
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   |
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 #80196 is a reply to message #80054] |
Thu, 10 May 2012 07:39  |
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
|
|
|