Saturday, April 17, 2010

Computation in political science

I was talking to Mike B the other day, wondering how to best proselytize social scientists to the wonders of computational methods. We ended up brainstorming a list of topics for an Introductory Computation 501 class for grad students.

Here's what I remember from the list. What should we add?
  • Basic architecture of computers and the Internet
  • Enough python to understand pseudocode (if, else, for, while...)
  • Big O notation
  • Regular expressions, probably in tandem with HTML
  • Spiders and crawlers
  • NLP text classification (probably Naive Bayes, latent semantic analysis, and SVM)
  • Database architecture (keys, tables, queries, etc...)

Thursday, April 15, 2010

On insomnia and separating hyperplane classifiers...


The other day I woke up at three in the morning. Couldn't sleep. No good reason.

So I went to the living room and tried to work through a statistical problem that had been bugging me: how are support vector machines different from logistic regression? I know -- I'm sure it's been on your mind too.

Anyway, after much math and Googling, I discovered this paper, which clarified the whole thing. SVM and logistic regression are basically the same, except that they optimize for slightly different parameters. SVMs typically do better on smaller training sets, but logistic regression has better asymptotic properties.

And now you know.

PS - This is all very handy if you are trying to train computers to read blogs for you.

Wednesday, January 20, 2010

Book Review: The Big Switch


I just finished reading The Big Switch, Nicholas Carr's description of the rise of cloud computing. The thesis is simple: computing is becoming a utility, just like electricity. The book comes in three parts: historical comparison, policy implications, and social implications

The first part of the book is great. It sticks to the thesis, going back and forth between the early 20th century and the early 21st to make the comparison between electricity and computing as utilities. Carr's narration of the technological, business, and social changes that attended the early twentieth century rise of the electrical grid in the U.S. are particularly interesting. Analytically insightful and engagingly written, the first half of the book is a must-read.

The second part of the book is pretty good too. Carr raises a selection of thorny security and legal issues around the use and maintenance of the Internet. Most of these are not new (privacy, spam, phishing, cybersecurity, etc.), but Carr does a good job laying out the important facts. No solutions -- but that would be a lot to ask.

The last portion of the book, you can skip. Here Carr abandons his thesis and turns his back on history to wander into a dystopian tirade. Stepping into the role of an Emersonian prophet of doom, he laments the flattening loss of human spirit in a world dominated by the World Wide Computer. He predicts that computing will destroy our social relationships, take over our bodies, and weaken and replace our minds. It's pretty Matrix-esque, actually. And I don't buy it.

This section annoyed me so much ("The rest of the book was amazing, and then he coughs up this kind of drivel?") that I can't let it go without a fight. Carr's half-baked mantra is "the Internet is a medium of control." Implication: control is antithetical to freedom; therefore, the Internet is decreasing human freedom. But his use of the word "control" is slippery to the point of silliness.

Examples:
pg 192: "The process of control itself has two thrusts. It involves measurement ... and two-way communication."

pg 195: "The entire history of automated data processing ... is best understood as a part of [an] ongoing process of reestablishing and maintaining control."

pg 198: "Programming, after all, is nothing if not a method of control."

We're supposed to believe that measurement, communication, data-processing, and computer programming equals a loss of human freedom? Again, I don't buy it.

Most of Carr's objections to interconnectedness through computing could also be raised against interconnectedness through language: it shapes thought, alters behavior, complicates relationships, and subjects people to new stresses. All true. But language also allows greater empathy, creative expression, coordination, communication, collaboration, and cooperation -- the same kinds of benefits we see on the Internet. All told, I think most people will agree that language is more liberating than stifling. I'm still convinced that the same is true of the Internet.

Wednesday, September 30, 2009

Game theory on the Daily Show

Bruce Bueno de Mesquita is a political scientist specializing in game theory and coalitions. Unlike most academics, he's made a business out it. He routinely consults for the government and businesses trying to predict future political events. He's got a new book out -- The Predictioneer's Game -- which I suspect may be the next Freakonomics. Controversial, widely read, simultaneously powerful and a little gimmicky.

I've discovered that BDM is a polarizing figure among game theorists. On the one hand, he's clearly good at what he does, and he's succeeded in bringing some popular attention to it. On the other hand, he sometimes comes off as arrogant, and he makes some really big claims. Lots of people think that one of these days, he's going to be wrong about something big. I get the impression that a jealous few would like to see it happen.

A bunch of fun links to BDM-related material:
* His interview on the Daily Show on Monday of this week. In my opinion, Stewart asks good questions, but lets him off easy on the answers.
* The TED talk where he first (?) made his prediction that Iran will not get the bomb.
* A really good NYTimes article on the topic.

There's one link I couldn't find: video from the History Channel's show "The Next Nostrademus." I'm told it's over the top. Links anyone?

Tuesday, September 29, 2009

Follow up: Big stories from the '08 election

About a month ago, I posted asking for your thoughts on the biggest stories of the 2008 presidential election. If you recall, my goal was to compare your intuition with a computer algorithm chewing through reams of newspaper archives.

Here are the results, as a line graph. The red line is an aggregate tally of your responses. The blue line tracks total words of coverage devoted to the campaign. The two track reasonably well, taking into account the fact that news coverage often lagged actual events by a day. (I used newspaper coverage for this tally; presumably, evening TV coverage wouldn't have had this lag.)


When you chalk up the important stories, here's what you get. These are the top 10 stories from the election, tallied using three slightly different measures.

Your Responses
1. Reverend Wright controversy
2. Rep. convention; Palin joins ticket
3. Election day
4. Super Tuesday
5. Clinton concedes Dem. nomination to Obama
6. Iowa caucus
7. McCain suspends his campaign to work on the financial crisis
8. Obama makes his “PA bitter” comment
9. Dems vote to seat MI and FL delegates
10. Dem. convention

Computer version A (text volume)
1. Election day
2. Super Tuesday
3. Election week
4. Iowa caucus
5. NV and SC caucuses
6. Obama becomes presumptive Dem. nominee
7. McCain becomes presumptive Rep. nominee
8. Rep. convention; Palin joins ticket
9. Giuliani and Edwards withdraw
10. Dem. convention

Computer version B (IEM trading volume)
1. Election day
2. Rep. convention; Palin joins ticket
3. Final phase of the election
4. Election week
5. WA, D.C., MD, VA primaries
6. McCain becomes presumptive Rep. nominee
7. Super Tuesday
8. Democratic convention
9. NC and IN primaries
10. OR and KY primaries

What you see is that the computer gets a lot of things right (election day, Super Tuesday, the party conventions), but misses nuances that a lot of people thought were important. For example, the Rev. Wright controversy was the number one story in your responses -- almost everyone remembered it as a pivotal event in the campaign -- but it didn't generate that much media coverage, so the computer didn't see it as particularly important. I think it's an open question whether our memories are cloudy, or the computer's event detection is flawed.

If you're really into this stuff, here's a link to the paper. It's half baked, but feedback from the conference convinced me that the concept is worth pursuing as a research topic. Thanks again for your help!