Monday, April 30, 2012

Ron Paul

Regardless of how you feel about his politics, you've got to admit that Ron Paul is a refreshing presence in American politics. He is among the most well-read, principled, and consistent politicians around.

The kind of reverence and enthusiasm he evokes on college campuses (traditional bastions of the Left) is truly amazing to watch. I first got interested in him during his campaign for the 2008 presidential nomination, and wound up reading his book "End the Fed" (which, as he recounts in the book, was apparently a chant that originated on the campus of my alma mater).

1. For Liberty: an "abridged" hour long video documentary, mostly about his 2008 campaign.

2. Leithner Letter (pdf): Is Ron Paul a better investor than Warren Buffett? An interesting analysis of his political and economic views and impressive investment returns.

3. Jon Stewart on the Daily Show: Why do they ignore him? Old episode (after the Iowa Straw poll).

Wednesday, April 25, 2012


1. Loss aversion: An article in the NYT.

2. Academic Homepage (PhD comics)

3. James Altucher on 40 alternatives to college.

Friday, April 20, 2012


You've probably heard of the recent Flashback infections on Apple Macintoshes. It makes you see the old Mac v/s PC video in new light.

There's an interesting back of the envelope calculation which predicts the market-share "f" at which writing malware for Macs would become "profitable". If you assume that the non-Mac world is all PC, and that the success-rate of an attach is "s" (due to anti-virus protection), then you end up with, f = (1-f)s as the attackers utility equation, which yields f = s/(1+s). Plug in "s=0.2", which is a typical success rate, you get f = 0.16, compared to the current 11% market-share.

Nothing is unbreakable! Not Oracle, not Macs, not Linux!

Monday, April 16, 2012

More Physics Envy

On the heels of a recent related link, comes this talk, in which Andrew Lo deliberates on what physics envy may have done to the dismal science (H/T Farnam Street). From the video:
In physics it takes 3 laws to explain 99% of the data. In finance it takes more than 99 laws to explain about 3%.
Interesting video, especially for those with some knowledge of both fields. Also check out the link (from the Farnam Street blog) to a paper (PDF) by the same title. 

Friday, April 13, 2012

An Academic Career

"Don't! It is the least profitable way to be miserable!" advised Max Shtein when asked about academia as a career choice, during a "preparing future faculty" seminar. This was slightly more than half a dozen years ago at Michigan, when I was one of the many PhD students in the room.

Clearly, I did not take his advice.

Today, as I sit on the cusp of tenure, I thought it might be worthwhile to take a look back, and assess how relevant much of the advice I sought or received was.

Consider this the first installment of an ongoing travelogue.

Anecdote is not data. But sometimes, it can, like a parable, be quite instructive.

My path to academia was hardly linear. Sure, I entered the PhD program in chemical engineering at Michigan with the single-minded goal of becoming a scientist/professor. From that point on, I seriously toyed with several potential career choices (industrial research, investment banking, plant/process engineer, consulting etc.),  before the pendulum swung all the way back.

By my final year in the PhD program, I had rediscovered my single-minded goal of becoming a scientist/professor.

Parenthetical Remark: While this is not atypical, many of my current colleagues have traced a more "linear" course. Some others have taken far more convoluted routes, and their final arrival into academia was more an accident, than an act of design.

Why did it take so long to figure out?

For one, each time I contemplated an alternative career choice, or met someone in the field, some part of me got genuinely excited at the prospect. I had no clue about many of the choices before. So a lot of this was the usual "let me check what's on the menu before I order my chicken-sandwich" kind of exploration.

For another, I had not yet finished the process of soul-searching that is a necessary part of taking on any major challenge. I wasn't completely sure if I could hold my own ground in a field that was dominated by other people who (i) knew more, (ii) were smarter, and (iii) worked harder than I did.

If this came to a boxing slugfest, I had no chance. But, as I have subsequently discovered, boxing is a terrible metaphor. It is too much of a zero-sum game.

So I spent a lot of time introspecting, trying to ask myself "what's my edge?"

And then all of a sudden, like one of those "aha" moments, I just knew. I wish I could say that the decision was the inescapable conclusion of a long rational deductive process.

But it wasn't.

All I knew was that somewhere a red traffic light turned green, and I decided to press the accelerator.

Tuesday, April 10, 2012

Gauss Quadrature Nodes and Weights

Gauss quadrature is a family of numerical methods used to integrate functions. Depending on the integration limits (and weighting function), we can come up with methods such as Gauss-Legendre, Gauss-Hermite, Gauss-Laguerre, Gauss-Chebyshev etc.

To integrate a given function, one can find tabulated nodes and weights. For example, here, here, and here. While this is nice, often one would rather have a program that would gives us the nodes and weights to use (in say another program linked to it).

There are many choices here, including gaussq from Netlib, GQ subpackage from ALGLIB, etc.

John Burkardt has a well-documented description and source-code for IQPACK (also called TOMS655) in several languages (Fortran 77/90, C, C++, and Matlab). The compiling instructions, and examples are also extremely clearly documented.

Thursday, April 5, 2012

Soft and Hard Sciences

Interesting opinion in the NYT "Overcoming Physics Envy" (H/T Bridging Differences), trying to argue why the "hypothetico-deductivism" of the physical sciences may not be the best strategy in social sciences.

A more important criticism is that theoretical models can be of great value even if they are never supported by empirical testing. In the 1950s, for instance, the economist Anthony Downs offered an elegant explanation for why rival political parties might adopt identical platforms during an election campaign. His model relied on the same strategic logic that explains why two competing gas stations or fast-food restaurants locate across the street from each other — if you don’t move to a central location but your opponent does, your opponent will nab those voters (customers). The best move is for competitors to mimic each other. 
This framework has proven useful to generations of political scientists even though Mr. Downs did not empirically test it and despite the fact that its main prediction, that candidates will take identicalpositions in elections, is clearly false. The model offered insight into why candidates move toward the center in competitive elections, and it proved easily adaptable to studying other aspects of candidate strategies. But Mr. Downs would have had a hard time publishing this model today.

To borrow a metaphor from the philosopher of science Ronald Giere, theories are like maps: the test of a map lies not in arbitrarily checking random points but in whether people find it useful to get somewhere.

Wednesday, April 4, 2012

Nested Subfunctions in Matlab and Octave

In a previous post, I mentioned subfunctions in Octave and Matlab.

Nested functions are an interesting new beast. I can see situations where they can be useful as explained in this short video, and this longer, more detailed blog.

They are currently not featured in GNU Octave. Here's their reasoning:
There was discussion in Octave of having these even prior to Matlab, and the decision was made not to have these in Octave at the time for compatibility.
Now that Matlab has recently introduced nested functions, Octave will probably have them soon as well. Until then nested functions in Octave are treated as sub-functions with the same scoping rules as sub-function.

The authors of Octave consider the nested function scoping rules of Matlab to be more problems than they are worth as they introduce diffiult to find bugs as inadvertantly modifying a variable in a nested function that is also used in the parent is particularly easy.