Articles by Matt Asher

Zone of instability

May 26, 2010 | Matt Asher

I woke up from my afternoon nap feeling a bit off-kilter, so I decided to go for another random walk. In particular, I wanted a journey that avoided the center, but didn’t just run for an exit either. After playing around for a while I came up with this: # ... [Read more...]

How many tanks? MC testing the GTP

May 25, 2010 | Matt Asher

It’s 1943 and you work for the good guys. A handful of German tanks have been captured, and each one has a serial number. This is back when serial numbers were still presumed to come in serial, one right after the other. Given your collection of numbered tanks, and assuming ... [Read more...]

R: A random walk though OOP land.

May 20, 2010 | Matt Asher

If you are used to object oriented programing in a different language, the way R does things can seem a little strange and backwards. “proto” to the rescue. With this library you can simulate “normal” OOP. I found the examples for proto not so helpful, so to figure out how ... [Read more...]

R: Dueling normals

May 18, 2010 | Matt Asher

More playing around with R. To create the graph above, I sampled 100 times from two different normal distributions, then plotted the ratio of times that the first distribution beat the second one on the y-axis. The second distribution always had a mean of 0, the mean of first distribution went from 0 ... [Read more...]

Connecting R and Python

May 7, 2010 | Matt Asher

There are a few ways to do this, but the only one that worked for me was to use Rserve and rconnect. In R, do this: 1 2 3 install.packages("Rserve") library(Rserve) Rserve(debug = FALSE, port=6311, args=NULL) Then you can connect in Python very easily. Here is a test in ... [Read more...]

Game of Life in R

May 5, 2010 | Matt Asher

Before I decided to learn R in a serious way, I thought about learning Flash/Actionscript instead. Most of my work involves evolutionary models that take place over time. I need visual representations of change. It’s certainly possible to represent change and tell an evolving story with a single ... [Read more...]

First annual R plot replication prize

May 3, 2010 | Matt Asher

$100 to the first person who can figure out how I created this plot and replicate it. Some hints: It was done in R. There is only one underlying probability distribution involved (one “rdist()“). Including the “plot” statement, I created this with 3 short lines of code. This is based on a ... [Read more...]

How many girls, how many boys?

April 30, 2010 | Matt Asher

I found this interesting question over here at mathoverflow.net. Here’s the question: If you have a country where every family will continue to have children until they get a boy, then they will stop. What is the proportion of boys to girls in the country. First off, there ...
[Read more...]
1 2 3

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)