Surprises from numerical linear algebra (2010)
johndcook.com
johndcook.com
Amazing writing, very succint & hacker-friendly.
Link to the course: http://ocw.mit.edu/courses/mathematics/18-06-linear-algebra-...
Link to the YouTube videos of the lectures: http://www.youtube.com/watch?v=ZK3O402wf1c&feature=resul...
http://www.amazon.com/Introduction-Linear-Algebra-Fourth-Gil...
You can find a free PDF version online.
I like it more then Strang because it's a lot more concise, covers some more advanced topics and unlike Strang everything is said very accurately. I think Strang's rather hand-wavy way of explaining things starts faltering when he talks about more advance topics.
I would read Strang and listen to his lectures to get a good feel for Linear Algebra (to build up the intuition), and if you feel like you want more then pick up Meyer's book
The recommendations given here so far are for intro/abstract linear algebra texts.
Texts that emphasize coordinate-free approaches, like Linear Algebra Done Right, don't really get at the numeric computations issue.
http://matrixeditions.com/UnifiedApproach4th.html
which is theoretical and linked to other subjects of higher math, but by no means slights practical problems or numerical methods.
For numerical aspects of linear algebra (and other subjects), I've found Numerical Recipes to be quite helpful.
From the book's intro:
>But, suppose we asked a professional mathematician to step back a bit from his habitual way of speaking and write in a more linear fashion? And suppose we even asked more, for example, that he make his writing lively? ... The purpose of this book is to furnish the reader with the first mathemat- ical tools needed to understand one of the pillars of modern mathematics, i.e. linear algebra. The text has been written by a mathematician who has tried to step out of his usual character in order to speak to a larger public. He has also taken up the challenge of trying to make accessible to everyone the first ideas and the first techniques of a body of knowledge that is fundamental to all of science and technology.
As others have suggested, something like Golub and Van Loan is a better choice. The technical notes to go with the LAPACK library, and similar documents from those developing related software, are also likely to be of interest to anyone doing this stuff seriously.
* http://www.youtube.com/view_play_list?p=F706B428FB7BD52C
* http://www.youtube.com/view_play_list?gl=DE&hl=de&p=...
based on the book of the same name. This is one of "name 5 books you would take with you on a desert island" kind of books, a beautiful work of art.
Link to lectures and materials: http://see.stanford.edu/see/courseinfo.aspx?coll=17005383-19...
(I just bought the Strang book mentioned downthread).
Edit: Let's see if this works: http://news.ycombinator.com/edit?id=2993321.
Start here: http://www.catonmat.net/blog/mit-linear-algebra-part-one/
http://www.amazon.com/Computations-Hopkins-Studies-Mathemati...
This is the "how we wrote Lapack" book.
For those who are just starting on this subject, I highly recommend that you rework the proofs for the bounds between the various matrix norms [1]. These bounds are the building blocks for most interesting analyses in matrix computations. And understanding these analyses are essential if you want to know which algorithm will work best for your problems.
[1]: http://en.wikipedia.org/wiki/Matrix_norm#Examples_of_norm_eq...
Everyone I talked to then recommended the Strang textbook, and also Stanford EE263, both already pointed out by other commenters here.
At the outset of numerical linear algebra, say in the 1940s [until 1948], it was not known whether errors would blow up or not. [best bound was 4^n where n is matrix order]
Turned out they did not (if you do things remotely right) but even von Neumann [in a 1947 paper, with others] was surprised that large (say 20x20, at that time) linear systems could be solved accurately.
[edits in braces: This history, and more, is in www.maths.manchester.ac.uk/~higham/talks/twge96.ps.gz ; Higham wrote probably the best and most comprehensive up-to-date book on the accuracy of numerical linear algebra.]
But back then, everyone was worried even about well-conditioned systems. As of the mid 1940s the best error bound on cumulative roundoff error was 4^n where n is matrix order. That 4^n would be a multiplier on top of condition number (which at the time had not been formalized, it was Turing who did that).
Anyway, the dependence on matrix size turned out to be order n^2, and in practice more like O(n).
* * *
Also, the bounds on solving
A x = b
for x, knowing b and A, work differently than solving for the inverse of A.Sometimes for a given A and b, you can compute x above quite accurately, but you can't compute inv(A) accurately and multiply by b to get x. It depends on the how the "difficult directions" in A interact with b. This is one reason numerical analysts always ask, "Do you really need to invert A?"
Because of this, the actual condition number of A (i.e., the norm of A times that of inv(A)) does not enter into the bounds on solving A x = b. The bounds depend on a different norm.
In fact, there are several forms of the error bound -- known as backward and forward errors -- depending on what you need.
* * *
Incidentally, this is the kind of stuff that's covered in Golub and Van Loan, or in Trefethen and Bao, but not in a standard Abstract Linear Algebra book. For instance, Strang's book spends only one chapter on numerical linear algebra.
A person can do a lot of damage armed with a good grasp of linear algebra and fourier analysis.
If, however, you process tons of sparse, dense, categorical, or continuous data BE WARY: "lapack", "eispack", "linpack", "scalapack", and "lis" will give you different solutions. Occasionally, crash on some machines. Compilers, linkers, precision, and missing values matter here, too.
scalapack is a different animal entirely. It's a parallel version of lapack (via MPI) so should not be expected to duplicate lapack results because partitioned algorithms will be used. But if you're using scalapack, you know that already.
eg. One of the basics you must absolutely know, or so I've been told, is how to do a PCA, and why a PCA is not the same as regression. So if you've got multidimensional data, say data in 7 dimensions ( risk ratio, fico score, salary, age etc etc ), you want to know if you can reduce that whole set to say 1 dimension. ie. can you transform the original set of 7 variable vectors into a much smaller set of 1 variable vectors that captures 90% of the information in the original ? If so, how ? Turns out you construct a linear combination of correlated variables. Ok, but there's infinitely many combinations. So how ? Well, construct it in such a fashion that the variance of the combination is maximized. That component is called the Principal Component, and its the single most used technique to reduce dimensionality in the industry. So you've taken a 7-dimension space and nicely reduced it to a 1-dimension subspace with maximum variance that explains 90% of the original 7 dimension space. Its quite amazing actually. http://en.wikipedia.org/wiki/Principal_component_analysis
Similarly, there are a whole bunch of very common stuff you'd actually use linear algebra for in CG - translation, rotation in 3D, shear matrices and the like. Hefferon doesn't do those either.
In portfolio theory which is my bread and butter (http://en.wikipedia.org/wiki/Portfolio_theory ) almost everything I do is very properly linear algebra. But again, Hefferon doesn't offer any insight into how/why finding a vector with minimum variance can yield better returns in a vector space of portfolios.
Why on earth would expect that it would be? I took and enjoyed linear algebra using that text-- it didn't specifically address the QM I deal with as a physicist, but since the author can't predict each student's future, I'd hardly characterise that as a problem with the text!
If it was used as a course on portfolios, ok, bad choice -- but directed against a general linear algebra text, your criticism doesn't seem very valid.
No, I'm saying Hefferon is not applicable to any field. He eschews application in favor of formal theorem proving in vector spaces, in isolation of any real-life examples. That is great, but that is not the typical use case of anybody out there who actually uses linear algebra in industry, whether in computer graphics or portfolio theory or multivariate statistics or what have you.
If you're looking to do application, use an applied book. Gilbert Strang's "Linear Algebra and its Applications" is quite good.
Long before reading the book, I spent a lot of time with financial modeling of all kinds, but your complaint doesn't resonate with me at all. I went on to study machine learning and found the ideas in Hefferon laid a good foundation. It might be fair to point out that is not a cookbook and you don't use it to learn how to wrangle LAPACK, but I think it's over the top to say what you just did.
And what you apparently call linear algebra is closer to multivariate statistics...
But you learn a lot.
The link the above minimized link goes to.