[SciPy-user] using linalg.lstsq

Mitchell Timin zenguyuno at yahoo.com
Wed May 10 22:29:23 EDT 2006


--- Robert Kern <robert.kern at gmail.com> wrote:

> Mitchell Timin wrote:
> > I'm brand new to numpy & scipy, and my linear algebra is pretty weak also.  I'm
> hoping
> > someone will show me how to fit a plane to some points.  I need to work in higher
> > dimensional space, but I think If I understand the 3-D case I will be OK.
> > So, suppose I have, say, half a dozen points in 3-space.  I want to find values for
> c1,
> > c2 & c3 so that x3 = c1*x1 + c2*x2 + c3 passes close to all the points in the least
> > square sense.
> > 
> > I think that linalg.lstsq will solve that problem, but I don't know how to set it
> up.
> 
> Did my explanation on comp.lang.python not help you? You said it did.

Yes, it was helpful in that it showed me how to call lstsq() without errors, but I was
not able to convert my problem into the correct form to get a solution.  It is not
obvious how to go from the form above into a pair of matrices that work with lstsq().

> "I have come to believe that the whole world is an enigma, a harmless enigma
>  that is made terrible by our own mad attempt to interpret it as though it had
>  an underlying truth."
>   -- Umberto Eco

I like that quote!  I agree with it, but I have given up the struggle he mentions.

Mitchell Timin

I'm proud of http://ANNEvolve.sourceforge.net.  If you want to write software, or articles, or do testing, or research for ANNEvolve, let me know.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




More information about the SciPy-User mailing list