{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "#### A Recursive Formulation of Repeated Games\n", "\n", "**Authors**: Chase Coleman with Thomas Sargent\n", "\n", "This notebook describes Julia code that implements an algorithm for computing equilibrium values and associated equilibrium strategy profiles for repeated games with $N$ players and finite actions.\n", "\n", "The code builds on ideas of Abreu, Pearce, Stachetti (1986, 1990).\n", "\n", "It uses a numerical algorithm called the _outer hyperplane approximation algorithm_ invented by Judd, Yeltekin, Conklin (2003).\n", "\n", "We focus on a particularly simple example, namely, a repeated prisoner's dilemma.\n", "\n", "Our friends Timothy Hills and Ben Tengelsen provided useful comments about detailed aspects of the algorithm.\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Technical Julia Advisory\n", "\n", "The quant-econ Games library is currently under development and not yet a published Julia package\n", "\n", "To get it, please run\n", "\n", " Pkg.clone(\"https://github.com/QuantEcon/Games.jl.git\"). \n", " \n", "This command may also install some additional packages such as Clp, MathProgBase, QuantEcon, Polyhedra, and CDDLib (and whatever dependencies these packages rely on).\n", "\n", "Plotting in this notebook uses the package PlotlyJS.\n", "\n", "A cautionary note: occasionally (but not always) users of this notebook have experienced difficulty installing CDDLib and Polyhedra (sometimes due to no fault of their own).\n", "\n", "This, the first version of this notebook, uses the following versions of various packages:\n", "\n", "* CDDLib -> v0.1.2\n", "* Games -> v0.0.1\n", "* Polyhedra -> v0.1.3\n", "* PlotlyJS -> v0.5.2\n", "\n", "Please verify that you have the correct versions of these packages [1, 2]. \n", "\n", "We have found that occasionally users have struggled to get CDDLib to build. \n", "\n", "If this happens to you, make sure that you have [libgmp](https://gmplib.org/) installed.[3] After it has been installed, please run Pkg.build(\"CDDLib\").\n", "\n", "If you encounter problems beyond these, please raise an issue about them in the package's repository or in the [QuantEcon.notebooks repository](https://github.com/QuantEcon/QuantEcon.notebooks).\n", "\n", "[1] You can do this by creating a dictionary d = Pkg.installed() and then looking at version associated with d[\"PackageName\"]\n", "\n", "[2] You can specify that you'd like to download a particular version of a package with Pkg.add(\"PackageName\", v\"x.y.z\") where x.y.z refers to the version number (Note that the v is before the quotations on purpose).\n", "\n", "[3] On an Ubuntu machine, you can do this with sudo apt-get install libgmp-dev\n" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "