Tuesday, September 27, 2011

Summer Reunion

This August we had a family reunion in the Outer Banks, NC. We (I lost count after two dozen) rented a beautiful beach house near Jennette's Pier in Nags Head for a week. It was a really memorable affair, and hopefully we will get around to doing it more often in the future.


On one of the days we went to the Wright Brothers National Memorial, which is built on the site of their first successful controlled flight. Their story is truly awe inspiring, and it is hard not to come back from the Memorial without a sense of immense respect for their hard work and ingenuity.


Interestingly, a week after we had been there, Hurricane Irene ripped through the Outer Banks. In fact, in one of the videos on Weather channel had the beach house we lived in, in the background. As someone remarked, we may have been the last people to have enjoyed the house.



Sunday, September 25, 2011

Achievement Gap

In this nearly hour-long video (via Bridging Differences), an assortment of panelists discuss the nature of the achievement gap between races. All of them agree that there are no simple solutions, which in itself is interesting since both Diane Ravitch and Michelle Rhee are on the panel.

At one point, Ravitch reasserts her view that the original idea behind standardized testing was purely diagnostic. It was meant to be used like a thermometer is used to check temperature. Its widespread current use in penalizing or rewarding schools and teachers defeats that original intent. Comer backs her up by saying that a  thermometer can tell whether a patient has a fever, but tells us nothing useful about what caused it, or how to fix it.

In response, Rhee contends that once you find something amiss in the diagnosis, you do something about it, right? The idea that measurement and a corrective response to that measurement are completely independent of each other is misguided. If students under a particular teacher get low scores year after year, then at some point, one has to consider the hypothesis that the teacher needs to go.

Angel Harris also points out that anecdote is not data. Just because a certain model has worked once somewhere doesn't prove that it is a successful model. You have to consider the entire distribution of outcomes under that model.

A very interesting civil conversation.

Thursday, September 22, 2011

Speeding up Matlab code

Here is a nice video from Mathworks on different ways to speed up Matlab programs. It covers a bunch of techniques including  preallocation and vectorization, which get you a great deal of bang for the buck.

It is nearly an hour long.

Saturday, September 17, 2011

How to write gzipped files from a C++ program?

Every so often, you write a C++ program that generates a ton of output. There are cases when you want to write continuously to a compressed gzipped file from the C++ program (rather than using gzip to compress a large file after the program has finished running).

One solution is to use the gzstream library. It "is a small C++ library, basically just a wrapper, that provides the functionality of the zlib C-library in a C++ iostream. It is freely available under the LGPL license."

How do you actually do it? It is actually quite simple in a standard *nix system.
  1. Download and unarchive the tarball into a folder gzstream.
  2. Type "cd gzstream" and then "make" at the command prompt. It should make a library called "libgzstream.a"
  3. Move the folder to an appropriate location if needed.
  4. In the C++ program file: #include the headers gzstream.h, iostream, and fstream.
  5. In your C++ program, say "ogzstream rpout("sigma.gz");", where rpout is the handle and sigma.gz is the filename that you want to write to.
  6. Write to the file using somthing that may look like "rpout << setprecision(4) << sigma << endl;"
  7. Close the file with "rpout.close();"
  8. Finally to compile the C++ program say something like: "g++ program.cpp -I./gzstream -L./gzstream -lz -lgzstream". Here I assume that the gzstream directory is located in the same directory as the C++ program. If this is not true, then you have to change the -I and -L location tags.
  9. You are now good to go, with "a.out".

Thursday, September 15, 2011

Math Links:

1) A history of Bayes Theorem: I always find articles that put faces and history behind theories and formulae interesting. As you might notice from the comments, statisticians are argumentative :)

2) Why math software cannot be used mindlessly: We are reminded yet again why results from Matlab or Mathematica need to be understood.

Tuesday, September 13, 2011

Linux Mint

You may have seen this xkcd comic before.
I guess that can only mean one thing. The year of Linux Desktop is here!

After a fairly long hiatus, I tried out a new Linux distribution (new to me) called Linux Mint which has recently surged in popularity. It appears (from less than scientific sources) to be about three times more popular than other distributions with name recognition (Fedora and OpenSuSE), although it still trails Ubuntu quite a bit. Interestingly, Linux Mint is based on Ubuntu, which in turn is based on Debian.

My first few impressions. It worked just great on the six year old laptop that was lying around my house. Installation was a breeze, and since it downloads audio and video codecs, it worked "out of the box". The interface is clean and friendly.

Given improvements in LibreOffice and the grain of truth in the comic above, I think it might finally be time to wean my parents off of their heavily infested Windows installation.

Sunday, September 11, 2011

Ten years since 9/11/2001

A lot of people have very vivid memories of where they were, and what they were doing when the Twin Towers went down. Compared to most of my memory, which is a sequence of low-resolution bitmap images - colored and "photoshopped" by biases and time - I recollect 9/11 in HD video.

One of lab-mates was defending his PhD at 9am. Normally, like the majority of grad students at Michigan, I was somewhat nocturnal. The only reason I streamed into the department around 8:30 was to watch my friend defend.

From the moment I entered the department, things looked eerily different.

There was a small TV in the conference room, which probably would look more at home alongside the other relics encased in a nearby glass exhibit, that was turned on.

All the faculty and most of the staff seemed to be glued to the screen. It was mildly disorienting to observe a familiar environment cast in an unfamiliar light.

Despite the general confusion regarding what was happening, the defense went on as scheduled. You did not need a PhD to know what was on the audience's mind.

These were pre-smartphone days.

As soon as the talk was over, one of the faculty ran outside to check what was happening. He returned in about five minutes with the news that one of the towers had collapsed, and that another plane had struck the second tower.

People gasped.

A few short minutes later, school was called off, and we were sent home.

History sometimes happens, when you least expect it.



Saturday, September 10, 2011

Grade Inflation Links

1. A nice Infographic: A student from my department (Ian) pointed out that while the graphic is nice, the "embed me code" seems to tailored to improve its Google PageRank. At some point they may start advertizing links to online colleges and collect a fair amount of money!

2. A treasure trove of data and analysis (check out some of the links) on grade inflation.