Prius Spotting II: Rise of the Conjugates (Rated R)

EDIT: I previously showed a formula for getting the updated value of in a gamma distribution using conjugacy. After some poking around, I’ve changed the formula to match what is on the Wikipedia page (linked below). Seems to be working.

Read More

What can we learn from spotting a Prius or two?

If you live in a wealthy, liberal town like Boulder, CO, you’ve likely seen your fair share of Toyota Prii (this is supposedly the plural of Prius). Heck, you might even own one. I decided to collect a little data. I used my iPhone stopwatch to record wait times between seeing Prii. I walked at a near-constant speed, along a more or less linear transect along 13th Street, from Arapahoe to Spruce. I recorded for 10 minutes, hitting the “lap” button each time I saw a Prius (any year, parked or driving). There is some risk of counting one vehicle multiple times, but because I walked in one direction and only recorded for 10 minutes, I assume the risk is relatively low (unless Prius owners love driving so much, they just go out and do laps around city blocks – quite possible).

Read More

omg python in rmd

Learning data analysis in Python seems to be an important skill. Speed and scalability are the obvious reasons. Python has a reputation for being the Machine Learning go-to language, despite the fact that (as far as I can tell) some of the real giants in the field create packages and run their analysis in R (awesome mooc, btw). Despite my deep and passionate love for R, I’m all about programming bandwagons, and I’ve learned some Python already, so what the heck.

Read More

Another one of those blog posts about the apply function

The most excellent Hadley Wickham has a great presentation about functional programming where he compares the redundancies in cupcake recipes to the construction of for loops. The goal of the presentation is to promote his new package purrr, which provides a more comprehensive set of functional programming tools for R, and to show audience members the ease and power of a functional programming approach. I found the analogy and overall point very persuasive, so much so, I changed my twitter bio to include the phrase, “recovering for loop addict”. I’m no stranger to using the apply family, but I never considered it my go-to approach, especially if the task was complex. But the cupcakes put me over the edge, and I decided to take the plunge as much as I could.

Read More

Additive alleles addendum

I’ve made some realizations since posting that last one, but many personal mysteries persist. Time to hit the books. I apologize for the layout of text and figures on this post. It’s a little hard to track and differentiate between paragraphs and captions. Have fun. Enjoy^2!

Read More

Additive alleles and drift Part I, or how to be a bad TA.

July and August have been rather busy months for me. On July 14th, my wife and I had a baby. His name is Felix. He’s awesome. In the science world, I’ve been revising two papers I’m a co-author on, both to do with drought adaptation in Brassia rapa populations in California. I’m glad I’ve finally gotten around to writing another blog post. This one is about additive alleles. I learned a lot writing this post. I hope others get something out of it too. If nothing else, how NOT to do something. Enjoy!

Read More

How to build a deck of caRds.

I have been working on a second blog post for a while. It concerns a simple simulation of a quantitative trait controlled by many independent additive alleles. It’s really cool! I fear I’m taking too long to write it (“seriously though, does this guy even do research?”), so I wanted to write a different and much more brief posting. So here it is!

Read More

Don't hyde from jekyll.

Wow. Getting started with jekyll takes some front work, but I’m pretty excited to start this adventure into blogging like a hacker. Huge thanks to Barry Clark (and friends?) for making the jekyll-now git hub repository! I would still be stuck at square one without that repo.

Read More