Friday, January 21, 2011

R-dy R R

Hey, all.

So, I haven't been by in some time. Sorry 'bout that - you know, to my four loyal readers. :)

I spent winter break taking a class on a scripting language called R. That was a kick: two weeks to try and learn the language, the basics of LaTeX (a typesetting system), and how to get the two to talk to each other via a process called 'Sweaving.'

Also, as 8 days are such a long time: introductory spatial statistics.

Needless to say, this didn't go as planned. We all tried very hard: I pulled a lot of sessions staying up 'til midnight, and I was far from alone. The instructor's wife had a nightmare that he was cheating on her with a woman named 'R,' from what I heard. Part of the trouble was that everyone was deficient somewhere:
  • Poor Professor Rogers had never even taken a computer programming course before
As a result, he wasn't expecting all the difficulties with different machines. We had Macs, Windows XP through 7, etc. Not everything worked the same on every platform, naturally. I warned him this would never get better, with systems constantly changing. (One poor guy had a tiny little Asus machine that couldn't run the regressions for our final project.) We could use the school computers for R, but not LaTeX/Sweave.
  • The class only required entry level econometrics to get into, so all the students were unprepared in some required area.
For most of them, it was computer programming experience. I actually had the most experience in that area, which is a scary thought. Nobody else really knew anything at all, and I used to doodle games on my TI-85, way back when. (I did get the little thing playing Tetris, but I'm not exactly a code monkey. Never really did anything with C++ or anything, and all my exploits are over a decade old.)

In my case, the weak spot was econometrics: I hadn't even heard of most of the techniques we were supposed to be expanding on, while most of them were comfortable there. Lots of Criminology PhD students. I guess they do that stuff a lot.


Needless to say, I had a blast. It was just like old times: obsessive focus on a single subject, no time for anything else. Didn't write. Barely remembered to eat. Loved it. I think I was the only one who did. I have some fellow students in the current term who are all treating it like a traumatic experience.

Now that it's over, I'm continuing to try and learn about all this on my own, and just wanted to post about it here, (partly as a reminder to myself to actually come here and post more).

I'm trying to learn some of the basics of social network analysis, just for kicks. I found an online textbook, and my beginning project has been to try and map out the connections between the people who play on my girlfriend's favorite MUSH. They maintain a wiki for it here.

So far, I have learned enough to construct a simple adjacency matrix and run some plots of it. I haven't had time to make them pretty, but here are a few samples of what I've done just to peek:

For the more technically inclined, I stripped out vertexes that didn't have at least one two-way connection to another vertex, just to keep the scale manageable. Looks worse with isolates included, and it's hard to zoom properly in the rgl window.

The end goal is to try and embed the 3d object in a pdf, but that appears to be dishearteningly complex with the tools at hand. I have created an R script to just peel the links out of any arbitrary html page, though, so that's something. I could maybe create the crayon version of a spidering/pagerank system, between the two elements. (I'm not sure if it's obvious there, but I scaled the node size by the number of edges connecting to it.)

Anyway, I hope to be back with more stuff soon. I've been writing, too, now that I'm free. :)