Gotcha! I mean “simulating” in the title, not “stimulating.” This one’s about programming.
I’m interested, for various reasons, in how evolution might bring about change over time. Recall from my Evolution Overview that evolutionary changes could occur by drift or natural selection. Drift means random change, because a given polymorphism has no effect on fitness. Natural selection, on the other hand, is what my advisor likes to call the 900-lb gorilla: it does whatever the eff it wants. Selection can take existing variation in a population and mold it into all kinds of oddities. Within Primates, natural selection has fashioned inquisitive apes that walk on two legs and go to the moon, and sexual selection has festooned male mandrills in variegated visage (right). Selection can be gentle and allow gradual change (what I like to call sensual selection), or it could be strong and cause rapid change.
Selection can seem random for various reasons (e.g. why is it acting as intensely as it does when it does?), so it is hard to tell whether a given evolutionary scenario can be explained by selection for a given behavior, or if it reflects totally random change (drift).
Monte Carlo statistical methods allow one to simulate a given scenario, to test competing hypotheses. A simple null hypothesis that can be simulated is drift – change is completely random in direction, and if I reject this hypothesis I could argue that an alternative explanation (selection) is appropriate

The random walk is the oft-used analogy for this null hypothesis of random change. Now, if I’d ever been so imperfect as to have succumbed to the siren-song of spirits, maybe I’d corroborate the analogy. But using the extent of your limited but unadulterated imagination, pretend there is a drunk kid who happened to go to Loyola Chicago (like myself), and who walks onto the L platform (like I often did; left, looking north from the Lawrence Red Line stop). As booze takes the reins, he stumbles randomly between the edges of the train platform. This random walk down the train platform could result in the drunkard making it safely to the end, or he could fall off either side to a gruesome doom awaiting on the tracks below.
Thinking about limb proportions, and how to program this hypothesis/scenario, I stumbled upon the useful cumsum() function for the R statistical program. This function allows me to indicate how much change to occur for how many steps (i.e. generations), thus effectively simulating the random walk. For example (right), say I want to ask if the tibia (shin bone) gets long relative to the femur (thigh bone) in human evolution, because of drift vs. natural selection. I start with a given proportion of [tibia/femur] and simulate change in a random direction in tibia and femur length, over a quarter million years (or 18,000 15-year generations).
The figure is a bird’s eye view of a random walk: at each generation the drunken tibia/femur ratio steps forward (to the right in the picture) and randomly right or left (toward the top or bottom of the picture). This took literally 2 seconds to program and graph. The dashed black line represents the relative tibia/femur relationship at the beginning of the evolutionary sequence, and the red line is the ratio 250,000 years (18,000 generations) later. Note that in this particular random scenario, not only is the final tibia/femur ratio exactly that observed, but that over the time span this ratio was reached about 20 different times. Do this randomization 500 or more times to see how often random change will result in the observed difference between time periods. Assuming the simulations realistically model reality, the observed change in limb proportions could easily be explained by drift (i.e. climate or efficiency adaptations did not have so strong a selective advantage as to be detected by this test). That is, the change in proportions could have been effected by random change or by weak directional selection.
I’m currently looking for any ways to make the model more realistic, for example:
- how much evolution (e.g. change) could occur per generation. Currently, each generation changes by plus or minus a given maximum. I would like to be able to simulate any amount of change between zero and an a priori maximum.
- it’s easier to let the tibia and femur change randomly with respect to one another. However, this is unrealistic because the thigh and leg are serially homologous, their variation is not independent of one another. I would like to model each element’s change per generation to reflect this covariance.
Anyway, I’ve only begun looking into the topic of how to analyze evolutionary change, but it looks like testing evolutionary hypotheses might not be impossible?