[SciPy-User] Why scipy supply a different result comparing with matlab when doing multi-linear regression analysis
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).
2009/10/20 Robert Kern <firstname.lastname@example.org>
> On Mon, Oct 19, 2009 at 11:23, 王友忠 <email@example.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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User