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 Lord of the Rings: The Three Networks

This post is inspired by the star wars social network.

I created the interaction networks of Lord of the Rings characters for all three movies based on the scripts I found online.  The networks capture the story line of all movies surprisingly well and might be a nice gimmick for all Lord of the Rings enthusiasts. Code and network files can be found on github.

I also created interactive versions of the networks where you can drag, click and hover and generally play around a bit. The links to the those versions are below the respective plots.

For those who are interested in technical details of the data extraction and analysis, head down to the Making of section. But let’s start with some visualizations of the networks for the three movies.

Continue reading