Blog Archives

Outlawing Gay Marriage

January 10, 2010
By

Given the recent votes on same-sex marriage in New Jersey and Portugal, I wanted to test a seemingly innocuous claim that touches upon very broad issues in political theory: does the degree of directness of a “democratic” vote predict whether the vote will promote or prohibit same-sex marriage? Naively, it seemed clear to me that

Read more »

Killing Yourself: An Addendum

January 9, 2010
By

In further support of the claim that a lot of deaths are partly self-induced, here’s a fascinating piece by Wired on the extraordinary rise in the percent of deaths among the young caused by their own poor decisions. It’s remarkable that, for the young, modern science has already made the world so safe that humanity,

Read more »

Announcing r-ORM: A Pure R Object-Relational Mapper

January 5, 2010
By

My apologies for the long break between posts. Before the end of this week I’ll return to my series of posts on image processing in R. In the intervening time, I’ve finished a piece of code that I’d like to officially release to the public. The code in question is a very minimal object-relational mapper

Read more »

Using Complex Numbers in R

December 18, 2009
By
Using Complex Numbers in R

This post is a continuation of my series dealing with matrix operations for image processing. My next goal is to demonstrate the construction of simple low-pass and high-pass spatial frequency filters in R. It’s easy enough to construct simple versions of these filters in R using the Fast Fourier Transform (also known as the FFT),

Read more »

Image Compression with the SVD in R

December 17, 2009
By
Image Compression with the SVD in R

Over the next few posts, I’m going to be reviewing the use of R to implement the most commonly used matrix techniques for image manipulation. The code will be surprisingly simple to understand, because the real magic behind these techniques lies in the mathematics that R provides an abstract interface to. To start, I’m going

Read more »

Quick Review of Matrix Algebra in R

December 16, 2009
By

Lately, I’ve been running a series of fMRI experiments on visual perception. In the interests of understanding the underlying properties of the images I’m using as stimuli, I’ve been trying to learn more about the matrix transformations commonly used for image compression and image manipulation. Thankfully, R provides simple-to-use implementations for all of the matrix

Read more »

Object-Oriented Programming in R: The Setter Methods

December 14, 2009
By

With a little guidance from the indefatigable Hadley Wickham, I figured out today how to implement the setter methods that were missing from my example user class. To review, let’s rebuild the getter methods for my user object: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

Read more »

The Most Basic Elements of Object-Oriented Programming in R

December 13, 2009
By

Until recently, I’ve never had any reason to learn how to define my own classes in R. Having learned this week, I was surprised to find out how easy it is to start implementing classes in R. If you know nothing about creating classes and class methods in R, here’s a very quick overview of

Read more »

A Lot of Deaths are Partly Self-Induced

December 11, 2009
By

I’m a little surprised by Andrew Gelman’s post today, doubting the wisdom of a passage from Gary Becker’s work that reads: According to the economic approach, therefore, most (if not all!) deaths are to some extent “suicides” in the sense that they could have been postponed if more resources had been invested in prolonging life.

Read more »

Times Series Methods versus Recurrence Relations

December 10, 2009
By

This term, I’ve been sitting in on Rene Carmona’s course on Modern Regression and Time Series Analysis. Much of the material on regression covered in the course was familiar to me already, but I’ve never felt that I had a real command of times series analysis methods. When Carmona defined the AR(p) model in class

Read more »