Articles by ALT

S&P 500 Returns

September 1, 2011 | ALT

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...
[Read more...]

A Bayesian Guessing Game

August 3, 2011 | ALT

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 ...
[Read more...]

A Plot of 250 Random Walks

July 22, 2011 | ALT

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
[Read more...]

Men with Hats

July 6, 2011 | ALT

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...
[Read more...]

Kernel Density Estimates & Truncated Normals

June 24, 2011 | ALT

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'...
[Read more...]

A Little Sampling Puzzle

June 18, 2011 | ALT

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
[Read more...]

Dependence and Correlation

June 13, 2011 | ALT

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...
[Read more...]

On Crows

June 12, 2011 | ALT

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.
[Read more...]

Schelling’s Neighborhood Model

April 30, 2011 | ALT

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...
[Read more...]

A Tiny Model of Evolution

April 25, 2011 | ALT

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...
[Read more...]

Logistic Regression & Factors in R

April 24, 2011 | ALT

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 ...
[Read more...]

Flu Trends

April 18, 2011 | ALT

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

Mickey Mouse Models

April 18, 2011 | ALT

My statistics professor once drew a little Markov chain on the board and called it “just a Mickey Mouse model,” because it was too simple to represent anything serious.
[Read more...]

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)