[Numpy-discussion] linalg.eigh() newbie doubt

lorenzo bolla lbolla@gmail....
Mon Mar 31 10:23:48 CDT 2008

```from numpy.eigh?:

:Returns:

w : 1-d double array
The eigenvalues. The eigenvalues are not necessarily ordered.

v : 2-d double or complex double array, depending on input array
type
The normalized eigenvector corresponding to the eigenvalue w[i]
is
the column v[:,i].

so, yes, the eigvec coresponding to the eigval w[i] is v[:,i].
L.

On Mon, Mar 31, 2008 at 4:43 PM, gordon <nodrogbrown@gmail.com> wrote:

> hello
> i was trying the linalg.eigh()
> when i apply eigh() on a covariance matrix (an ndarray of shape 6x6  i
> get evals,evectors
> suppose i get it like
>
> evals=   array([2.2, 5.5, 4.4, 1.7, 7.7, 6.3])
> evectors=array([[3.,5. ,1. ,6. ,2. ,4. ],
>                            [2.,1.,5.,7.,5.,3.],
>                            [8.,9.,6.,5.,4.,3.],
>                            [2.,1.,3.,4.,5.,9.],
>                            [0.1,3.,2.,4.,5.,1.],
>                            [6.,5.,7.,4.,2.,8.]
>                            ])
> which is the array that corresponds to eigenvalue 2.2 of evals?
> is it the first column of evectors? or is it the first row?
>
> if i were to sort the evectors based on the eigenvalue ,i guess the
> most significant eigenvector should correspond to the value of
> 7.7 ,then am i supposed to consider the 5th column of evectors as the
> most significant eigenvector?
> please someone help me clear this confusion
> thanks
> gordon
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>

--
Lorenzo Bolla
lbolla@gmail.com
http://lorenzobolla.emurse.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080331/5f578083/attachment.html
```