# Articles by ALT

### S&P 500 Returns

September 1, 2011 |

I'll begin with a familiar image:That plot shows the closing values of the S&P 500 index from 1990 until today. It's a useful representation -- at a glance, you can tell when the market rose and fell. That said, it does have some problems: we're...

### A Bayesian Guessing Game

August 3, 2011 |

You, the player, must think of some set, eg "odd numbers" or "perfect squares," and that'll be your little secret. Now think of some numbers that live in the intersection of your set and the integers {1, 2, ... , 100} -- for example, if you've chosen ...

### A Currency Graph

July 27, 2011 |

Here's a graph in which nodes (and edges) represent currencies (and exchange rates):library(igraph)currencies

### A Plot of 250 Random Walks

July 22, 2011 |

For some reason I feel like plotting some random walks. Nothing groundbreaking, but hopefully this post will be useful to someone. Here's my R code:# Generate k random walks across time {0, 1, ... , T}T

### Men with Hats

July 6, 2011 |

Suppose N people (and their hats) attend a party (in the 1950s). For fun, the guests mix their hats in a pile at the center of the room, and each person picks a hat uniformly at random. What is the probability that nobody ends up with their own hat?E...

### Kernel Density Estimates & Truncated Normals

June 24, 2011 |

Earlier today I read a post about truncated normals, and one plot in particular jumped out at me:By definition, the truncated normal should have zero density everywhere to the left of the truncation point, but that's not what we see in the plot. What'...

### A Little Sampling Puzzle

June 18, 2011 |

Suppose you have 10 objects from which you take a sample of size 20 (with replacement, or you're in trouble). What's the probability that each object was chosen at least once? Getting an answer via simulation is pleasantly easy:f

### Dependence and Correlation

June 13, 2011 |

In everyday life I hear the word "correlation" thrown around far more often than "dependence." What's the difference? Correlation, in its most common form, is a measure of linear dependence; the catch is that not all dependencies are linear. The set...

### On Crows

June 12, 2011 |

Today I made the mistake of clicking on the "Next Blog" button, which took me to a rather inane post complaining that crows are (obviously) stupid (because they are sometimes hit by cars). I was reminded that crows are actually quite smart.

### A Little R Counter

June 11, 2011 |

I recently read a great post about environments in R, which featured this little bit of code:__ createCounter

### Schelling’s Neighborhood Model

April 30, 2011 |

The New York Times has created a beautiful visualization of the Census Bureau's 2005-2009 American Community Survey data. The distribution of racial and ethnic groups in New York City is particularly fascinating:Chinatown appears in red toward the sou...

### A Tiny Model of Evolution

April 25, 2011 |

I've always wanted to write a(n overly) simple model of evolution. The assumptions are minimalistic: only one species, for which each individual's genotype is represented as a one-dimensional real number, e.g. 7.4. Now, the fun stuff: I define a fu...

### Of Height and Speed in Tennis, or Fuzziness and Techiness in College

April 24, 2011 |

I thought of this after reading this post and perhaps also this one, one the Cheap Talk blog. Here's the puzzle: in general, being tall does not make you slow; but among professional tennis players, the tall athletes do tend to be relativel...

### Logistic Regression & Factors in R

April 24, 2011 |

Factors are R's enumerated type. Suppose you define the variable cities -- a vector of strings -- whose possible values are "New York," "Paris," "London" and "Beijing." Instead of representing each city as a string of characters, you might prefer to ...

### Flu Trends

April 18, 2011 |

Not a model, but certainly Mickey Mousey: here’s some R code that plots Google’s US flu data:df