[Chicago] Suggestions on improving histogram in matplotlib?

Lewit, Douglas d-lewit at neiu.edu
Sat Mar 21 07:18:34 CET 2015


I don't remember the name of the textbook, but I know for a fact that in
numerical linear algebra (and other applications) one often does encounter
really big matrices that are larger than 100 x 100.  Some algorithms are
indeed pretty numerically unstable.  Gram-Schmidt is a good example of
this.  Other algorithms are fundamentally very stable, such as the
Householder algorithm.  (Householder does the same thing as Gram-Schmidt,
but leads to much less roundoff error.)  Determining the numerical
stability or instability of an algorithm is a giant mess!  It's really
complicated, and I only know the basics of that.  For one thing, computers
are supposed to be better at addition and multiplication, and a little less
efficient when it comes to subtraction and division, especially when it
comes to subtracting and dividing quantities that are very close in value.
For example, you can compute the first derivative using the following
formula, (f(x2) - f(x1)) /(x2 - x1), where x2 and x1 are extremely close to
each other in value.  BUT if x2 and x1 are too close, then the computer
thinks you're dividing by 0 and the program will raise an exception.  That
cutoff of "how close is too close" is the machine epsilon for the computer
that you're working on, and I think it's a function of how many bytes are
allocated for each number.  (The more bytes, the better.)  I think this is
the real power of Fortran because with Fortran I think you can declare
REALS (kind of like floats and doubles) that have a huge number of decimal
places of accuracy.  (I just messed around with Fortran for a couple of
months, but was impressed with its speed and numerical precision.)

>From what I've learned in linear algebra and numerical analysis courses is
this.... if an algorithm has a lot of addition and multiplication in it,
it's probably a safe bet to assume that it's stable and will converge.  If
the algorithm contains a lot of subtraction and division, it could be
stable but there is the possibility of a lack of stability and lack of
convergence.

It's actually a really interesting field of research, and I think it's the
crossroads of math and computation.  Pretty fun stuff.

Douglas.

On Fri, Mar 20, 2015 at 8:51 PM, DiPierro, Massimo <MDiPierro at cs.depaul.edu>
wrote:

> Linear algebra operations on matrices larger than 100x100 make almost no
> sense because of large numerical errors, unless they are sparse. In Lattice
> QCD we even invert sparse matrices 10^9x 10^9 (not with Matlab). SciPy can
> do linear algebra with large sparse matrices
> http://docs.scipy.org/doc/scipy/reference/sparse.html .
>
>
> On Mar 20, 2015, at 7:50 PM, Lewit, Douglas <d-lewit at neiu.edu<mailto:
> d-lewit at neiu.edu>> wrote:
>
> Too bad about John Hunter.  How did he pass?  How old was he?
>
> I took a couple courses at IIT.  While there I noticed that a lot of
> people mentioned Matlab and Python in the same sentence.  I don't know
> enough about Matlab to make an intelligent comparison, but according to
> some of the "experts" that I've chatted with Matlab is really good at
> implementing some super complex numerical linear algebra algorithms on
> giant matrices (like 100,000 rows and 100,000 columns) in just a couple of
> seconds.  I don't use Python to handle matrices that large, so I'm not
> really qualified to comment on that, but Python sure is fun to work with,
> and so far I think it has a much smoother learning curve than Java.
>
> On Fri, Mar 20, 2015 at 5:13 PM, Rob Kapteyn <robkapteyn at gmail.com<mailto:
> robkapteyn at gmail.com>> wrote:
> On 03/20/2015 01:33 PM, Lewit, Douglas wrote:
> (Matplotlib's plots look very "Matlabby" to me.  I'm not sure if that's a
> coincidence or if that was an intentional part of the design.  What do you
> think? )
>
> Before he died, John Hunter gave presentations at ChiPy a couple of times.
> He said he deliberately mimicked the look of Matlab ;)
>
> _______________________________________________
> Chicago mailing list
> Chicago at python.org<mailto:Chicago at python.org>
> https://mail.python.org/mailman/listinfo/chicago
>
>
> _______________________________________________
> Chicago mailing list
> Chicago at python.org<mailto:Chicago at python.org>
> https://mail.python.org/mailman/listinfo/chicago
>
> _______________________________________________
> Chicago mailing list
> Chicago at python.org
> https://mail.python.org/mailman/listinfo/chicago
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chicago/attachments/20150321/256ea90a/attachment.html>


More information about the Chicago mailing list