[SciPy-User] Why scipy supply a different result comparing with matlab when doing multi-linear regression analysis

王友忠 wangyouzh@gmail....
Mon Oct 19 11:34:59 CDT 2009


The data used in scipy and matlab is as the same.

There is an dependent variable Y and 9 independent variables X, each
variable has 90100 elements.

Each variable has been standardized.

In scipy, I used: c,resid,rank,sigma = linalg.lstsq(Y,X)
and in matlab: [b,bint]=regress(Y,X).

Thank You!


2009/10/20 Robert Kern <robert.kern@gmail.com>

> On Mon, Oct 19, 2009 at 11:23, 王友忠 <wangyouzh@gmail.com> wrote:
> > Hello!
> >
> > I have used scipy to solve a multi-linear regression problem, I used the
> > function lstsq in scipy.linalg.
> >
> > But, when I compared the result with using matlab, I found the function
> > regress in matlab gave me a very different result.
> >
> > Why they are inconsonant, and which result should I trust?
> Matlab's regress() is a higher level function that may have set up the
> low level linear least squares problem differently than you did when
> you used scipy.linalg.lstsq(). Without seeing your data and your code,
> that is really the only clue we can provide you.
> --
> 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
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20091020/2c0ff1c1/attachment.html 

More information about the SciPy-User mailing list