[SciPy-user] polynomal regression

Robert Kern robert.kern at gmail.com
Mon Oct 16 13:27:51 CDT 2006

Travis Oliphant wrote:
> Christian Meesters wrote:
>>> It's linalg.lstsq.
>>> Are you looking for Total Least Squares ?
>>> AFAIK, it's not implemented yet.
>>> Nils
>> Thanks, Nils.
>> Too bad. Well, back to Origin for me in this case ...
> Total Least Squares is pretty easy to implement using the SVD.   Try 
> your hand.

Total Least Squares can also be implemented as Orthogonal Distance Regression 
(ODR). However, this is neither here nor there for Christian's original 
question, which is how to find estimates of the uncertainties in the estimated 
parameters. This has nothing to do with Total Least Squares.

A. M. Archibald was closest, but got the name of the function wrong. In short, 
the only functions currently implemented that give uncertainties on estimated 
parameters are the non-linear least squares implementations. They aren't too bad 
for linear problems, either. The function A. M. was thinking of was 
scipy.optimize.leastsq() with full_output=True. An alternative is the 
scipy.sandbox.odr package, which can do ordinary least squares or ODR (of which 
Total Least Squares is the linear special case) and provide uncertainty 
estimates for both algorithms.

Robert Kern

"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

More information about the SciPy-user mailing list