Posts

  • A linear algebraic implementation of support enumeration for the computation of equilibria using numpy

    Gambit is the leading piece of software for computing Nash equilibria of strategic games. A numpy of algorithms are implemented that take advantage of the higher dimensional geometry relating to the theory of games. In this post I will describe an approach for finding Nash equilibria (of 2 player games) that reduces to solving two simple Matrix equations. This can be implemented in Python using just numpy (and is already implemented in sagemath), I will also introduce (briefly) a library that does just that.

    ...

  • Anscombe's quartert, variability and studying queues with Python

    Anscombe’s quartet is a great example of the importance of fully understanding variability in a data set: it is a set of 4 data sets with the same summary measures (mean, std, etc…), the same correlation and the same regression line but with very different distributions. In this post I’ll show how easy it is to play with Anscombe’s quartet using Python and then talk about another mathematical area where variability must be fully understood: the study of queues. I’ll do this with the Ciw python library.

    ...

  • A make file to convert all Jupyter notebooks in a directory to pdfs

    I’m going to be using Jupyter notebooks for the first time in a course I’m teaching (previously I have been using Sage notebooks and python scripting). I’d like to be able to share my notebooks with tutors and eventually students as both notebook but also pdfs. Thankfully the jupyter-nbconverte command lets you easily convert notebooks to more or less whatever you want. Below is a make file that will automatically check if any notebook files have changed and if they have convert them to pdf.

    ...

  • Profiling and reducing memory consumption in Python

    I am one of the core developers of the Axelrod-Python project. This Python library lets you carry out Iterated Prisoner’s dilemma tournaments. One of the great success of the library is the number of strategies it contains, at present (thanks to many awesome contributions) it has 139 strategies (149 if you count the cheaters). This is great but also created a bit of a challenge. Running full tournaments became quite expensive computationally. This is now fixed, thanks mainly to writing and reading to/from disk instead of using memory. This post will describe some tools and techniques that can be used to do this.

    ...

  • Analysis of variance with different sized samples in Python

    Working with Nikoleta we recently needed to carry out an Analysis of Variance (ANOVA) on a data set where the sample size of each category is not constant. This blog post shows very briefly how to carry this out in Python (when using Pandas).

    ...