Speeding up the Bradley Terry Model in R


I am currently developing my first R package which confronted me a lot with the question: “How can I speed up my code?”.

I did some “research” and read a lot of general articles about speeding up code, but also a few posts specifically about speeding up R code. While I mostly got the main points, I always found the example use cases slightly contrived. So I decided to write a little something about one of my use cases which includes many points that I think are important when trying to speed up your code. The method we want to implement in this post is the so called Bradley Terry Model. If you do not care about the theoretical part, you can jump directly to the implementation section.

Continue reading

The Myth of Club 27

The term club 27 refers to the observed phenomenon that famous musicians die at a higher rate at the age of 27. Jimi Hendrix, Janis Joplin, Kurt Cobain and Amy Winehouse to name just a few, are members of this questionable club. The media is going wild whenever a new famous person enters this mysterious club. But is there a (statistical) truth behind this? Do musicians really die at a higher rate at the age of 27?

Continue reading

VIP RIP: The high number of dead celebrities in 2016

Many people would agree that 2016 was a bad year. Especially the VIP death toll seems extraordinary high this year.
With the recent deaths of British singer George Michael and Princess Leia, Carrie Fisher, the year even seems to go with a blast. With data on celebrity death tolls, I want to test if the death rate really was higher, or if we just perceived it as such.

The data for this posts comes from Wikipedia’s lists of deaths by year. The structure of the monthly lists are equal starting 2004, so that I wrote a simple scraping function in R with the rvest package. The code is attached at the end of this post.

Continue reading

Angelique Kerber, No. 1 in women’s tennis…since weeks!

This Monday September 12th will be a historic day for German female tennis. Angelique Kerber will be the first German player since Steffi Graf in 1996 who is ranked number one in the WTA ranking.

Winning the Australian Open in the beginning of this year, reaching the final of Wimbledon and then winning the US Open,  one could definitely say that she finally deserves it.  I would even go a step further and say it is overdue for a few weeks! To “prove” this claim, I grabbed all WTA matches since 1968 (yeah, I know Angelique wasn’t even alive then) until 29 August 2016 from here and here and built my own women’s tennis ranking with the power of Google’s PageRank.

Continue reading

Gotta rank’em all:
What is the best Pokémon?

Pokémon Go has made the whole world gone wild on the hunt for those cute little creatures. After catching hundreds of Weedles, Rattatas and Pidgeys, I got a bit tired and thought it is time to do some Pokémon science.

Naturally, the whole Pokémon hype has already led to several interesting analyses with available data mainly from the awesome PokeAPI. For instance, this blog post about a cluster analysis of the original 151 Pokémon or this extended analysis of all 721 available Pokémon.

Since clustering is boring, I will do something more exciting and try to rank Pokemon according to their strength with a little bit of help from my own research.

Continue reading

Page 1 of 5 >