[SciPy-user] Scipy and Multiple Regression ??

Robert Kern robert.kern@gmail....
Mon Mar 26 11:58:32 CDT 2007


Axel Kowald wrote:
> Hi everybody,
> 
> I'm new to scipy and wondered it I can also do multiple regression with it ?

What exactly do you mean by "multiple regression"? If you mean linear
least-squares with models of the form

  y = a0 + a1*x + a2*x**2 + ...

or

  y = a0 + a1*x1 + a2*x2 + ...

then scipy.linalg.lstsq() should work for you.

> I only found routines for normal linear regression.

There's scipy.optimize.leastsq() for nonlinear least-squares regression. There's
scipy.odr for nonlinear ordinary least-squares, orthogonal distance regression,
and implicit regression (models of the form f(x)=0), all with as many input
dimensions as you like.

-- 
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