{ "metadata": { "name": "2.1-binary-variables" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "code", "collapsed": false, "input": [ "%pylab inline\n", "from IPython.display import display, Math, Latex\n", "maths = lambda s: display(Math(s))\n", "latex = lambda s: display(Latex(s))" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "\n", "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].\n", "For more information, type 'help(pylab)'.\n" ] } ], "prompt_number": 61 }, { "cell_type": "code", "collapsed": false, "input": [ "class Coin(object):\n", " \"\"\"\n", " A simple coin class, that we can toss to get heads or tails, \n", " it could be represented by a binary random variable x,\n", " where x=1 (heads) or x=0 (tails)\n", "\n", " Can have a biased coin, by changing mu, the probability x=1 (heads)\n", " \"\"\"\n", " def __init__(self, mu=0.5):\n", " self.mu = mu\n", " \n", " def toss(self, n=1):\n", " return int_(random_sample(size=n) < self.mu)\n", " \n", " def pmf(self, x):\n", " # p(x=0|mu) = (1-mu)\n", " # p(x=1|mu) = mu\n", " # ie, the Bernoulli distribution\n", " # which can be written as:\n", " return self.mu**x * (1-self.mu)**(1-x)\n", "\n", " " ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 62 }, { "cell_type": "code", "collapsed": false, "input": [ "# Toss a fair coin and a biased coin 1000 times\n", "faircoin = Coin(.5)\n", "biasedcoin = Coin(.6)\n", "\n", "nsamples = 1000\n", "\n", "ftosses = faircoin.toss(nsamples)\n", "btosses = biasedcoin.toss(nsamples)\n", "\n", "bheads = sum(btosses == 1)\n", "btails = sum(btosses == 0)\n", "\n", "fheads = sum(ftosses == 1)\n", "ftails = sum(ftosses == 0)\n", "\n", "\n", "print \"Fair Coin -- \",\"Heads:\", fheads, \"Tails:\", ftails\n", "print \"Biased Coin -- \",\"Heads:\", bheads, \"Tails:\", btails\n", "\n", "#print \"Tosses:\", btosses[:100],\"...\"\n", "\n", "b = bar([0,1,2,3],[fheads,ftails,bheads,btails], color=['r','b'], width=.5)\n", "\n", "b[0].set_label(\"Heads\")\n", "b[1].set_label(\"Tails\")\n", "gca().axes.xaxis.set_ticklabels([])\n", "xlabel(\"Fair Coin/Biased Coin\")\n", "legend()" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Fair Coin -- Heads: 493 Tails: 507\n", "Biased Coin -- Heads: 602 Tails: 398\n" ] }, { "output_type": "pyout", "prompt_number": 63, "text": [ "" ] }, { "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAXMAAAEDCAYAAADHmORTAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHnpJREFUeJzt3X1QVXXix/H34cE2FRVXuNqFX9cEw+sT+HC1B43SizuV\nhFqM6Na1B22zbWsfcs2tSXdbwbImtaHtgTXWbUMbJ2Ad10FN2mx3FvOhdpc20IWCy4MhouLDEHB+\nf6h3IRFQQeT4ec2cmcs533PO93s4fO7he7/3HMM0TRMREenW/Lq6AiIicukU5iIiFqAwFxGxAIW5\niIgFKMxFRCxAYS4iYgFthvmXX35JTEyMb+rbty+rV6+muroat9vN0KFDiYuLo6amxrdOcnIykZGR\nREVFkZOT06kNEBERMC5knHljYyN2u528vDzWrFnDgAEDWLRoEStWrODw4cOkpKSQn5/PnDlz2LVr\nF16vl6lTp1JQUICfn/4JEBHpLBeUsNu2bSMiIoLw8HCys7PxeDwAeDweMjMzAcjKyiIpKYnAwEAc\nDgcRERHk5eV1fM1FRMTngsI8IyODpKQkACorK7HZbADYbDYqKysBKCsrIywszLdOWFgYXq+3o+or\nIiItCGhvwbq6Ov785z+zYsWKc5YZhoFhGOdd97vLWisrIiLnd76e8XZfmf/lL39h7NixhISEAKev\nxisqKgAoLy8nNDQUALvdTklJiW+90tJS7HZ7ixXqrtPzzz/f5XVQ/bu+Hldb3VX/rp9a0+4wf++9\n93xdLADx8fGkp6cDkJ6eTkJCgm9+RkYGdXV1FB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S0uW7lyJcOGDSMmJgaXy9VmPebPn88XX3zRGdWUbqTDhybK\n1adnz57s3bu3XWU/+eSTc+bV19cTEND8VHzkkUcYMmQI+/fvB6C4uJj8/PwL3nZLtmzZwpNPPsnn\nn39OUlISq1evBmDu3LmsX7+eefPm8eijj7ZrWxfLMIwWv0n5u9/9ju3bt7Nr1y569+7NsWPH+OCD\nD1rd1ltvvdVZ1ZRuRFfm0uGOHz/O1KlTGTt2LKNGjSI7O9u3rHfv3gDk5uYyadIk7rnnHoYPH95s\n/QMHDpCXl8cLL7zgm+dwOLjzzjsBeOWVVxg5ciQjR45k1apVLW47NjaW++67j2HDhvHDH/7QV8Y0\nTfbt20dMTAymafq+jVxfX8/x48fp378/AEuXLuXll18GToely+UiOjqae++913f1/v777zNy5Eii\no6O57bbbgNN3DX366adxuVyMHj2aN99807ffH//4x0RFReF2uzl48GCL34ROTk7m9ddf97UlKCiI\nBx54AIDt27czZswYRo0axcMPP0xdXR0AsbGx7Nmzx3cMnn32WaKjo7nppps4ePBgu35nYgGmyCXy\n9/c3o6OjzejoaHPmzJlmfX29efToUdM0TfObb74xIyIifGV79+5tmqZp7tixw+zVq5dZXFx8zvay\nsrLMGTNmtLivTz/91Bw5cqR54sQJs7a21hw+fLi5b9++c7bdt29f0+v1mo2NjeZNN91k7ty50zRN\n09y9e7f5wAMPmKZpmmvXrjVDQkLM6Oho02azmZMnTzYbGhpM0zTNpUuXmitXrjRN0zQPHTrk2/+z\nzz5rrlmzxjRN0xw5cqRZVlZmmqZpHjlyxDRN03zjjTfMF154wTRN0zx16pQ5btw4s6ioyNy4caPp\ndrvNxsZGs6yszOzXr5+5cePGZm07cuSIGRwc3GK7T548aYaHh5uFhYWmaZrmAw88YL766qumaZpm\nbGysuXv3btM0TdMwDHPTpk2maZrmokWLfHUR69OVuVyya6+9lr1797J37142btxIY2MjzzzzDKNH\nj8btdlNWVtbiFaLL5eL6668/Z35rN3LauXMnM2fO5Nprr6VXr17MnDmTv/71ry1u+7rr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S0AAAAAElFTkSuQmCC\n" } ], "prompt_number": 63 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Consider $p(x_n|\\mu) = \\mu^{x_n}(1-\\mu)^{1-x_n}$ for each sample $x_n$ in our dataset D" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# Show first 50\n", "print biasedcoin.pmf(btosses)[:50]" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "[ 0.4 0.6 0.4 0.6 0.6 0.4 0.4 0.4 0.4 0.6 0.6 0.6 0.6 0.6 0.6\n", " 0.6 0.6 0.6 0.4 0.4 0.4 0.4 0.4 0.6 0.4 0.4 0.4 0.6 0.6 0.4\n", " 0.6 0.6 0.4 0.4 0.6 0.4 0.4 0.6 0.6 0.6 0.4 0.4 0.6 0.6 0.6\n", " 0.6 0.6 0.4 0.4 0.4]\n" ] } ], "prompt_number": 64 }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can find the *likelihood* of all these independent samples by multiplying\n", "\n", "$p(D|\\mu) = \\prod_{n=1}^{N} p(x_n|\\mu)$\n", "\n", "And taking the log to give the log likelihood, which is nicer numerically:\n", "\n", "$\\log(p(D|\\mu)) = \\sum_{n=1}^{N} \\log(p(x_n|\\mu))$" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# Add likelihood and loglikelihood to our coin class\n", "Coin.likelihood = lambda self, data: product(self.pmf(data))\n", "Coin.loglikelihood = lambda self, data: sum(log(self.pmf(data)))" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 65 }, { "cell_type": "code", "collapsed": false, "input": [ "print biasedcoin.likelihood(btosses)\n", "print biasedcoin.loglikelihood(btosses)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "1.16661962924e-292\n", "-672.200736793\n" ] } ], "prompt_number": 66 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now, in order to estimate $\\mu$ from our samples we want to maximise the log likelihood -- or minimise the negative log likelihood. " ] }, { "cell_type": "code", "collapsed": false, "input": [ "mus = arange(0,1,0.01)\n", "ll = zeros(mus.shape)\n", "\n", "for i,m in enumerate(mus):\n", " # \"create\" a coin for each mu and see how likely the tosses would be\n", " ll[i] = -Coin(m).loglikelihood(ftosses)\n", "plot(mus, ll, label=\"Fair Coin\")\n", "\n", "for i,m in enumerate(mus):\n", " ll[i] = -Coin(m).loglikelihood(btosses)\n", "plot(mus, ll, label=\"Biased Coin\")\n", " \n", "xlabel(\"$\\mu$\", size=22)\n", "ylabel(\"negative log likelihood\")\n", "legend()" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "pyout", "prompt_number": 67, "text": [ "" ] }, { "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAY8AAAEUCAYAAADTO7pnAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3Xl8TPf6wPHPSGJPIgtBgpBFZBGxKypKLGmlllarC1q0\nF1Wl997uv3Lbor1VrbZ0o3XVXrW0diUoGsRWgoQmZJOQBIkgy5zfH6cZQSKT5MxMluf9ep0XOXPm\nnGcOOc98d52iKApCCCFEKdSwdABCCCEqH0keQgghSk2ShxBCiFKT5CGEEKLUJHkIIYQoNUkeQggh\nSs1kyePmzZt06dKFdu3a4evryxtvvAFAeno6ISEheHt7069fP65cuWJ4z8yZM/Hy8sLHx4etW7ca\n9kdGRhIQEICXlxeTJ082VchCCCGMZLLkUbt2bXbu3MnRo0c5fvw4O3fu5Pfff2fWrFmEhIQQHR1N\nnz59mDVrFgBRUVGsWLGCqKgoNm/ezIQJEygYgjJ+/HgWLFhATEwMMTExbN682VRhCyGEMIJJq63q\n1q0LQE5ODvn5+Tg4OLB+/XpGjRoFwKhRo1i7di0A69atY8SIEdjY2ODu7o6npycREREkJyeTmZlJ\n586dARg5cqThPUIIISzDpMlDr9fTrl07XFxc6N27N35+fqSkpODi4gKAi4sLKSkpACQlJeHm5mZ4\nr5ubG4mJiffsd3V1JTE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6hSlilb+CiGEMJlK1dtKCCFExSDJQwghRKlJ8hBCCFFqkjyEEEKUmiQPIYQQ\npSbJQwghRKlJ8hDCBFJSUmjRogUbN268Y39mZiY+Pj6sWbPGQpEJoQ1JHkKYwK+//kp8fLxhKeUC\n27dvJzo6uspOFSOqD0keQpjAjh07sLOzo0OHDnfs37VrFzVr1qRbt24WikwIbUjyEMIEdu7cSc+e\nPe+ZmTQ8PJxOnTpRq1YtC0UmhDYkeQihsVOnTnHx4kWCg4Pv2J+RkcGJEyd48MEHLROYEBqS5CGE\nxnbs2AFwT/LYs2cPer1ekoeoEiR5CKGxHTt2YGVlRWBg4B37w8PDsbKyonv37ly9epUffvjBMgEK\noQFJHkJoSFEUdu3aRcP/b+/uUSOEwigMn1axndbKzmWIVroDCxF7XZvuQDutXIXDMExjI4iQIiSQ\n8maUm8D7rOB0L/7Ad7v9uIW9bZvatlUYhvI8T33fy3Vdi0uB9xAP4ETzPOv1eun5fGpZFkmfZ1/r\nupbned+/7nZdpyzLbE4F3vKvjkEBf93X946qqpTnuYIg0L7vappGdV2rLEsVRaEoiuQ4juW1wO9x\nDAo4UZqmGsdRj8fD9hTgUry2Ak5yHIeGYVAcx7anAJcjHsBJpmnSuq5KksT2FOByxAM4yf1+l+/7\nStPU9hTgcnzzAAAY48kDAGCMeAAAjBEPAIAx4gEAMEY8AADGiAcAwBjxAAAYIx4AAGMfx+sBYVdn\nda0AAAAASUVORK5CYII=\n" } ], "prompt_number": 67 }, { "cell_type": "markdown", "metadata": {}, "source": [ "From the graph it looks like the minimum $\\mu$ is close to the true one of the coin. And differentiating shows the maximum likelihood estimator is\n", "\n", "$\\mu_{ML} = \\frac{1}{N} \\sum_{n=1}^{N}x_n$\n", "\n", "i.e. the sample mean (which you probably knew already)" ] }, { "cell_type": "code", "collapsed": false, "input": [ "muf = sum(ftosses)/float(nsamples)\n", "mub = sum(btosses)/float(nsamples)\n", "\n", "latex(\"Fair Coin: $\\mu_{ML} = %s$\" % muf)\n", "latex(\"Biased Coin: $\\mu_{ML} = %s$\" % mub)" ], "language": "python", "metadata": {}, "outputs": [ { "latex": [ "Fair Coin: $\\mu_{ML} = 0.493$" ], "output_type": "display_data", "text": [ "" ] }, { "latex": [ "Biased Coin: $\\mu_{ML} = 0.602$" ], "output_type": "display_data", "text": [ "" ] } ], "prompt_number": 68 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now what if we want to estimate the *number* of heads? Call it $k$.\n", "\n", "For example, if we toss our biased coin 5 times, the probability of getting 3 heads *then* 2 tails is:\n", "\n", "$p(x_1=1)p(x_2=1)p(x_3=1)p(x_4=0)p(x_5=0) = 0.6 \\times 0.6 \\times 0.6 \\times 0.4 \\times 0.4$\n", "\n", "or $\\mu^k(1-\\mu)^{N-k}$\n", "\n", "But this is just one way to get 3 heads, there are many other sequences of 5 trials that would give us 3 heads. How many exactly? This is given by the [Binomial coefficient](https://en.wikipedia.org/wiki/Binomial_coefficient):" ] }, { "cell_type": "code", "collapsed": false, "input": [ "@vectorize\n", "def C(N,k):\n", " return math.factorial(N)/(math.factorial(N-k)*math.factorial(k))" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 69 }, { "cell_type": "code", "collapsed": false, "input": [ "Ntoss = 5\n", "for k in range(Ntoss+1):\n", " c = C(Ntoss,k)\n", " s = lambda n: \"s\" if (n-1) else \"\"\n", " print \"There\", \"are\" if (c-1) else \"is\", c,\"way\"+s(c), \"of getting\", k, \"head\"+s(k)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "There is 1 way of getting 0 heads\n", "There are 5 ways of getting 1 head\n", "There are 10 ways of getting 2 heads\n", "There are 10 ways of getting 3 heads\n", "There are 5 ways of getting 4 heads\n", "There is 1 way of getting 5 heads\n" ] } ], "prompt_number": 70 }, { "cell_type": "markdown", "metadata": {}, "source": [ "This leads us to the Binomial distribution\n", "\n", "$Bin(k|N,\\mu) = C(N,k)\\times\\mu^k(1-\\mu)^{N-k}$\n", "\n", "With mean $N\\mu$\n", "\n", "We can sample a Binomial distribution by tossing a coin N times and seeing how many heads we get. And if we repeat this step many times we can draw a histogram of how many times we get each number of heads." ] }, { "cell_type": "code", "collapsed": false, "input": [ "results = []\n", "\n", "N_binom = 5\n", "mu_binom = 0.6\n", "Ntrials = 1000\n", "\n", "for x in range(Ntrials):\n", " nheads = sum(Coin(mu_binom).toss(N_binom))\n", " results.append(nheads)\n", " \n", "hist(results, bins=range(N_binom+2), rwidth=.8, align='left')\n", "\n", "xlabel(\"k (number of heads)\")" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "pyout", "prompt_number": 80, "text": [ "" ] }, { "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAXUAAAEMCAYAAAA70CbBAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHeJJREFUeJzt3X9QlHUeB/D3g9A5JCpesji75noCwvJrVzmgKbo1QfNU\nBrUorNwU606vbjybqXPm6qBphK76w+y8a26scPpB6iVYlx5ed5tm460pnHdDBhkkLAvGIaIiLbDf\n+8NrE/m1C7s+7Jf3a4aZ9dnn+3w/C/jeZ798n++jCCEEiIhICkFqF0BERL7DUCcikghDnYhIIgx1\nIiKJMNSJiCTCUCciksiQod7V1YW0tDQYjUYYDAZs2bIFAFBQUACdTgeTyQSTyYQDBw642xQVFSE6\nOhqxsbGoqKjwb/VERNSHMtw89c7OToSGhqKnpwd33HEHXnzxRXz00UcICwvD5s2b++xbXV2N1atX\n4/jx47Db7cjMzERNTQ2CgviBgIjoRhg2bUNDQwEATqcTvb29CA8PBwAM9F5QXl6OvLw8hISEQK/X\nIyoqCjabzcclExHRYIYNdZfLBaPRCI1GgwULFiA+Ph4AsH37diQnJyM/Px/t7e0AgKamJuh0Ondb\nnU4Hu93up9KJiOh6wcPtEBQUhKqqKly4cAGLFy+G1WrFhg0b8MwzzwAAnn76aTzxxBPYuXPngO0V\nRfFoGxERDW+4lV08HuyeMmUKli5dis8++wwR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KkarMVXywAAAABJRU5ErkJggg==\n" } ], "prompt_number": 80 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Compare with the actual distribution:" ] }, { "cell_type": "code", "collapsed": false, "input": [ "ks = arange(0,N_binom+1,1)\n", "\n", "def binomialpmf(k,N,mu):\n", " return C(N, k) * mu**k * (1-mu)**(N-k)\n", "\n", "bar(ks, binomialpmf(ks, N_binom, mu_binom), align='center')\n", "xlabel(\"k\")" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "pyout", "prompt_number": 81, "text": [ "" ] }, { "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAXgAAAEKCAYAAAAYd05sAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAF6lJREFUeJzt3X9M1Pfhx/HXKbc0FX9hqaV3l97Wo97ZAdIeEteQ3DqR\naO0FaJPhXNt0jBEX02zZP9v+GfSPpWTxD1f2B2lsM2NjWdJVXKeEknrR0cFl6mITp8VO5kGlda1O\nhC7I7fP9w/a+RfRzd3pw3NvnIyHhw+f9vs/r8MPLDx8+nzuHZVmWAADGWZDtAACA2UHBA4ChKHgA\nMBQFDwCGouABwFAUPAAYKmnBd3d3y+/3q7i4WG1tbTPWd3V1qaysTOXl5Xr00Uf17rvvJtZ5vV6V\nlpaqvLxca9euzWxyAIAth9118PF4XKtWrVJvb69cLpcqKiq0d+9eBQKBxJjx8XEtWrRIkvT++++r\nrq5OZ86ckSR9/etf19GjR1VQUDDLTwMAcD3bI/hoNCqfzyev1yun06mGhgZ1dXVNG/NluUvSlStX\ndM8990xbz31UAJAdtgU/MjIij8eTWHa73RoZGZkxbt++fQoEAtq4caN++9vfJr7ucDi0fv16BYNB\nvfLKKxmMDQBIJs9upcPhSOlBamtrVVtbqyNHjuiZZ57R6dOnJUl9fX0qKirShQsXVF1dLb/fr6qq\nqlvaBgBgumRnSGyP4F0ul2KxWGI5FovJ7XbfdHxVVZWmpqb06aefSpKKiookSYWFhaqrq1M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RU5ErkJggg==\n" } ], "prompt_number": 81 }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 72 } ], "metadata": {} } ] }