[Numpydiscussion] linear algebra help
Charles R Harris
charlesr.harris@gmail....
Mon May 18 10:49:17 CDT 2009
On Mon, May 18, 2009 at 9:35 AM, <josef.pktd@gmail.com> wrote:
> On Mon, May 18, 2009 at 10:55 AM, Charles R Harris
> <charlesr.harris@gmail.com> wrote:
> >
> >
> > 2009/5/18 Stéfan van der Walt <stefan@sun.ac.za>
> >>
> >> 2009/5/18 Sebastian Walter <sebastian.walter@gmail.com>:
> >> > B = numpy.dot(A.T, A)
> >>
> >> This multiplication should be avoided whenever possible  you are
> >> effectively squaring your condition number.
> >
> > Although the condition number doesn't mean much unless the columns are
> > normalized. Having badly scaled columns can lead to problems with lstsq
> > because of its default cutoff based on the condition number.
> >
> > Chuck
>
> Do you know if any of the linalg methods, np.linalg.lstsq or
> scipy.linalg.lstsq, do any normalization internally to improve
> numerical accuracy?
>

They don't. Although, IIRC, lapack provides routines for doing so. Maybe
there is another least squares routine that does the scaling.
>
> I saw automatic internal normalization (e.g. rescaling) for some
> econometrics methods, and was wondering whether we should do this also
> in stats.models or whether scipy.linalg is already taking care of
> this. I have only vague knowledge of the numerical precision of
> different linear algebra methods.
>
It's a good idea. Otherwise the condition number depends on choice of units
and other such extraneous things.
Chuck
 next part 
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpydiscussion/attachments/20090518/ad33bdc7/attachment.html
More information about the Numpydiscussion
mailing list