[SciPy-user] 'linear regression'

David Grant david.grant at telus.net
Mon Jun 6 01:30:27 EDT 2005


This uses the Scientific.Functions.LeastSquares.leastSquaresFit function from 
the Scientific python package:

http://www.davidgrant.ca/python/bestFitLine.py

Just call bestFitLine(x, y) with your data in x and y. It will return newy, 
slope, intercept, chisquared as a tuple of size 4.

Dave

On June 3, 2005 02:21 am, Christian Meesters wrote:
> Hi
>
> I'm wondering whether there is a tool in scipy which can do a line fit
> ('linear regression') fit for me. (Preferably something which can work
> with and without given error arrays in x and/or y.) Else I'd have to
> code it myself ...
> Well, I couldn't find such a function described in the manual: Could
> anyone pleas point it out to me where I can find this in scipy - in
> case it really exists?
>
> Thanks,
> Christian
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-user

-- 
David J. Grant
http://www.davidandnasha.ca




More information about the SciPy-User mailing list