News for hackers. Stuff that matters.
Re:Eigenvectors and Eigenvalues (2015) by xevb3k on Tuesday May 15, 2018 @10:49AM (#17074311)
Whenever this kind of stuff comes up I feel like a bit of a fraud...

I’ve written a bunch of scientific data analysis code. I have a science PhD. Written large image analysis pipelines that worked as well as the state of the art... been published etc.

For the most part I’ve found basic math and heuristics to be good enough. Every so often I go relearn calculus. But honestly, none of this stuff ever seems to come in handy. Maybe it’s because most of what I encounter is novel datasets where there’s no established method?

I reasonably regularly pick up new discrete methods, but the numerical stuff never seems super useful...

I don’t know, just a confession I guess... it never comes up on interviews either for what it’s worth.

Re:Eigenvectors and Eigenvalues (2015) by soVeryTired on Tuesday May 15, 2018 @12:22PM (#17075126)
For a large fraction of probability theory, you only need two main facts from linear algebra.

First, linear transforms map spheres to ellipsoids. The axes of the ellipsoid are the eigenvectors.

Second, linear transforms map (hyper) cubes to parallelpipeds. If you start with a unit cube, the volume of the parallelpiped is the determinant of the transform.

That more or less covers covariances, PCA, and change of variables. Whenever I try to understand or re-derive a fact in probability, I almost always end up back at one or the other fact.

They're also useful in multivariate calculus, which is really just stitched-together linear algebra.

Re:Eigenvectors and Eigenvalues (2015) by qmalzp on Tuesday May 15, 2018 @03:54PM (#17077267)
I think the first point is only true for symmetric matrices (which includes those that show up in multivariable calc). In general, the eigenvectors need not be orthogonal.
Re:Eigenvectors and Eigenvalues (2015) by soVeryTired on Tuesday May 15, 2018 @05:35PM (#17078066)
Yep, you could well be right. The image of an ellipse under a linear transform is definitely an ellipse, but I'm not sure about the eigenvectors in the general case.

The symmetric case is by far the most relevant for probability theory though.

Re:Eigenvectors and Eigenvalues (2015) by tprice7 on Tuesday May 15, 2018 @11:36PM (#17079845)
In general it's the eigenvectors of the positive-semidefinite (hence symmetric) part of the left polar decomposition.
Re:Eigenvectors and Eigenvalues (2015) by zawerf on Tuesday May 15, 2018 @03:33PM (#17077060)
I use the 2nd point a lot for debugging 3d transforms. To expand upon it, for example in three dimensions the three axes are:

(1, 0, 0)

(0, 1, 0)

(0, 0, 1)

To find out where those axes are after a 3x3 matrix transform, you just read off the first, second, and third columns of the matrix respectively. Then you can mentally visualize another unit cube in the new coordinate system using those three vectors as the edges of the cube.

Really basic change-of-basis stuff but academic lectures don't emphasize how useful it is to be able to look at a matrix of numbers immediately know what it does.

Re:Eigenvectors and Eigenvalues (2015) by aidos on Tuesday May 15, 2018 @06:11PM (#17078360)
This concept totally changed my intuitive understanding of matrices. Beautifully illustrated in the below 3blue1brown video.

https://youtu.be/kYB8IZa5AuE?t=3m15s

Re:Eigenvectors and Eigenvalues (2015) by sakuronto on Tuesday May 15, 2018 @01:21PM (#17075672)
Not a very useful addition but hypercube is to cube as parallelotope is to parallelepiped.
Re:Eigenvectors and Eigenvalues (2015) by jdonaldson on Tuesday May 15, 2018 @11:05AM (#17074456)
Eigenvectors and Eigenvalues show up everywhere, although sometimes it's in the form of an iterative estimate (PageRank is basically the power method estimation of the first eigenvector of a connected graph of web pages).

They're in the same class as logarithms and Fourier transforms IMHO. You won't need to calculate them by hand, but you should know what they do and why they're important.

Re:Eigenvectors and Eigenvalues (2015) by madengr on Tuesday May 15, 2018 @12:24PM (#17075139)
I use logarithms and FFTs daily, but got a C in Linear Algebra, after getting A in all other EE/Math/Phys courses. It kicked my ass once we got to proofs.
Re:Eigenvectors and Eigenvalues (2015) by xevb3k on Tuesday May 15, 2018 @11:17AM (#17074556)
Interesting, perhaps that’s it... I’ve used FFTs a few times, but even FFTs have never been make or break in terms of getting a pipeline or analysis working well.
Re:Eigenvectors and Eigenvalues (2015) by cowboysauce on Tuesday May 15, 2018 @11:44AM (#17074833)
The Fourier transform is actually linked with linear algebra. You can think of it as taking a vector in an infinite dimensional Hilbert space (your signal) and decomposing it into its components (the amplitudes of the frequencies).
Re:Eigenvectors and Eigenvalues (2015) by stephencanon on Tuesday May 15, 2018 @11:50AM (#17074865)
The Fourier transform as used in practice in signal processing is ~always discrete, hence finite-dimensional. It's literally "just" a rotation with an especially nice decomposition that allows efficient multiplication.
Re:Eigenvectors and Eigenvalues (2015) by danharaj on Tuesday May 15, 2018 @12:05PM (#17074968)
A particular fft in practice may be discrete but the relation between fft's of different resolutions of the "same" signal hints at the infinite structure which bundles up all the finite subspaces into one conceptual object.
Re:Eigenvectors and Eigenvalues (2015) by WhompingWindows on Tuesday May 15, 2018 @12:13PM (#17075046)
Why should you know what they do and why they're important? How does that practically change my R code?
Re:Eigenvectors and Eigenvalues (2015) by angersock on Tuesday May 15, 2018 @01:41PM (#17075904)
Because, say, knowing about Fourier transforms can help you write more efficient filtering or open up new ways to view your data--perhaps there's a really interesting behavior in the frequency domain you'd miss otherwise.

If you just want to be a statistical script kiddie you do you. :)

Re:Eigenvectors and Eigenvalues (2015) by ItsMe000001 on Tuesday May 15, 2018 @03:27PM (#17076976)
When working with real world data almost everything is more important than being able to use the most abstract methods "to extract the last bit of data". It's often extremely fuzzy to begin with, the collection process to what it represents, for me, while I love math and see it as the "magical language" in a magical world, I find common sense and a certain kind of work ethics go soooo much further than any math Ph.D. I (with a CS degree) wanted to start another study (over a decade later, thirsting for new theory and new knowledge) and chose math - but that was around the same time edX and Coursera etc. got up and running with loads of courses, and I ended up ditching the additional math degree for loads and loads of courses in fields like medicine and biology, deciding to go for breadth instead. Of course, that's purely personal and even as an anecdote not worth much to anyone. It's just that I too got disillusioned with (higher and higher) math as an helpful tool in practical life. Of course I still see the benefits in many fields, but I think a surprisingly low number of very good specialists may be all we need. The rest of us can just ask them when we actually do need something.

Right now I'm taking a "math. modeling" course. Still, the only use case I ever found was... other courses! I already modeled a little bit in a biology course. Sure, in real life I could model this or that, but the truth is that a very rough estimate guided by experience and "feeling" has always been enough. There are too many variables that cannot be accurately measured, so going for a nice model is kind of useless.

For example, I was just asked today about the performance of the crypto-hash-connected data storage and exchange library I wrote. Now that sounds like something I could model! Only experience tells me that's useless. The only worthwhile answer is to set up a concrete scenario, with a concrete app using it, concrete network and concrete systems, and test it. Could be anything from smartphones to well-connected servers. Sure I could create a sophisticated model and simulation - and it would be useless.

Maybe I'm just a bit, or more than just a bit, disappointed that all the considerable amount of math I learned in my life didn't seem to be of nearly as much use as I would have hoped. I'm also frustrated each time such a topic comes up and everyone is so excited about how great it is, and I always feel like I'm missing something despite trying hard, like the color blind guy looking at paintings. I mean the usefulness to me, not understanding it.

Re:Eigenvectors and Eigenvalues (2015) by pphysch on Tuesday May 15, 2018 @04:20PM (#17077534)
As a younger person (finishing up a Math BS) this resonates with my perspective.

IMHO, it comes down to individual beliefs about mathematical realism. Is there anything inherently real about math, or is it just a man-made, arbitrary set of cognitive tools? Is it valid to presume the existence of a Grand Mathematical Framework that can solve any problem a priori? Or, is every problem unique and independent of mathematical developments?

From the little I've read about Math history, it seems pretty clear that the Problems came first, and the Mathematics followed. Infintesimal calculus, game theory, etc. were mathematical ideas developed primarily to solve real problems. Then 20th century formalism came along and rebranded much of mathematics under a "clean" framework, while giving little attention to the human environment in which much of it was developed.

To me, it is a great shame that abstract mathematical concepts are made further abstract (e.g. in math education) by distancing them from their human roots. Instead of forcing oneself to understand this mathematical "new testament", I think it's far more productive to adopt this sort of irreverent attitude towards math as you describe.

Einstein:

>"As far as the laws of mathematics refer to reality, they are not certain; and as far as they are certain, they do not refer to reality."

Re:Eigenvectors and Eigenvalues (2015) by hyperpallium on Tuesday May 15, 2018 @09:18PM (#17079270)
Reminds me of economic rationalism: model makes sense, and conclusions seem logical and compelling - but you can't tell if the model represents reality or even if crucial factors have been omitted.
Re:Eigenvectors and Eigenvalues (2015) by aje403 on Tuesday May 15, 2018 @04:46PM (#17077736)
Perhaps colleges can start adding an "applied" math major with a focus on subjects that more directly involve the human environment more directly to alleviate the problem you're describing?
Re:Eigenvectors and Eigenvalues (2015) by akvadrako on Tuesday May 15, 2018 @05:53PM (#17078214)
Applied math is definitely a major. Do you mean something else?
Re:Eigenvectors and Eigenvalues (2015) by hyperpallium on Tuesday May 15, 2018 @09:13PM (#17079247)
I'm doing some fluid simulation (CFD), and the actual code for finite differences is simple. But the analysis (of stability etc) is more mathy, and I don't feel confident reading other needed papers, because they are couched in math.

I mean, I can and have coded it, but can't be sure how it how it will behave in all situations.

So I can understand these papers, I'm going back to study math properly. I'm not fully convinced it's really needed (though how could I tell?), but I'm fully convinced it's needed to understand the papers.

Math is the latin of CFD.

Re:Eigenvectors and Eigenvalues (2015) by bigger_cheese on Tuesday May 15, 2018 @11:10PM (#17079752)
I work in Engineering and feel somewhat similar about CFD. There's always some element of doubt lurking in the back of my mind "is it really correct in all circumstances".

The most useful info I learnt at university were a couple of equations: Bernoulli's (for general observation about expected pressure drop), Ergun's (for flow through packed beds) and the general laws of thermodynamics.

Those are mostly enough to be able to sketch out an intuitive 'guess' about expected behavior in a large range of systems and the underlying math is not particularly demanding.

Re:Eigenvectors and Eigenvalues (2015) by hyperpallium on Wednesday May 16, 2018 @03:20AM (#17080589)
Have you seen the Method of Manufactured Solutions (MMS)?

You guess ("manufacture") a solution to the PDE. Then you plug it into the PDE. It won't be correct, so you just add source terms to make it correct. You now have an analytical solution for this PDE with those source terms. You can now run your simulation (with those source terms) and compare it with the "correct" solution.

Unfortunately, you'll introduce discretization error, because your delta x and delta t aren't infinitessimal. But using the order of accuracy of your discretization method, you know how the error should change with delta x and delta t. So you graph error against delta x, on log-log, and see if the curve matches the order of accuracy. Apparently, it shows up even minor bugs in your code really well.

This approach scares me a little, because how do I know my math is correct? I need better appreciation of how the order of accuracy interacts over time as well as space; the behaviour of error summaries; and how log-log plotting works.

Re:Eigenvectors and Eigenvalues (2015) by xevb3k on Tuesday May 15, 2018 @09:09PM (#17079232)
Really interesting, thanks! Yes, it’s certainly been my experience that adding more domain knowledge has helped me a huge amount.
Re:Eigenvectors and Eigenvalues (2015) by Jack000 on Tuesday May 15, 2018 @09:02PM (#17079203)
well you don't need this stuff until you do - some things still need definite, analytical performance guarantees.

I'd be pretty nervous riding an airplane that didn't use modern control theory, or going over a bridge that didn't use FEA - or an self-driving car that ran on a raspberry pi instead of a RTOS...

Re:Eigenvectors and Eigenvalues (2015) by ItsMe000001 on Wednesday May 16, 2018 @02:57AM (#17080488)
Why do you think in absolutes? I'm tempted to cite a certain Dilbert... but that would make me appear incredibly rude, which I really don't want to be. Of course it is easy to find examples where it's needed, and it is easy to see so too. So? Did I propose at any point "Nobody needs higher math for anything" or something similar? I don't see a need to argue about an argument never made.
Re:Eigenvectors and Eigenvalues (2015) by Bukhmanizer on Tuesday May 15, 2018 @01:14PM (#17075598)
It's one of those things that you don't notice when it's missing, but probably would help a bit if you knew it. That being said, I have to deal with linear algebra every day, and aside from proofs (which obviously they help with), there have been maybe a handful of times that having a deep knowledge of eigenvectors and eigenvalues has helped significantly. Once or twice though, I've got massive speedups (>500x) just by knowing how to do the same thing in a more efficient way.

My feeling is having a basic knowledge of testing/caching/memory management is way more useful when you're doing large image analysis.

Re:Eigenvectors and Eigenvalues (2015) by xevb3k on Tuesday May 15, 2018 @01:46PM (#17075967)
Interesting, well I’ll try to keep reviewing this stuff and hoping I find an application.

I really would like to find an application in my work, because without that I find new techniques don’t really stick and after a few months I forget them...

Re:Eigenvectors and Eigenvalues (2015) by gh02t on Tuesday May 15, 2018 @04:48PM (#17077750)
It depends on the field you're in. For example, if you're in an area that heavily uses differential equations (many engineering disciplines) then you're probably gonna be using eigenvectors a lot, as they are important for solving a lot of problems. Other areas may not need them at all. It also depends on your depth in the field. A rank and file engineer may not need to know anything about them - they underpin a lot of numerical methods, but get hidden away in software packages. Someone developing those software packages likely will, though. Techniques based on eigenvectors and eigenvalues are extremely important in my field (nuclear engineering... you've probably heard the term "critical", that refers to an eigenvalue), but I know someone who is an excellent civil engineer and knows next to nothing about them (or linear algebra in general) because they aren't that important for what he works on.

Forgetting stuff you don't use is pretty normal, the important thing is to be able to recognize when a technique you don't remember the details of might be applicable, and to know where to look to refresh your memory.

Re:Eigenvectors and Eigenvalues (2015) by Bukhmanizer on Tuesday May 15, 2018 @02:13PM (#17076235)
I'm the exact same way, my job is really heavy in linear algebra, so it sticks more easily for me.

Usually I go through the code and ask "what am I trying to do here" and "can I do this a better way". A lot of the aforementioned speedups have come because the previous developer was obviously trying to do something, like create a linear projector, but were following some sort of math formula, so made a bunch of extraneous matrices that were huge.

It's a simple fix, but adds up when you're dealing with massive datasets.

Re:Eigenvectors and Eigenvalues (2015) by electricslpnsld on Tuesday May 15, 2018 @11:15AM (#17074537)
It comes up all the time when trying to build second order optimization methods. With the eigensystem of your objective in hand you have a complete understanding of the (non-) convexity of your energy landscape, which is useful to ensure you always have good search directions, etc.
Re:Eigenvectors and Eigenvalues (2015) by tzahola on Tuesday May 15, 2018 @11:03AM (#17074434)
What kind of novel dataset are we talking about?

Just from the top of my head, you could have encountered eigenvectors/eigenvalues:

- if you ever used spectral graph algorithms

- if you ever done dimensionality reduction via principal component analysis

- if you ever calculated the steady state distribution of a Markov chain

Re:Eigenvectors and Eigenvalues (2015) by xevb3k on Tuesday May 15, 2018 @11:08AM (#17074476)
Image analysis and signal corrections on time series data. Extracting features from microscope images for example, correcting for signal convolutions.
Re:Eigenvectors and Eigenvalues (2015) by wglb on Tuesday May 15, 2018 @08:25PM (#17079039)
It is certainly frequent in engineering. If you need to analyze the stability of an electrical grid, there isn't much alternative.

A fun book on this is https://openlibrary.org/books/OL2398351M/The_algebraic_eigen...

Re:Eigenvectors and Eigenvalues (2015) by rxhernandez on Tuesday May 15, 2018 @10:53AM (#17074346)
Just my anecdotal experience, I've seen it come up in interviews for an algorithms group at a medium sized biomed company.
Re:Eigenvectors and Eigenvalues (2015) by aje403 on Tuesday May 15, 2018 @11:44AM (#17074829)
This is frightening but believable. I've worked with a few "quants" who stared at me doe eyed explaining eigen* and basic calculus concepts to them in the context of why their calculations don't add up. You mention you've used fourier transforms before - if you don't understand an eigenbasis then you don't have a fundamental understanding the math you're deploying.
Re:Eigenvectors and Eigenvalues (2015) by ajross on Tuesday May 15, 2018 @08:27PM (#17079057)
> You mention you've used fourier transforms before - if you don't understand an eigenbasis then you don't have a fundamental understanding the math you're deploying.

That's a bit uncharitable. A fourier decomposition can absolutely be understood as an explicit bag of calculus tricks, with no loss of precision or generality. And an awful lot can be done with just those tools -- you don't need to explain JPEG compression or VLBI astronomy in terms of eigenvectors, for example.

Obviously (heh, "obviously") it's true that the space of decomposed functions form an orthogonal basis, so technically we're "really" operating in a linear space and that has expressive power too. But there are lots of ways of looking at problems.

To wit, you're not wrong. You're just... Well, you know.

Re:Eigenvectors and Eigenvalues (2015) by aje403 on Wednesday May 16, 2018 @05:26AM (#17081034)
Dude your post is orthogonal
Re:Eigenvectors and Eigenvalues (2015) by xevb3k on Tuesday May 15, 2018 @01:16PM (#17075614)
In the context I used it, FFT wasn’t really of fundamental importance. Using FFT (and in particular FFTW) gave a performance improvement (execution speed), but no real advantage in terms of accuracy over an alternative naive method...

So... yes I guess I’ve just not seen anywhere in my work where this stuff has proved useful...

Re:Eigenvectors and Eigenvalues (2015) by aje403 on Tuesday May 15, 2018 @01:29PM (#17075758)
It's pretty much ubiquitous in any quantitative field... would not even know where to start