help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

=?iso-8859-15?Q?Octave_in_C++, _problems_with_getting_eigenvector_from_?


From: Michael Prinzinger
Subject: =?iso-8859-15?Q?Octave_in_C++, _problems_with_getting_eigenvector_from_?= singular values
Date: Fri, 11 May 2007 17:22:09 +0200

Heyo!

If you are not interested in what I am working on and just want to check the 
problem, and whether you can help me,skip the next part until you read <---> a 
second time

<---> 
Im working on a students project with image classification and I am trying to 
build a classifier based on eigenvectors of covariance matrices and the 
eigenspace (a matrix where the rows are eigenvectors). 

Now even though my pictures have currently only size 80x80 pixel, computing the 
eigenvectors or values from the covraiance matrix is just too much for any pc I 
can reach from my working place at the university. So I decided to try SVD 
instead and in fact SVD successfully computes the singular values of the 
covariance matrix (though it takes up to ~15-20 min depending on the computer). 
Now as you might recall from statistics in case of symmetric matrices (like 
covariance matrices) the squared singular values equal the eigenvalues. So what 
I am trying to do now is to compute the eigenvectors using squarred singular 
values.

There is nothing in octave that would allow to do something like that directly: 
Even if you could change the private lambda of EIG, the eigenvector computation 
would not be affected... So I simply do it "by hand". That means for every 
eigenvector I want, I solve the matrix equation: (A - singular_values^2) x = 0, 
which should give me the eigenvectors of A. (In my code I have 
singular_values^2 as a DiagMatrix, just in case you want the above statement to 
make sense ^,^)
<--->

Task: Solving (A - singular_values^2) x = 0

The problem I am stuck with is the following: 
Some of my singular values are pretty damn close to zero, which gives me 
trouble with machine precision and the matrix getting singular. Now appearently 
there is a method to deal with such singularities, since the matrix solve 
method is defined as

ComplexColumnVector solve (const ColumnVector& b, int& info, double& rcond,  
solve_singularity_handler sing_handler) const;

but I can't find no docu to it and since "solve_singularity_handler" is just a 
typedef I am stuck.

What are the last three parameters in the method call for?
How can I call the method, that way I want: 
 - to solve Ax=0
 - dealing with singularities due to machine precision 

I hope anyone can help me! 
And Thanks to everyone trying

Michael Prinzinger
_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000066



reply via email to

[Prev in Thread] Current Thread [Next in Thread]