commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andrea antonello <andrea.antone...@gmail.com>
Subject Re: [math] eigenvector doubts and issues
Date Wed, 13 Nov 2013 11:26:04 GMT
Hi Thomas,

> are you sure that your eigenvectors are drawn correctly?

I assume yes. I used the eigenvectors with the highest and lowest
eigenvalue, since in the simpler 3d case it was giving me the plane
exactly cutting through the dataset as I wished it. But you are most
probably right in using a plane that connects the two lower eigenvalue
eigenvectors. I was using the wrong one for this purpose I guess.

> I tried to reproduce your results with geogebra, and in my case the
> plane defined by the two eigenvectors with the least eigenvalue seems to
> split the values quite well, see this image:
>
> http://people.apache.org/~tn/pca.png

Actually it qualitatively splits the dataset more or less the same as
using the first and last eigenvector: one 2 dots are on the wrong side
of the plane.

I was hoping to be able to get more precise results for such simple
examples of data.

In fact, if I make the dataset more regular (i.e. equal intervals for
x and y), things work as needed:

        double[] x = {1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4};
        double[] y = {0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3};
        double[] z = {1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 2, 2, 2};


In that case the plane between the two lower eigenvalue eigenvectors
splits the dataset in higher and lower.

http://en.zimagez.com/zimage/eigenvectors3dcase3.php

I will do some more tests with complex data.

Thanks,
Andrea

>
> The results from the computations:
>
> covariance:
>   {0.7272727273,0.0,0.1818181818},
>   {0.0,0.3409090909,0.2272727273},
>   {0.1818181818,0.2272727273,0.2727272727}}
>
> lambda1 =  0.8056498828134406
> v1 =  {0.9015723558; 0.1900593782; 0.3886447222}
>
> lambda2 = 0.4874287594020183
> v2 = {-0.3799516758; 0.7774478203; 0.5012101464}
>
>
> lambda3 = 0.04783044869363171
> v3 = {-0.2068913033; -0.5995434259; 0.7731388421}
>
> The plane is constructed with v2 and v3.
>
> Thomas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message