{
 "metadata": {
  "name": "",
  "signature": "sha256:ed27079cf7cc6b818d3cd0af27d1a7dafbe17aa5469f61f0a49355a3d1a14ae1"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "[Table of Contents](http://nbviewer.ipython.org/github/rlabbe/Kalman-and-Bayesian-Filters-in-Python/blob/master/table_of_contents.ipynb)"
     ]
    },
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Discrete Bayes Filter"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#format the book\n",
      "%matplotlib inline\n",
      "from __future__ import division, print_function\n",
      "import matplotlib.pyplot as plt\n",
      "import book_format\n",
      "book_format.load_style()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<style>\n",
        "@import url('http://fonts.googleapis.com/css?family=Source+Code+Pro');\n",
        "@import url('http://fonts.googleapis.com/css?family=Vollkorn');\n",
        "@import url('http://fonts.googleapis.com/css?family=Arimo');\n",
        "\n",
        "    div.cell{\n",
        "        width: 850px;\n",
        "        margin-left: 0% !important;\n",
        "        margin-right: auto;\n",
        "    }\n",
        "    div.text_cell code {\n",
        "        background: transparent;\n",
        "        color: #000000;\n",
        "        font-weight: 600;\n",
        "        font-size: 11pt;\n",
        "        font-style: bold;\n",
        "        font-family:  'Source Code Pro', Consolas, monocco, monospace;\n",
        "   }\n",
        "    h1 {\n",
        "        font-family: 'Open sans',verdana,arial,sans-serif;\n",
        "\t}\n",
        "\t\n",
        "    div.input_area {\n",
        "        background: #F6F6F9;\n",
        "        border: 1px solid #586e75;\n",
        "    }\n",
        "\n",
        "    .text_cell_render h1 {\n",
        "        font-weight: 200;\n",
        "        font-size: 30pt;\n",
        "        line-height: 100%;\n",
        "        color:#c76c0c;\n",
        "        margin-bottom: 0.5em;\n",
        "        margin-top: 1em;\n",
        "        display: block;\n",
        "        white-space: wrap;\n",
        "    } \n",
        "    h2 {\n",
        "        font-family: 'Open sans',verdana,arial,sans-serif;\n",
        "    }\n",
        "    .text_cell_render h2 {\n",
        "        font-weight: 200;\n",
        "        font-size: 20pt;\n",
        "        font-style: italic;\n",
        "        line-height: 100%;\n",
        "        color:#c76c0c;\n",
        "        margin-bottom: 0.5em;\n",
        "        margin-top: 1.5em;\n",
        "        display: block;\n",
        "        white-space: nowrap;\n",
        "    } \n",
        "    h3 {\n",
        "        font-family: 'Open sans',verdana,arial,sans-serif;\n",
        "    }\n",
        "    .text_cell_render h3 {\n",
        "        font-weight: 300;\n",
        "        font-size: 18pt;\n",
        "        line-height: 100%;\n",
        "        color:#d77c0c;\n",
        "        margin-bottom: 0.5em;\n",
        "        margin-top: 2em;\n",
        "        display: block;\n",
        "        white-space: nowrap;\n",
        "    }\n",
        "    h4 {\n",
        "        font-family: 'Open sans',verdana,arial,sans-serif;\n",
        "    }\n",
        "    .text_cell_render h4 {\n",
        "        font-weight: 300;\n",
        "        font-size: 16pt;\n",
        "        color:#d77c0c;\n",
        "        margin-bottom: 0.5em;\n",
        "        margin-top: 0.5em;\n",
        "        display: block;\n",
        "        white-space: nowrap;\n",
        "    }\n",
        "    h5 {\n",
        "        font-family: 'Open sans',verdana,arial,sans-serif;\n",
        "    }\n",
        "    .text_cell_render h5 {\n",
        "        font-weight: 300;\n",
        "        font-style: normal;\n",
        "        color: #1d3b84;\n",
        "        font-size: 16pt;\n",
        "        margin-bottom: 0em;\n",
        "        margin-top: 1.5em;\n",
        "        display: block;\n",
        "        white-space: nowrap;\n",
        "    }\n",
        "    div.text_cell_render{\n",
        "        font-family: 'Arimo',verdana,arial,sans-serif;\n",
        "        line-height: 135%;\n",
        "        font-size: 125%;\n",
        "        width:750px;\n",
        "        margin-left:auto;\n",
        "        margin-right:auto;\n",
        "        text-align:justify;\n",
        "        text-justify:inter-word;\n",
        "    }\n",
        "    div.output_subarea.output_text.output_pyout {\n",
        "        overflow-x: auto;\n",
        "        overflow-y: scroll;\n",
        "        max-height: 50000px;\n",
        "    }\n",
        "    div.output_subarea.output_stream.output_stdout.output_text {\n",
        "        overflow-x: auto;\n",
        "        overflow-y: scroll;\n",
        "        max-height: 50000px;\n",
        "    }\n",
        "    code{\n",
        "      font-size: 70%;\n",
        "    }\n",
        "    .rendered_html code{\n",
        "    background-color: transparent;\n",
        "    }\n",
        "    ul{\n",
        "        margin: 2em;\n",
        "    }\n",
        "    ul li{\n",
        "        padding-left: 0.5em; \n",
        "        margin-bottom: 0.5em; \n",
        "        margin-top: 0.5em; \n",
        "    }\n",
        "    ul li li{\n",
        "        padding-left: 0.2em; \n",
        "        margin-bottom: 0.2em; \n",
        "        margin-top: 0.2em; \n",
        "    }\n",
        "    ol{\n",
        "        margin: 2em;\n",
        "    }\n",
        "    ol li{\n",
        "        padding-left: 0.5em; \n",
        "        margin-bottom: 0.5em; \n",
        "        margin-top: 0.5em; \n",
        "    }\n",
        "    ul li{\n",
        "        padding-left: 0.5em; \n",
        "        margin-bottom: 0.5em; \n",
        "        margin-top: 0.2em; \n",
        "    }\n",
        "    a:link{\n",
        "       font-weight: bold;\n",
        "       color:#447adb;\n",
        "    }\n",
        "    a:visited{\n",
        "       font-weight: bold;\n",
        "       color: #1d3b84;\n",
        "    }\n",
        "    a:hover{\n",
        "       font-weight: bold;\n",
        "       color: #1d3b84;\n",
        "    }\n",
        "    a:focus{\n",
        "       font-weight: bold;\n",
        "       color:#447adb;\n",
        "    }\n",
        "    a:active{\n",
        "       font-weight: bold;\n",
        "       color:#447adb;\n",
        "    }\n",
        "    .rendered_html :link {\n",
        "       text-decoration: underline; \n",
        "    }\n",
        "    .rendered_html :hover {\n",
        "       text-decoration: none; \n",
        "    }\n",
        "    .rendered_html :visited {\n",
        "      text-decoration: none;\n",
        "    }\n",
        "    .rendered_html :focus {\n",
        "      text-decoration: none;\n",
        "    }\n",
        "    .rendered_html :active {\n",
        "      text-decoration: none;\n",
        "    }\n",
        "    .warning{\n",
        "        color: rgb( 240, 20, 20 )\n",
        "    } \n",
        "    hr {\n",
        "      color: #f3f3f3;\n",
        "      background-color: #f3f3f3;\n",
        "      height: 1px;\n",
        "    }\n",
        "    blockquote{\n",
        "      display:block;\n",
        "      background: #fcfcfc;\n",
        "      border-left: 5px solid #c76c0c;\n",
        "      font-family: 'Open sans',verdana,arial,sans-serif;\n",
        "      width:680px;\n",
        "      padding: 10px 10px 10px 10px;\n",
        "      text-align:justify;\n",
        "      text-justify:inter-word;\n",
        "      }\n",
        "      blockquote p {\n",
        "        margin-bottom: 0;\n",
        "        line-height: 125%;\n",
        "        font-size: 100%;\n",
        "      }\n",
        "</style>\n",
        "<script>\n",
        "    MathJax.Hub.Config({\n",
        "                        TeX: {\n",
        "                           extensions: [\"AMSmath.js\"]\n",
        "                           },\n",
        "                tex2jax: {\n",
        "                    inlineMath: [ ['$','$'], [\"\\\\(\",\"\\\\)\"] ],\n",
        "                    displayMath: [ ['$$','$$'], [\"\\\\[\",\"\\\\]\"] ]\n",
        "                },\n",
        "                displayAlign: 'center', // Change this to 'center' to center equations.\n",
        "                \"HTML-CSS\": {\n",
        "                    styles: {'.MathJax_Display': {\"margin\": 4}}\n",
        "                }\n",
        "        });\n",
        "</script>\n"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 1,
       "text": [
        "<IPython.core.display.HTML at 0x7f3e37ae46a0>"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "The Kalman filter belongs to a family of filters called *bayesian filters*. Most textbook treatments of the Kalman filter present the Bayesian formula, perhaps shows how it factors into the Kalman filter equations, but mostly keeps the discussion at a very abstract level. \n",
      "\n",
      "That approach requires a fairly sophisticated understanding of several fields of mathematics, and it still leaves much of the work of understanding and forming an intuitive grasp of the situation in the hands of the reader.\n",
      "\n",
      "I will use a different way to develop the topic, to which I owe the work of Dieter Fox and Sebastian Thrun a great debt. It depends on building an intuition on how Bayesian statistics work by tracking an object through a hallway - they use a robot, I use a dog (I like dogs). The first published example of this that I can find seems to be Fox 1999 [1], with a fuller example in Fox [2] 2003. Sebastian Thrun also uses this formulation in his excellent Coursera course Artificial Intelligence for Robotics [3] In fact, if you like watching videos, I highly recommend pausing reading this book in favor of first few lessons of that course, and then come back to this book for a deeper dive into the topic.\n",
      "\n",
      "Let's now use a simple thought experiment, much like we did with the g-h filter, to see how we might reason about the use of probabilities for filtering and tracking."
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Tracking a Dog"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Let us begin with a simple problem. We have a dog friendly workspace, and so people bring their dogs to work. However, occasionally the dogs wander out of your office and down the halls. We want to be able to track them. So during a hackathon somebody created a little sonar sensor to attach to the dog's collar. It emits a signal, listens for the echo, and based on how quickly an echo comes back we can tell whether the dog is in front of an open doorway or not. It also senses when the dog walks, and reports in which direction the dog has moved. It connects to our network via wifi and sends an update once a second.\n",
      "\n",
      "I want to track my dog Simon, so I attach the device to his collar and then fire up Python, ready to try to write code to track him through the building. At first blush this may appear impossible. If I start listening to the sensor of Simon's collar I might read 'door', 'hall', 'hall', and so on. How can I use that information to determine where Simon is?\n",
      "\n",
      "To keep the problem small, we will assume that there are only 10 positions in a single hallway to consider, which we will number 0 to 9, where 1 is to the right of 0, 2 is to the right of 1, and so on. For reasons that will be clear later, we will also assume that the hallway is circular or rectangular. If you move right from position 9, you will be at position 0.  \n",
      "\n",
      "When I begin listening to the sensor I have no reason to believe that Simon is at any particular position in the hallway. He is equally likely to be in any position. The probability that he is in each position is therefore 1/10. \n",
      "\n",
      "Let us represent our belief of his position at any time in a numpy array."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import numpy as np\n",
      "\n",
      "pos_belief = np.array([.1, .1, .1, .1, .1, .1, .1, .1, .1, .1])"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 2
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Now let's create a map of the hallway in another list. Suppose there are first two doors close together, and then another door quite a bit further down the hallway. We will use 1 to denote a door, and 0 to denote a wall:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "hallway = np.array([1, 1, 0, 0, 0, 0, 0, 0, 1, 0])"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 3
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "So I start listening to Simon's transmissions on the network, and the first data I get from the sensor is \"door\". From this I conclude that he is in front of a door, but which one? I have no idea. I have no reason to believe is in front of the first, second, or third door. But what I can do is assign a probability to each door. All doors are equally likely, so I assign a probability of 1/3 to each door. "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import print_function, division\n",
      "import matplotlib.pyplot as plt\n",
      "import book_plots as bp\n",
      "import numpy as np\n",
      "\n",
      "pos_belief = np.array([1./3, 1./3, 0, 0, 0, 0, 0, 0, 1./3, 0])\n",
      "bp.bar_plot(pos_belief)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAxYAAAGNCAYAAACMgOcOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAH+5JREFUeJzt3X9w1/V9wPFXEgQSi5wMwSAoxDKoiFSJTCJVb4e5YR1l\np6J0swXpHJm1YOaOpWXnFJRadmxACTrrAbOjxV17rqfMIx4ozaA3IsQhBYfNhvQg6WQWrCtwJt/9\n4ZktJSRffUe/38jjccddeH8+n3xf3/fBXZ75/irIZDKZAAAASFCY6wEAAIDeT1gAAADJhAUAAJBM\nWAAAAMmEBQAAkExYAAAAyYQFAACQrNuw2LZtW0yfPj2GDx8ehYWFsX79+m6/6Z49e+L666+PkpKS\nGD58eCxevLhHhgUAAPJTt2HxzjvvxBVXXBErVqyI4uLiKCgo6PL848ePx4033hilpaXR0NAQK1as\niG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rEtddeG/v37++w9u///u9+GdKNdevWRf/+/WPWrFm5HiVvZTKZKCzs+GNl\nYWGhR1m7UVxcHEOHDo233norNm/eHF/4whdyPVKSs+YRi4j3nqZy5513xqRJk6KioiIee+yxaG5u\n9vy/Trzzzjtx4MCBiHjvofODBw9GY2Nj/NZv/Vb7p67znnvuuSe++93vxjPPPBMDBw5sf83OgAED\n4txzz83xdPnlL/7iL+Lmm2+O4cOHx9tvvx0bNmyIl156KZ5//vlcj5Z33v+sj/+vpKQkzj///NN+\n43y2u//++2P69OkxYsSI+MUvfhGLFy+OX//61/HlL38516Plnfvuuy8qKirikUceiZkzZ8bu3btj\n1apV3hK0C5lMJr7zne/EHXfcESUlJbkeJ2/NmDEjvvnNb8aoUaPisssui927d8ff/M3f+H94Bps3\nb47W1tYYO3ZsvP766/Hnf/7n8ZnPfCbmzJmT69HS5PAdqXKitrY2M3LkyEy/fv0y5eXlmR//+Me5\nHikvbd26NVNQUJApKCjIFBYWtn89Z86cXI+Wd35zj97/8+CDD+Z6tLwze/bszCWXXJLp169fZsiQ\nIZkbb7wxs3nz5lyP1Wt4u9nO3XHHHZlhw4Zl+vbtm7nooosyt956a2bfvn25HitvPffcc5kJEyZk\n+vfvnxkzZkxm1apVuR4pr23ZsiVTWFiY2blzZ65HyWu/+tWvMn/2Z3+WGTlyZKa4uDhTVlaW+cY3\nvpE5efJkrkfLS08//XTm0ksvzfTr1y9TWlqauffeezPHjx/P9VjJCjIZj1EBAABpzprXWAAAAB8d\nYQEAACQTFgAAQDJhAQAAJBMWAABAMmEBAAAkExYAAEAyYQEAACT7X4GRc6rg3cj8AAAAAElFTkSu\nQmCC\n",
       "text": [
        "<matplotlib.figure.Figure at 0x7f3e1b60d908>"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "We call this a <i>multimodal</i> distribution because we have multiple beliefs about the position of our dog. Of course we are not saying that we think he is simultaneously in three different locations, merely that so far we have narrowed down our knowledge in his position to these locations. \n",
      "\n",
      "I hand coded the `pos_belief` array in the code above. How would we implement this in code? Well, hallway represents each door as a 1, and wall as 0, so we will multiply the hallway variable by the percentage, like so;"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "pos_belief = hallway * (1/3)\n",
      "np.set_printoptions(precision=3)\n",
      "print(pos_belief)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "[ 0.333  0.333  0.     0.     0.     0.     0.     0.     0.333  0.   ]\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Extracting Information from Multiple Sensor Readings"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Let's put Python aside and think about the problem a bit. Suppose we were to read the following from Simon's sensor:\n",
      "\n",
      "  * door\n",
      "  * move right\n",
      "  * door\n",
      "  \n",
      "\n",
      "Can we deduce where Simon is at the end of that sequence? Of course! Given the hallway's layout there is only one place where you can be in front of a door, move once to the right, and be in front of another door, and that is at the left end. Therefore we can confidently state that Simon is in front of the second doorway. If this is not clear, suppose Simon had started at the second or third door. After moving to the right, his sensor would have returned 'wall'. Therefore the only possibility is that he is now in front of the second door. We denote this in Python with:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "pos_belief = np.array([0., 1., 0., 0., 0., 0., 0., 0., 0., 0.])\n",
      "print(pos_belief)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "[ 0.  1.  0.  0.  0.  0.  0.  0.  0.  0.]\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Obviously I carefully constructed the hallway layout and sensor readings to give us an exact answer quickly. Real problems will not be so clear cut. But this should trigger your intuition - the first sensor reading only gave us very low probabilities (0.333) for Simon's location, but after a position update and another sensor reading we knew much more about where he is. You might suspect, correctly, that if you had a very long hallway with a large number of doors that after several sensor readings and positions updates we would either be able to know where Simon was, or have the possibilities narrowed down to a small number of possibilities. For example, suppose we had a long sequence of \"door, right, door, right, wall, right, wall, right, door, right, door, right, wall, right, wall, right, wall, right, wall, right, door\". Simon could only be located where we had a sequence of [1,1,0,0,1,1,0,0,0,0,1] in the hallway. There might be only one match for that, or at most a few. Either way we will be far more certain about his position then when we started.\n",
      "\n",
      "We could work through the code to implement this solution, but instead let us consider a real world complication to the problem."
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Noisy Sensors"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Unfortunately I have yet to come across a perfect sensor. Perhaps the sensor would not detect a door if Simon sat in front of it while scratching himself, or it might report there is a door if he is facing towards the wall, not down the hallway. So in practice when I get a report 'door' I cannot assign 1/3 as the probability for each door. I have to assign something less than 1/3 to each door, and then assign a small probability to each blank wall position. At this point it doesn't matter exactly what numbers we assign; let us say that the probably of 'door' being correct is 0.6, and the probability of being incorrect is 0.2, which is another way of saying it is about 3 times more likely to be right than wrong. How would we do this?\n",
      "\n",
      "At first this may seem like an insurmountable problem. If the sensor is noisy it casts doubt on every piece of data. How can we conclude anything if we are always unsure?\n",
      "\n",
      "The key, as with the problem above, is probabilities. We are already comfortable with assigning a probabilistic belief about the location of the dog; now we just have to incorporate the additional uncertainty caused by the sensor noise. Say we think there is a 50% chance that our dog is in front of a specific door and we get a reading of 'door'. Well, we think that is only likely to be true 0.6 of the time, so we multiply: $0.5 * 0.6= 0.3$. Likewise, if we think the chances that our dog is in front of a wall is 0.1, and the reading is 'door', we would multiply the probability by the chances of a miss: $0.1 * 0.2 = 0.02$.\n",
      "\n",
      "However, we more or less chose 0.6 and 0.2 at random; if we multiply the `pos_belief` array by these values the end result will no longer represent a true probability distribution. "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "def update(pos_belief, measure, p_hit, p_miss):\n",
      "    for i in range(len(hallway)):\n",
      "        if hallway[i] == measure:\n",
      "            pos_belief[i] *= p_hit\n",
      "        else:\n",
      "            pos_belief[i] *= p_miss\n",
      "\n",
      "pos_belief = np.array([0.2]*10)\n",
      "reading = 1 # 1 is 'door'\n",
      "update(pos_belief, 1, .6, .2)\n",
      "\n",
      "print(pos_belief)\n",
      "print('sum =', sum(pos_belief))\n",
      "bp.bar_plot(pos_belief)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "[ 0.12  0.12  0.04  0.04  0.04  0.04  0.04  0.04  0.12  0.04]\n",
        "sum = 0.64\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAxYAAAGNCAYAAACMgOcOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XFw1/V9+PFXEgQTi5wMwSAoxDKoiFSJTCJVb4e5YR1l\nU1G62YJ0jsxaMHPH0rJzCkotOzagBJ31gNnR4q4911PmEU+UMuiNCHFIweGyIb2QdDILlhU4ku/v\nj17za0pIvvqOfL+Rx+OOu/D+fj75vr7vC3d58v1+P9+CTCaTCQAAgASFuR4AAADo/YQFAACQTFgA\nAADJhAUAAJBMWAAAAMmEBQAAkExYAAAAyboNiy1btsS0adNi2LBhUVhYGOvWrev2m+7evTtuuumm\nKCkpiWHDhsWiRYt6ZFgAACA/dRsWx44di6uvvjqWL18excXFUVBQ0OXxR48ejVtuuSVKS0ujvr4+\nli9fHkuXLo1ly5b12NAAAEB+Kfggn7zdv3//WLVqVXzhC1844zGrV6+OmpqaaGlpiX79+kVExGOP\nPRarV6+On/zkJ+kTAwAAeafH32Oxffv2+MxnPtMeFRERlZWV0dTUFAcOHOjpuwMAAPJAn57+hs3N\nzXHZZZd1WBsyZEj7bZdffnn7+pEjR3r67gEAgI/YgAEDTlvr8WcsunsPBgAA8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BMWAAAAMmEBQAAkExYAAAAyYQFAACQTFgAAADJhAUAAJBMWAAAAMmEBQAA\nkExYAAAAyYQFAACQTFgAAADJhAUAAJBMWAAAAMmyCova2toYOXJkFBcXR3l5eWzdurXbc/7u7/4u\nxowZE+eff34MHTo0ampqkocFAADyU5/uDtiwYUPMnz8/Vq9eHZMnT45Vq1bF1KlT48c//nEMHz68\n03Oqq6vjxRdfjL/5m7+JcePGxZEjR+LQoUM9PjwAAJAfug2LZcuWxezZs2POnDkREbFixYp46aWX\nYvXq1fH444+fdvxbb70V3/zmN2P37t0xevTo9vXx48f34NgAAEA+6fKlUCdPnoydO3dGZWVlh/XK\nysrYtm1bp+f88z//c5SVlcXGjRujrKwsRo4cGbNmzYr/+Z//6bmpAQCAvFKQyWQyZ7qxqakphg0b\nFlu2bInJkye3rz/66KOxfv362Ldv32nnzJ07N9atWxef/vSnY+nSpRER8dBDD0VExPbt26OgoKD9\n2CNHjrR/vX///vRHAwAAfCRGjRrV/vWAAQNOu73bl0J9UG1tbXHixIl49tln45Of/GRERDz77LMx\nevToqK+vj+uuu66n7xIAAMixLsNi0KBBUVRUFC0tLR3WW1paorS0tNNzSktLo0+fPu1RERHxyU9+\nMoqKiuKdd945Y1iUl5d/0Nk/tPr6+rN+n72Vvcqevcqevcqevfpg7Ff27FX27FX27FX2euNe/fqr\njTrT5Xss+vbtGxMmTIhNmzZ1WK+rq4uKiopOz5k8eXKcOnUqGhsb29caGxujtbU1Lr/88mznBgAA\nepFuP8eiuro61q5dG88880zs3bs35s2bF83NzTF37tyIiKipqYkpU6a0Hz9lypS49tpr4957742G\nhobYtWtX3HvvvXH99df3qiIDAACy1+17LGbMmBGHDx+OxYsXx6FDh2LcuHGxcePG9s+waG5u7vDs\nREFBQbzwwgvxla98JW688cYoLi6OysrKWLZs2Uf3KAAAgJzK6s3bVVVVUVVV1elta9asOW3tkksu\nieeeey5tMgAAoNfo9qVQAAAA3REWAABAMmEBAAAkExYAAEAyYQEAACQTFgAAQDJ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T5gQMHoqGhIX7rt36r/VPX+aX7\n778/vv3tb8fzzz8fAwYMaH/PTv/+/eOCCy7I8XT55S//8i/jtttui2HDhsX7778f69evj9deey1e\neumlXI+Wd371WR+/rqSkJC666KLT/sf5XPfQQw/FtGnTYvjw4fHTn/40Fi1aFL/4xS/ii1/8Yq5H\nyzsPPvhgVFRUxOOPPx4zZsyIXbt2xcqVK10StAuZTCa+9a1vxd133x0lJSW5HidvTZ8+Pb7+9a/H\nyJEj48orr4xdu3bF3/7t3/p3eAabNm2K1tbWGDNmTLz99tvxF3/xF/GpT30qZs+enevR0uTwilQ5\nUVtbmxkxYkSmX79+mfLy8swPf/jDXI+UlzZv3pwpKCjIFBQUZAoLC9u/nj17dq5Hyzu/uUe/+vPI\nI4/kerS8M2vWrMzll1+e6devX2bw4MGZW265JbNp06Zcj9VruNxs5+6+++7M0KFDM3379s1ceuml\nmTvuuCOzd+/eXI+Vt1588cXM+PHjM+eff35m9OjRmZUrV+Z6pLz2yiuvZAoLCzM7duzI9Sh57ec/\n/3nmz//8zzMjRozIFBcXZ8rKyjJf+9rXMidOnMj1aHnpueeey1xxxRWZfv36ZUpLSzMPPPBA5ujR\no7keK1kzPKbjAAAAPklEQVRBJuM5KgAAIM058x4LAADgoyMsAACAZMICAABIJiwAAIBkwgIAAEgm\nLAAAgGTCAgAASCYsAACAZP8PyBnSDs41AsEAAAAASUVORK5CYII=\n",
       "text": [
        "<matplotlib.figure.Figure at 0x7f3e1b369a58>"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "We can see that this is not a probability distribution because it does not sum to 1.0. But we can see that the code is doing mostly the right thing - the doors are assigned a number (0.12) that is 3 times higher than the walls (0.04). So we can write a bit of code to normalize the result so that the probabilities correctly sum to 1.0."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "def update(pos_belief, measure, p_hit, p_miss):\n",
      "    for i in range(len(hallway)):\n",
      "        if hallway[i] == measure:\n",
      "            pos_belief[i] *= p_hit\n",
      "        else:\n",
      "            pos_belief[i] *= p_miss\n",
      "            \n",
      "    pos_belief /= sum(pos_belief)\n",
      "\n",
      "pos_belief = np.array([0.2]*10)\n",
      "reading = 1 # 1 is 'door'\n",
      "update(pos_belief, 1, .6, .2)\n",
      "\n",
      "print('sum =', sum(pos_belief))\n",
      "print('probability of door =', pos_belief[0])\n",
      "print('probability of wall =', pos_belief[2])\n",
      "bp.bar_plot(pos_belief)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "sum = 1.0\n",
        "probability of door = 0.1875\n",
        "probability of wall = 0.0625\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAxYAAAGNCAYAAACMgOcOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XFw1/V9+PFXEgQTi5wMwWBQiGVQEakSmUSq3g5zwzrK\npqJ0swXpHJm1YOaOpWXnFJRadmxACTrrAbOjxV17rqfMI54oZdAbCHFIweGyIb2QdDILlhU4wvf3\nR6/5NSUkX3wHvt/I43HHXXh/P598X9/3hbs8+X6/n29BJpPJBAAAQILCXA8AAAD0fMICAABIJiwA\nAIBkwgIAAEgmLAAAgGTCAgAASCYsAACAZF2GxcaNG2Py5MlRVlYWhYWFsXr16i6/6c6dO+OWW26J\nkpKSKCsri/nz53fLsAAAQH7qMiyOHDkS1157bSxZsiSKi4ujoKCg0+MPHz4ct912W5SWlsa2bdti\nyZIlsWjRoli8eHG3DQ0AAOSXgjP55O2+ffvG8uXL4wtf+MJpj1mxYkXU1tZGS0tL9OnTJyIinnji\niVixYkX85Cc/SZ8YAADIO93+HostW7bEZz7zmbaoiIioqqqKpqam2LdvX3ffHQAAkAd6dfc3bG5u\njiuuuKLd2qBBg9puu/LKK9vWDx061N13DwAAnGX9+vU7Za3bn7Ho6j0YA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K3f+q22T13nlx58\n8MH49re/HS+++GL069ev7T07ffv2jYsuuijH0+WXv/zLv4w77rgjysrK4sMPP4w1a9bEG2+8Ea+8\n8kquR8s7v/qsj19XUlISl1xyySn/43y+e+SRR2Ly5MkxZMiQ+OlPfxrz58+PX/ziF/HFL34x16Pl\nnYcffjgqKyvjySefjKlTp8aOHTti2bJlLgnaiUwmE9/61rfi3nvvjZKSklyPk7emTJkSX//612PY\nsGFx9dVXx44dO+Jv//Zv/Ts8jfXr10dra2uMHDky3n333fiLv/iL+NSnPhUzZszI9WhpcnhFqpyo\nq6vLDB06NNOnT59MRUVF5oc//GGuR8pLGzZsyBQUFGQKCgoyhYWFbV/PmDEj16Plnd/co1/9eeyx\nx3I9Wt6ZPn165sorr8z06dMnM3DgwMxtt92WWb9+fa7H6jFcbrZj9957b2bw4MGZ3r17Zy6//PLM\nXXfdldm9e3eux8pbL7/8cmbMmDGZCy+8MDNixIjMsmXLcj1SXnvttdcyhYWFma1bt+Z6lLz285//\nPPPnf/7nmaFDh2aKi4sz5eXlma997WuZY8eO5Xq0vPTCCy9krrrqqkyfPn0ypaWlmYceeihz+PDh\nXI+VrCAJkNGwAAAAPUlEQVST8RwVAACQ5rx5jwUAAHD2CAsAACCZsAAAAJIJCwAAIJmwAAAAkgkL\nAAAgmbAAAACSCQsAACDZ/wPWkdIM5K/8lgAAAABJRU5ErkJggg==\n",
       "text": [
        "<matplotlib.figure.Figure at 0x7f3e1b25ab00>"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Normalization is done by dividing each element by the sum of all elements in the list. If this is not clear you should spend a few minutes proving it to yourself algebraically. We can see from the output that the sum is now 1.0, and that the probability of a door vs wall is still three times larger. The result also fits our intuitiion that the probability of a door must be less than 0.333, and that the probability of a wall must be greater than 0.0. Finally, it should fit our intuition that we have not yet been given any information that would allow us to distinguish between any given door or wall position, so all door positions should have the same value, and the same should be true for wall positions. "
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Incorporating Movement Data"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Recall how quickly we were able to find an exact solution to our dog's position when we incorporated a series of measurements and movement updates. However, that occured in a fictional world of perfect sensors. Might we be able to find an exact solution even in the presence of noisy sensors?\n",
      "\n",
      "Unfortunately, the answer is no. Even if the sensor readings perfectly match an extremely complicated hallway map we could not say that we are 100% sure that the dog is in a specific position - there is, after all, the possibility that every sensor reading was wrong! Naturally, in a more typical situation most sensor readings will be correct, and we might be close to 100% sure of our answer, but never 100% sure. This may seem head-spinningly complicated, but lets just go ahead and program the math, which as we have seen is quite simple.\n",
      "\n",
      "First let's deal with the simple case - assume the movement sensor is perfect, and it reports that the dog has moved one space to the right. How would we alter our `pos_belief` array?\n",
      "\n",
      "I hope after a moment's thought it is clear that we should just shift all the values one space to the right. If we previously thought there was  a 50% chance of Simon being at position 3, then after the move to the right we should believe that there is a 50% chance he is at position 4. So let's implement that. Recall that the hallway is circular, so we will use modulo arithmetic to perform the shift correctly"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import numpy\n",
      "def perfect_predict(pos_belief, move):\n",
      "    \"\"\" move the position by 'move' spaces, where positive is to the right, \n",
      "    and negative is to the left\n",
      "    \"\"\"\n",
      "    n = len(pos_belief)\n",
      "    result = np.zeros(n)\n",
      "    for i in range(n):\n",
      "        result[i] = pos_belief[(i-move) % n]\n",
      "    pos_belief[:] = result\n",
      "        \n",
      "pos_belief = np.array([.4, .1, .2, .3])\n",
      "print('belief before predict =', pos_belief)\n",
      "bp.bar_plot(pos_belief, title='Before prediction')\n",
      "\n",
      "perfect_predict(pos_belief, 1)\n",
      "print('belief after predict =', pos_belief)\n",
      "bp.bar_plot(pos_belief, title='After prediction')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "belief before predict = [ 0.4  0.1  0.2  0.3]\n",
        "belief after predict ="
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " [ 0.3  0.4  0.1  0.2]\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAxYAAAGaCAYAAACSU9UtAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xt0lPWd+PHPhIsE5aIiFxW5rIq6DQhEK1ERWJpdypZ6\nvHCsrhTEdWG9gKirdF3FSr128baC1wJVq7DV6jmKLKiARVChmOoq1gsu0oVkC2pALBfJ/P7wkF/T\nhCT4DR0ir9c5nlO+8zwzn5k8h+bNPM9MJpvNZgMAACBBXq4HAAAAGj9hAQAAJBMWAABAMmEBAAAk\nExYAAEAyYQEAACQTFgB72D333BN//dd/HS1btoy8vLy44YYbcj1SozNgwIDIy6v6f1kLFy7c469n\n165do1u3bnvs/gG+SYQFwNdw1113RV5eXuTl5cXrr7++y+2eeOKJGDduXOzYsSPGjRsXkyZNigED\nBsSkSZMiLy8vZs6c+RecunHLZDK7tV4fXbt2rRYsf37fKfcPsC9pmusBABqjBx54oMr/PvHEE2vc\n7tlnn42IiJ///OdVtlmwYEFEpP1SvK/79re/He+++260a9cu6X5q+xm89NJLSfcNsC/xjgXAbvr1\nr38dK1eujHPOOScOP/zwmDVrVmzatKnGbdeuXRsRER06dKjx9mw2u8fm/KbLz8+Po48+Og466KA9\n9hjdunVzKhRAPQkLgN20892KCy+8MEaMGBGbN2+Oxx57rMo2O091WrhwYUR89QvqzlOnBg4cGD/+\n8Y8jImLUqFGV63l5efHxxx9X3kdFRUU89NBDcfLJJ0ebNm0iPz8/CgoK4pZbbont27dXmysvLy+6\ndesWGzdujPHjx0eXLl2iWbNmcdddd9X6fHZeqzBq1Kh45513YtiwYXHQQQfFAQccEP37948XX3yx\n2j4zZsyovL7h1VdfjSFDhsSBBx4YeXl5sXHjxq81f8RXp4717ds3WrZsGR06dIgR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9X7Zt27bZtm3bVrkvgMbIqVAAu+GBBx6IvLy8GDlyZOXaBRdcUHlbQ6ioqIi77ror\nOnToEHfeeWeVfzHPZDJx6623RiaTiUcffbTavplMJn76059GixYtdvtx27ZtW+1fzU888cQYPnx4\nfPLJJ/HMM89U26d3795x4YUXfq35H3nkkcr1xx57LL788su4+OKLq7xjsHP72j656U/95je/iVdf\nfTV69uwZ//qv/1rt9tatW8f+++9fr/valYceeigymUxMmTIlmjb9/2/8t27dOm6++eaIiHjwwQer\n7ZfJZOLuu++O/fbbr3LtkEMOiWHDhkV5eXm89957SXMB5JpToQDq6de//nW8++67MWDAgCq//J59\n9tlx6aWXxhNPPBFTpkyJAw44IOlx3nvvvdiwYUP81V/9VeW1GH+uRYsW8c4779S4XlBQ8LUet0+f\nPjX+0t2/f/94/PHHo6SkJM4999wqt9X0aVj1nX/lypWVf16xYkVERJx22mnVtu3atWt07ty5yvUn\nu/Lqq69GRERxcXGd234dmzZtig8//DA6duwYxx57bLXbBw0aFBERb7zxRrXb2rRpE927d6+2vvNU\ntU8//bSBpwX4yxIWAPV0//33R0TED3/4wyrrLVu2jLPPPjumT58ev/jFL+Kiiy5KepwNGzZERMSH\nH364y1/MI2r+mNT27dt/7cfd1SdX7VwvLy+vdlvHjh2rrX2d+Xfed20z1CcsPvvss4iIOOyww+rc\n9uvYOWdNzzviq2OhdevWlXP8qZ3X2Py5ne967Nixo4GmBMgNp0IB1MPOi7Yjqn+SU15eXuWnATXE\n6VA7L1QeNmxYVFRU7PK/mn4RTflejLKyslrXa7qAuqbH+zrz79ynrhnqsvOX99///vf12n537Zyz\ntLS0xtu/+OKL2LhxY60XmwN8U3nHAqAeZs6cGdu2bYvevXtH3759a9zm+eefjxUrVsSKFSuiT58+\ntd7fzk9DqikOjj322Gjbtm289tprsX379mjWrFn6E6iHFStWxOeff17tVK5FixZFxFfXU9TH15m/\nb9++8atf/SoWLlwYgwcPrnLbRx99FGvWrKnXY/fr1y8iIubNmxe33XZbnaG18+eQzWbrFWWtWrWK\nI488Mj744INYuXJltdOhdn6h3q6OEYBvMu9YANTDAw88UHnx7QMPPFDjf5dffnnltn+qpl9YDz74\n4IiIWL16dbXbmjRpEuPGjYuysrK4+OKL449//GO1bdavXx+//e1vG+KpVfrss8+qnbr02muvxezZ\ns+Oggw6K73//+/W6n68z/3nnnRfNmjWLe++9Nz766KPK9YqKirjmmmuioqKiXo/dp0+fKCoqirfe\neit+8pOfVLu9vLw8Nm/eXPnngw8+OLLZbI0/h10ZPXp0RERcccUV8eWXX1aub9y4MX70ox9FRFS7\noB1gX+AdC4A6vPzyy/G73/0ujj322Dj55JN3ud2IESNi4sSJ8fjjj8e///u/V14Ina3h27X/5m/+\nJvLy8uLOO++MDRs2VF5bcNlll0Xr1q3j2muvjbfeeiseeuiheO6552LQoEFx+OGHxx/+8If48MMP\n45VXXolLLrkkpkyZ0mDP89RTT40HH3wwXn/99SgqKor//d//jVmzZkUmk4kHHnggWrZsWe/72t35\nu3TpErfccktcccUV0adPnxg+fHjl91iUl5dHz549480336zXYz/66KMxYMCAuO666+Lpp5+OAQMG\nRMRX13zMmzcvli5dGj179oyIry7yXr58eZxxxhkxZMiQyM/Pj65du8Y//MM/7PL+J0yYEHPnzo25\nc+dGQUFBDB06NLZv3x5PPvlkrF27Nn74wx/GmWeeWe/XCuAbo67Po120aFH2e9/7Xvawww7LZjKZ\n7IwZM+r8DNs333wz279//2x+fn72sMMOy/74xz9O/2BcgBw599xzs3l5edk77rijzm2HDx+ezcvL\nyz700EPZbDabHTBgQDYvL6/a91hks9ns448/nu3bt2+2ZcuWld/T8OfbPf7449ni4uLswQcfnG3e\nvHn20EMPzfbr1y87adKk7AcffFBl20wmU+07F+pj5/dBjBo1Krty5crssGHDsgceeGB2//33z/bv\n3z/74osvVttnxowZ2by8vGrfIVHTc6zv/Du379OnT7ZFixbZ9u3bZ88///zsunXrKl/HmuauaYYN\nGzZkJ06cmD3mmGOyLVq0yLZt2zbbs2fP7NVXX5397LPPKrf74os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X73LbhQsXxve///049NBDY//9949evXrF9OnTG2RgAABg71OvsJg1a1aMHz8+rr322igp\nKYmioqIYMmRIrFmzpsbtly5dGr169Yonn3wy3n777Rg7dmxcdNFF8fjjjzfo8AAAwN6haX02mjJl\nSowaNSpGjx4dERF33313zJ07N6ZNmxY33XRTte0nTpxY5c9jxoyJBQsWxJNPPhk/+MEPGmBsAABg\nb1LnOxbbtm2LFStWRHFxcZX14uLiWLJkSb0fqLy8PA466KDdnxAAANjr1fmOxfr162PHjh3RoUOH\nKuvt27eP0tLSej3Is88+Gy+99NJuhQik2LRpUyxf/mGux6hmU4v2uR6Bb6C99Xhn9yxfvjzXI8Bf\njOO9cTrqqKNqvb1ep0KleOWVV+K8886Le+65JwoLC/f0wwEA/EVlW7WL9dt90CYNr12zishsWp/r\nMeqtzrBo165dNGnSJMrKyqqsl5WVRadOnWrdd/HixTF06NC48cYb45/+6Z/SJoXd0KpVqyj81hG5\nHqOaxas/jYituR6Db5i99Xinfnb+y61/fGu8Fq/+NH70euP55Y/G457+7eKUHl1zPUal8vLyWm+v\nM6+bN28effv2jXnz5lVZnz9/fhQVFe1yv5dffjm++93vxg033BCXXXZZPccFAAAao3qdCjVhwoQ4\n//zz48QTT4yioqK47777orS0NMaMGRMRX30K1LJly+KFF16IiK++x2Lo0KFxySWXxA9+8IPKazGa\nNGkShxxyyB56KgAAQK7UKyyGDx8eGzZsiMmTJ8e6deuioKAg5syZE507d46IiNLS0li1alXl9jNn\nzowtW7bE7bffHrfffnvleteuXatsBwAAfDPU++LtsWPHxtixY2u87c+/VXv69Om+aRsAAPYhPsIA\nAABIJiwAAIBkwgIAAEgmLAAAgGTCAgAASCYsAACAZMICAABIJiwAAIBkwgIAAEgmLAAAgGTCAgAA\nSCYsAACAZMICAABIJiwAAIBkwgIAAEgmLAAAgGTCAgAASCYsAACAZMICAABIJiwAAIBkwgIAAEgm\nLAAAgGTCAgAASCYsAACAZMICAABIJiwAAIBkwgIAAEgmLAAAgGTCAgAASCYs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0507tw5\nIr66IHvVqlWV27du3Trmz58fF198cRQWFsZBBx0UV155ZVx++eV77lkAAAA5lclms9lcDwEAADRu\nDf6pUDS8qVOnRrdu3SI/Pz8KCwtj8eLFuR4J9oiXX345hg0bFocffnjk5eXFzJkzcz0S7BE333xz\nnHDCCdGmTZto3759DBs2LN5+++1cjwV7xL333hu9evWKNm3aRJs2baKoqCjmzJmT67HYA4TFXm7W\nrFkxfvz4uPbaa6OkpCSKiopiyJAhsWbNmlyPBg1u8+bN0bNnz7jrrrsiPz/fx1fzjbVo0aK45JJL\nYunSpfHSSy9F06ZNY/DgwfHpp5/mejRocJ07d47bbrst3njjjfjNb34TgwYNitNPPz1++9vf5no0\nGphTofZy3/72t+P444+P+++/v3Lt6KOPjrPOOituuummHE4Ge1arVq3i3nvvjREjRuR6FNjjNm/e\nHG3atIlnnnkmhg4dmutxYI87+OCD45Zbbol//Md/zPUoNCDvWOzFtm3bFitWrIji4uIq68XFxbFk\nyZIcTQVAQ9u4cWNUVFTEgQcemOtRYI/asWNHPPHEE7Fly5bo379/rsehgdX5qVDkzvr162PHjh3R\noUOHKuvt27ev9iWEADRe48aNi969e0e/fv1yPQrsEW+99Vb069cvtm7dGvn5+TF79uzo0aNHrsei\ngQkLAMihCRMmxJIlS2Lx4sWuK+Ib65hjjok333wzysvL4z//8z/jnHPOiQULFkRhYWGuR6MBCYu9\nWLt27aJJkyZRVlZWZb2srCw6deqUo6kAaCiXX355zJ49OxYsWBBdu3bN9TiwxzRr1iy6d+8eERG9\ne/eOZcuWxb333hvTp0/P8WQ0JNdY7MWaN28effv2jXnz5lVZnz9/fhQVFeVoKgAawrhx42LWrFnx\n0ksvxdFHH53rceAvaseOHVFRUZHrMWhg3rHYy02YMCHOP//8OPHEE6OoqCjuu+++KC0tjTFjxuR6\nNGhwmzdvjvfffz8iIioqKmL16tVRUlISBx98cHTu3DnH00HDufjii+PRRx+Np59+Otq0aVN53Vyr\nVq1i//33z/F00LCuueaa+Pu///s4/PDDY9OmTfGLX/wiFi1aFHPnzs31aDQwHzfbCEybNi1uu+22\nWLduXRQUFMQdd9wRp5xySq7Hgga3cOHCGDRoUEREZDKZ2PnX08iRI+NnP/tZLkeDBpWXl1flGN9p\n0qRJcd111+VoKtgzRo0aFQsWLIjS0tJo06ZN9OrVK6666qr4zne+k+vRaGDCAgAASOYaCwAAIJmw\nAAAAkgkLAAAgmbAAAACSCQsAACCZsAAAAJIJCwAAIJmwAAAAkv0/S3uIezgB2esAAAAASUVORK5C\nYII=\n",
       "text": [
        "<matplotlib.figure.Figure at 0x7f3e1b26c828>"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "We can see that we correctly shifted all values one position to the right, wrapping from the end of the array back to the beginning."
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Adding Noise to the Prediction"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "We want to solve real world problems, and we have already stated that all sensors have noise. Therefore the code above must be wrong. What if the sensor reported that our dog moved one space, but he actually moved two spaces, or zero? Once again this may initially sound like an insurmountable problem, but let's just model it in math. Since this is just an example, we will create a pretty simple noise model for the sensor - later in the book we will handle far more sophisticated errors.\n",
      "\n",
      "We will say that when the sensor sends a movement update, it is 80% likely to be right, and it is 10% likely to overshoot one position to the right, and 10% likely to undershoot to the left. That is, if we say the movement was 4 (meaning 4 spaces to the right), the dog is 80% likely to have moved 4 spaces to the right, 10% to have moved 3 spaces, and 10% to have moved 5 spaces.\n",
      "\n",
      "This is slightly harder than the math we have done so far, but it is still tractable. Each result in the array now needs to incorporate probabilities for 3 different situations. For example, consider position 9 for the case where the reported movement is 2. It should be clear that after the move we need to incorporate the probability that was at position 7 (9-2). However, there is a small chance that our dog actually moved from either 1 or 3 spaces away due to the sensor noise, so we also need to use positions 6 and 8. How much? Well, we have the probabilities, so we can just multiply and add. It would be 80% of position 7 plus 10% of position 6 and 10% of position 8! Let's try coding that:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "def predict(pos_belief, move, p_correct, p_under, p_over):\n",
      "    n = len(pos_belief)\n",
      "    result = np.zeros(n)\n",
      "    for i in range(n):\n",
      "                result[i] = (\n",
      "            pos_belief[(i-move) % n]   * p_correct +\n",
      "            pos_belief[(i-move-1) % n] * p_over +\n",
      "            pos_belief[(i-move+1) % n] * p_under)      \n",
      "    pos_belief[:] = result\n",
      "\n",
      "pos_belief = np.array([0, 0, 0, 1, 0, 0, 0, 0], dtype=float)\n",
      "predict(pos_belief, 2, .8, .1, .1)\n",
      "print(pos_belief)\n",
      "bp.bar_plot(pos_belief)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "[ 0.   0.   0.   0.   0.1  0.8  0.1  0. ]\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAxYAAAGNCAYAAACMgOcOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHj1JREFUeJzt3XFw1/V9+PFXEkQSi6wWg0GiwknxVKRKZBKtejvMjdoy\ndioVN1somyNnLZjzjtJxqw7UWjduQkn0GAe0XTfc2bO7mjniQcUMdiWNcdRhR5uNsoNvOqiLHDfk\n1+T7+6M114yYYN8Jn/DN43HHXXh/P5/k9X3f9zie+X4/329RPp/PBwAAQILirAcAAADOfcICAABI\nJiwAAIBkwgIAAEgmLAAAgGTCAgAASCYsAACAZAOGxa5du2LevHkxadKkKC4ujq1btw74Tfft2xe3\n3XZblJWVxaRJk2L16tWDMiwAADA8DRgWJ06ciOuuuy6eeeaZKC0tjaKion6Pf+edd+KOO+6IioqK\naGlpiWeeeSaefvrpWLt27aANDQAADC9FH+STt8eOHRsbNmyIz3zmM+97TENDQ6xcuTI6Ojri/PPP\nj4iIxx9/PBoaGuK//uu/0icGAACGnUG/xmLPnj3x8Y9/vCcqIi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Hst6tIK2aNGi/OWXX54///zz8+Xl5fk77rgjv3379qzHGnFuv/32/EMPPZT1GAXv3nvv\nzU+cODE/evTo/KWXXpq/++678/v37896rBHhpZdeys+YMSM/ZsyY/LRp0/Lr16/PeqQRYceOHfni\n4uL83r17sx4lMz7HAgAASOYaCwAAIJmwAAAAkgkLAAAgmbAAAACSCQsAACCZsAAAAJIJCwAAIJmw\nAAAAkv1/1CENiaUhvCAAAAAASUVORK5CYII=\n",
       "text": [
        "<matplotlib.figure.Figure at 0x7f3e1b21e5c0>"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "The simple test case that we ran appears to work correctly. We initially believed that the dog was in position 3 with 100% certainty; after the movement update we now give an 80% probability to the dog being in position 5, and a 10% chance to undershooting to position 4, and a 10% chance of overshooting to position 6. Let us look at a case where we have multiple beliefs:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "pos_belief = np.array([0, 0, .4, .6, 0, 0, 0, 0])\n",
      "predict(pos_belief, 2, .8, .1, .1)\n",
      "print(pos_belief)\n",
      "bp.bar_plot(pos_belief)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "[ 0.    0.    0.    0.04  0.38  0.52  0.06  0.  ]\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAxYAAAGNCAYAAACMgOcOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHm9JREFUeJzt3XF01fV9+P9XEkQSG/OtxWAQVDhSPCqiEplEqp4dzBm1\nh7GjUulmC2Vz5FgL5ngOZeOcakGtZeNMKIkexgFOOzfcscfu1MwRjyhmsDPSGEcddrTZKDtw00Fd\n5HCGHJP7+6Mzpxkxwd878Ak3j8c5nBPe9/NJXnmfHPSZ+7mfW5TP5/MBAACQoDjrAQAAgPOfsAAA\n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o729PT7zmc/0vrs7Q++h\nhx6K73//+/HSSy9FRUVF7+uIysvL46KLLsp4usL1jW98I77whS/EhAkT4vjx4/H888/HG2+8Ea+8\n8krWoxWsj94z5DeVlZXFpz/96dN+q8vQevTRR2PevHkxceLE+OUvfxmrV6+O//mf/4mvfOUrWY9W\n0B555JGoqamJJ598MhYsWBBvvfVWbNiwIZ566qmsRyt4+Xw+/vIv/zLuv//+KCsry3qcbOTpo6Gh\nIX/VVVflL7zwwnx1dXX+zTffzHqkgrZz5858UVFRvqioKF9cXNz78eLFi7MeraD93/3+6M/jjz+e\n9WgFbdGiRfkrr7wyf+GFF+YrKyvzd911V37Hjh1ZjzXi3HnnnfmHH3446zEK3v33358fP358fvTo\n0fnLL788f++99+b379+f9Vgjwssvv5yfPn16fsyYMfmpU6fmN2zYkPVII8Jrr72WLy4uzu/duzfr\nUTLjfSwAAIBkXmMBAAAkExYAAEAyYQEAACQTFgAAQDJhAQAAJBMWAABAMmEBAAAkExYAAECy/w8S\nfRkuh9z3sAAAAABJRU5ErkJggg==\n",
       "text": [
        "<matplotlib.figure.Figure at 0x7f3e1b216748>"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Here the results are more complicated, but you should still be able to work it out in your head. The 0.04 is due to the possibility that the 0.4 belief undershot by 1. The 0.38 is due to the following: the 80% chance that we moved 2 positions $(.4 * .8)$ and the 10% chance that we undershot $(.6*.1)$. Overshooting plays no role here because if we overshot both .4 and .6 would be past this position. **I strongly suggest working some examples until all of this is very clear, as so much of what follows depends on understanding this step.**\n",
      "\n",
      "If you look at the probabilities after performing the update you probably feel dismay. In the example above we started with probabilities of .4 and .6 in two fields; after performing the update the probabilities are not only lowered, but they are strewn out across the map."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "bp.bar_plot(pos_belief)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVB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322j5r11xzTfzi\nF7/IaKKR5Ze//GX83d/9XTQ0NGQ9SiZcCvW/Ro8eHTNmzIgdO3b0WW9ubo6ampqMpoKzZ9myZbF9\n+/Z47bXX4rOf/WzW44xY3d3d0dPTk/UYBev3fu/34ic/+Um8/fbb8fbbb0d7e3tUV1fHwoULo729\nXVScQydPnoz9+/f7Zd1Zdtttt8W7777bZ+3f/u3f/PLoHNm6dWuMGTMmFi5cmPUomfCMxW+or6+P\nBx54IGbOnBk1NTXx7LPPRi6Xi6VLl2Y9WsE6ceJEHDhwICJ+/fTtwYMHo729PT7zmc/0vrs7Q++h\nhx6K73//+/HSSy9FRUVF7+uIysvL46KLLsp4usL1jW98I77whS/EhAkT4vjx4/H888/HG2+8Ea+8\n8krWoxWsj94z5DeVlZXFpz/96dN+q8vQevTRR2PevHkxceLE+OUvfxmrV6+O//mf/4mvfOUrWY9W\n0B555JGoqamJJ598MhYsWBBvvfVWbNiwIZ566qmsRyt4+Xw+/vIv/zLuv//+KCsry3qcbOTpo6Gh\nIX/VVVflL7zwwnx1dXX+zTffzHqkgrZz5858UVFRvqioKF9cXNz78eLFi7MeraD93/3+6M/jjz+e\n9WgFbdGiRfkrr7wyf+GFF+YrKyvzd911V37Hjh1ZjzXi3HnnnfmHH3446zEK3v33358fP358fvTo\n0fnLL788f++99+b379+f9Vgjwssvv5yfPn16fsyYMfmpU6fmN2zYkPVII8Jrr72WLy4uzu/duzfr\nUTLjfSwAAIBkXmMBAAAkExYAAEAyYQEAACQTFgAAQDJhAQAAJBMWAABAMmEBAAAkExYAAECy/w8S\nfRkuh9z3sAAAAABJRU5ErkJggg==\n",
       "text": [
        "<matplotlib.figure.Figure at 0x7f3e1b5f8e10>"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "This is not a coincidence, or the result of a carefully chosen example - it is always true of the update step. This is inevitable; if our sensor is noisy we will lose a bit of information on every update. Suppose we were to perform the update an infinite number of times - what would the result be? If we lose information on every step, we must eventually end up with no information at all, and our probabilities will be equally distributed across the `pos_belief` array. Let's try this with say 500 iterations.\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "pos_belief = np.array([1.0, 0, 0, 0, 0, 0, 0, 0, 0, 0])\n",
      "for i in range (500):\n",
      "    predict(pos_belief, 1, .8, .1, .1)\n",
      "print(pos_belief)\n",
      "bp.bar_plot(pos_belief)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "[ 0.1  0.1  0.1  0.1  0.1  0.1  0.1  0.1  0.1  0.1]\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAxYAAAGNCAYAAACMgOcOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X901fV9+PFXEgSTFnNkCAaDQiyDikiVyCTS6tnBnGEd\nZVNRutmCdI7MWjBzh6VlxykoteywASXorAeYHS3utMf1KPMQjyhl0DMixCEFh8uG9EDSyWywrsAx\nud8/eppvU0Jy8R29N/p4nMM5l/fn88l93feBc3hyfxVkMplMAAAAJCjM9QAAAED/JywAAIBkwgIA\nAEgmLAAAgGTCAgAASCYsAACAZMICAABI1mtYbNu2LWbMmBHl5eVRWFgYGzZs6PWH7t27N6677roo\nKSmJ8vLyWLJkSZ8MCwAA5Kdew+Kdd96JK664IlauXBnFxcVRUFDQ4/nHjx+PG264IcrKyqKxsTFW\nrlwZy5cvjxUrVvTZ0AAAQH4pOJtv3h48eHCsWbMmvvCFL5zxnLVr10ZdXV20trbGoEGDIiLioYce\nirVr18ZPfvKT9IkBAIC80+fvsdi5c2d8+tOf7oyKiIjq6uo4cuRIHDp0qK/vDgAAyAMD+voHtrS0\nxMUXX9xlbfjw4Z3HLrnkks71tra2vr57AADgfVZaWnraWp8/Y9HbezAAAIAPnz4PiwsvvDBaWlq6\nrLW2tnYeA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5eXl\n8fbbb8fGjRvjpZdeiueeey7Xo+WdX33Xx68rKSmJ888//7T/cf6ou++++2LGjBkxcuTI+OlPfxpL\nliyJX/ziF/HFL34x16PlnXvvvTeqqqri4YcfjlmzZsWePXti9erVPhK0B5lMJr71rW/F7bffHiUl\nJbkeJ2/NnDkzvv71r8fo0aPjsssuiz179sTf/u3f+nt4Blu2bIn29vYYN25cvP766/EXf/EX8clP\nfjLmzp2b69HS5PATqXKivr4+M2rUqMygQYMylZWVmR/+8Ie5Hikvbd26NVNQUJApKCjIFBYWdt6e\nO3durkfLO7+5R7/69cADD+R6tLwzZ86czCWXXJIZNGhQZtiwYZkbbrghs2XLllyP1W/4uNnu3X77\n7ZkRI0ZkBg4cmLnooosyt9xyS2b//v25HitvPfvss5mJEydmzj333MzYsWMzq1evzvVIee2FF17I\nFBYWZnbt2pXrUfLaz3/+88yf//mfZ0aNGpUpLi7OVFRUZL72ta9lTp48mevR8tJTTz2VufTSSzOD\nBg3KlJWVZe65557M8ePHcz1WsoJMxnNUAABAmo/MeywAAID3j7AAAACSCQsAACCZsAAAAJIJCwAA\nIJmwAACMdhJLAAAAE0lEQVQAkgkLAAAgmbAAAACS/T/nedWRsLADlgAAAABJRU5ErkJggg==\n",
       "text": [
        "<matplotlib.figure.Figure at 0x7f3e1b1a59e8>"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "\n",
      "After 500 iterations we have lost all information, even though we were 100% sure that we started in position 1. Feel free to play with the numbers to see the effect of differing number of updates. For example, after 100 updates we have a small amount of information left.\n"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "And, if you are viewing this on the web or in IPython Notebook, here is an animation of that output.\n",
      "<img src=\"animations/02_no_info.gif\">"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Integrating Measurements and Movement Updates"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "The problem of losing information during an update may make it seem as if our system would quickly devolve into no knowledge. However, recall that our process is not an endless series of updates, but of *measure->update->measure->update->measure->update...* The output of the measure step is fed into the update. The update step, with a degraded certainty, is then fed into the measure step. \n",
      "\n",
      "Let's think about this intuitively. After the first measure->update round we have degraded the knowledge we gained by the measurement by a small amount. But now we take another measurement. When we try to incorporate that new measurement into our belief, do we become more certain, less certain, or equally certain. Consider a simple case - you are sitting in your office. A co-worker asks another co-worker where you are, and they report \"in his office\". You keep sitting there while they ask and answer \"has he moved\"? \"No\" \"Where is he\" \"In his office\". Eventually you get up and move, and lets say the person didn't see you move. At that time the questions will go \"Has he moved\" \"no\" (but you have!) \"Where is he\" \"In the kitchen\". Wow! At that moment the statement that you haven't moved conflicts strongly with the next measurement that you are in the kitchen. If we were modelling these with probabilities the probability that you are in your office would lowever, and the probability that you are in the kitchen would go up a little bit. But now imagine the subsequent conversation: \"has he moved\" \"no\" \"where is he\" \"in the kitchen\". Pretty quickly the belief that you are in your office would fade away, and the belief that you are in the kitchen would increase to near certainty. The belief that you are in the office will never go to zero, nor will the belief that you are in the kitchen ever go to 1.0 because of the chances of error, but in practice your co-workers would be correct to be quite confident in their system.\n",
      "\n",
      "That is what intuition tells us. What does the math tell us?\n",
      "\n",
      "Well, we have already programmed the measure step, and we have programmed the update step. All we need to do is feed the result of one into the other, and we will have programmed our dog tracker!!! Let's see how it performs. We will input data as if the dog started at position 0 and moved right at each update. However, as in a real world application, we will start with no knowledge and assign equal probability to all positions. "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "pos_belief = np.array([.1]*10)\n",
      "update(pos_belief, 1, .6, .2)\n",
      "print(pos_belief)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "[ 0.187  0.187  0.062  0.062  0.062  0.062  0.062  0.062  0.187  0.062]\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "predict(pos_belief, 1, .8, .1, .1)\n",
      "print(pos_belief)\n",
      "bp.bar_plot(pos_belief)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "[ 0.087  0.175  0.175  0.075  0.062  0.062  0.062  0.062  0.075  0.162]\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAxYAAAGNCAYAAACMgOcOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XFw1/V9+PFXEgQTi5wMwWBQiGVQEakSmUSq3g5zwzrK\npqJ0swXpHJm1YOaOpWXnVJRadmxACTrrAbOjxV17rqfMI54oZdAbEeKQgsNlQ3oh6WQWLCtwhO/v\nj17za0pIvvoOfL+Rx+OOu/D+fj75vvI+5Hzy/Xw/34JMJpMJAACABIW5HgAAAOj9hAUAAJBMWAAA\nAMmEBQAAkExYAAAAyYQFAACQTFgAAADJug2LTZs2xdSpU6OsrCwKCwtjzZo13X7TnTt3xk033RQl\nJSVRVlYWjz32WI8MCwAA5Kduw+LIkSNx9dVXx9KlS6O4uDgKCgq6PP7w4cNxyy23RGlpaTQ0NMTS\npUtj8eLFsWTJkh4bGgAAyC8FH+aTt/v37x8rVqyIL3zhC6c9ZuXKlVFbWxutra3Rr1+/iIh4/PHH\nY+XKlfGTn/wkfWIAACDv9Ph7LLZu3Rqf+cxn2qMiIqKqqiqam5tj3759Pf10AABAHujT09+wpaUl\nLrvssg5rQ4YMaX/s8ssvb18/dOhQTz89AABwhg0YMOCUtR5/xaK792AAAAAfPz0eFpdcckm0tLR0\nWGttbW1/DAAA+Pjp8UuhJk6cGPPnz49jx461v8+ivr4+Lr300g6XQf2mzl5OOVMaGhoiIqKiouKs\nPWdvZa+yZ6+yZ6+yZ68+HPuVPXuVPXuVPXuVvd64V929jSGr2802NjZGY2NjnDx5Mvbt2xeNjY2x\nf//+iIi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JBMWAAAAMmEBQAA\nkExYAAAAyYQFAACQTFgAAADJhAUAAJBMWAAAAMmEBQAAkExYAAAAyYQFAACQTFgAAADJhAUAAJBM\nWAAAAMmEBQAAkExYAAAAyYQFAACQTFgAAADJhAUAAJBMWAAAAMmEBQAAkExYAAAAyYQFAACQTFgA\nAADJhAUAAJBMWAAAAMmEBQAAkExYAAAAyYQFAACQTFgAAADJhAUAAJBMWAAAAMmEBQAAkExYAAAA\nybIKi7q6uhgxYkQUFxdHRUVFbN68Oatvvnfv3ujfv3/0798/aUgAACC/dRsW69ati3nz5sWCBQui\nsbExKisrY8qUKbF///4uzzt+/HjcfffdcdNNN0VBQUGPDQwAAOSfbsNiyZIlMWvWrJg9e3aMGjUq\nli1bFqWlpbFy5couz5s/f358+tOfjjvvvDMymUyPDQwAAOSfLsPi+PHjsX379qiqquqwXlVVFVu2\nbDnteS+99FK89NJLsXz5clEBAADngD5dPfjee+9FW1tbDBkypMP64MGDo6WlpdNzmpub47777osX\nXnghSkpKsh6koaEh62N7Si6es7eyV9mzV9mzV9mzVx+O/cqevcqevcqevcpeb9qrkSNHdvl4j98V\n6p577onq6uq47rrrevpbAwAAearLVywGDRoURUVF0dra2mG9tbU1SktLOz1n48aNsWnTpnjkkUci\nIiKTycTJkyfjvPPOi5UrV8aXvvSlTs+rqKj4KPN/JL8qw7P5nL2Vvcqevcqevcqevfpw7Ff27FX2\n7FX27FX2euNeHTp0qMvHuwyLvn37xvjx42PDhg1x++23t6/X19fHnXfe2ek5b731Voffv/DCC/H4\n44/Htm3bYujQodnODQAA9CJdhkVERE1NTdxzzz0xYcKEqKysjKeeeipaWlpizpw5ERFRW1sb27Zt\ni1deeSUiIq688soO5//bv/1bFBYWnrIOAAB8fHQbFtOnT4+DBw/GwoUL48CBAzF27NhYv359DBs2\nLCIiWlpaoqmpqcvv4XMsAADg463bsIiIqK6ujurq6k4fW7VqVZfnzpw5M2bOnPmhBwMAAHqPHr8r\nFAAAcO4RFgAAQDJhAQAAJB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+NPn36xOTJ\nk+P999/P9Wh5Z9iwYfGNb3wjduzYEW+88Ub87u/+bkybNi3efPPNXI+W1370ox/FM888E1dffbX/\nFk9j9OjR0dLS0v5r586duR4pL/3sZz+LG264IQoKCmL9+vWxZ8+e+OY3vxmDBw/O9Wh56Y033ujw\n52r79u1RUFAQd911V65HyztPPPFEPP3007F8+fJ4++23Y+nSpVFXVxeLFi3K9Wh56Utf+lLU19fH\nP/zDP8Rbb70VVVVVMXny5Ghubs71aGky55AJEyZk7rvvvg5rI0eOzNTW1uZoot7hE5/4RGbNmjW5\nHqPX+PnPf54pKirKvPjii7kepVcYOHBg5u///u9zPUbe+tnPfpa54oorMq+99lrm5ptvzjzwwAO5\nHinvPPzww5mrrroq12P0CrW1tZlJkybleoxea+HChZmLLrooc/To0VyPknduu+22zMyZMzusfeEL\nX8j8/u//fo4myl//93//l+nTp0/mBz/4QYf18ePHZxYsWJCjqXrGOfOKxfHjx2P79u1RVVXVYb2q\nqiq2bNmSo6n4ODp8+HCcPHkyLrroolyPktfa2triu9/9bhw9ejRuvPHGXI+Tt+677764884746ab\nboqMt8SdVlNTU1x66aVRXl4eM2bMiP/6r//K9Uh56YUXXogJEybEXXfdFUOGDIlrrrkmVqxYkeux\neoVMJhPPPvts/PEf/3H77fT5/6ZMmRKvvvpqvP322xER8eMf/zg2btwYt956a44nyz8nTpyItra2\nU/4cnX/++b3+Ev1u7wr1cfHee+9FW1tbDBkypMP64MGDT/lAP0gxd+7cuOaaa2LixIm5HiUv7dy5\nMyZOnBjHjh2L4uLieP7552PUqFG5HisvPfPMM9HU1BRr166NiHAZ1Glcf/31sWbNmhg9enS0trbG\nwoULo7KyMnbt2hUDBw7M9Xh5pampKerq6qKmpia++tWvxo4dO9rft3P//ffneLr8Vl9fH//93/8d\nf/Inf5LrUfLSn/3Zn8VPfvKT+NSnPhV9+vSJEydOxIIFC9o/noD/r3///jFx4sRYuHBhXHXVVTFk\nyJD4zne+Ez/60Y9i5MiRuR4vyTkTFnA21NTUxJYtW2Lz5s3+J/A0Ro8eHf/+7/8ehw4din/6p3+K\nu+++OzZu3BgVFRW5Hi2vvP322/G1r30tNm/eHEVFRRHxy38x9arFqX7v936v/eurrroqJk6cGCNG\njIg1a9a41flvOHnyZEyYMCEef/zxiIgYN25c7N27N1asWCEsuvHMM8/EhAkTYuzYsbkeJS8tW7Ys\nVq1aFd/97ndjzJgxsWPHjpg7d24MHz487r333lyPl3eee+65uPfee6OsrCyKiopi/PjxMWPGjHjj\njTdyPVqScyYsBg0aFEVFRdHa2tphvbW1NUpLS3M0FR8nDz74YDz//POxcePGGD58eK7HyVvnnXde\nlJeXR0TENddcE9u2bYsVK1bEqlWrcjxZftm6dWu89957MWbMmPa1tra2+OEPfxhPP/10HDlyJM47\n77wcTpi/SkpKYsyYMfHOO+/kepS8M3To0Ljyyis7rI0ePTrefffdHE3UO/z0pz+NH/zgB1FXV5fr\nUfLW448/HgsWLIjp06dHRMSYMWNi3759sWjRImHRifLy8njttdfiF7/4RRw+fDiGDBkSd911V1xx\nxRW5Hi3JOfMei759+8b48eNjw4YNHdbr6+ujsrIyR1PxcTF37txYt25dvPrqq/Hbv/3buR6nV2lr\na4uTJ0/meoy88wd/8Afx1ltvxZtvvhlvvvlmNDY2RkVFRcyYMSMaGxtFRReOHj0au3fv9o9Gnbjh\nhhtiz549Hdb+4z/+wz+GdGP16tVx/vnnx4wZM3I9St7KZDJRWNjxfysLCwu9ytqN4uLiGDJkSLz/\n/vuxYcOG+NznPpfrkZKcM69YRPzyMpV77rknJkyYEJWVlfHUU09FS0uL6/86ceTIkdi7d29E/PKl\n83379kVjY2P81m/9VvunrvNL999/f3z729+OF154IQYMGND+np3+/fvHBRdckOPp8stf/uVfxm23\n3RZlZWXxwQcfxNq1a+P111+Pl19+Odej5Z1ffdbHryspKYmLLrrolH9xPtc99NBDMXXq1Bg2bFj8\n9Kc/jcceeyx+8YtfxBe/+MVcj5Z3HnzwwaisrIwnnngipk+fHjt27Ijly5e7JWgXMplMfOtb34q7\n7747SkpKcj1O3po2bVp8/etfjxEjRsSVV14ZO3bsiL/927/13+FpbNiwIdra2mL06NHxzjvvxF/8\nxV/Epz71qZg1a1auR0uTwztS5URdXV1m+PDhmX79+mUqKioyP/zhD3M9Ul7auHFjpqCgIFNQUJAp\nLCxs/3rWrFm5Hi3v/OYe/erXI488kuvR8s7MmTMzl19+eaZfv36ZwYMHZ2655ZbMhg0bcj1Wr+F2\ns527++67M0OHDs307ds3c+mll2buuOOOzO7du3M9Vt566aWXMuPGjcucf/75mVGjRmWWL1+e65Hy\n2quvvpopLCzMbNu2Ldej5LWf//znmT//8z/PDB8+PFNcXJwpLy/PfO1rX8scO3Ys16Plpeeffz5z\nxRVXZPpNLH2HAAAAUUlEQVT165cpLS3NPPDAA5nDhw/neqxkBZmM16gAAIA058x7LAAAgDNHWAAA\nAMmEBQAAkExYAAAAyYQFAACQTFgAAADJhAUAAJBMWAAAAMn+HxOW0hpY7CSLAAAAAElFTkSuQmCC\n",
       "text": [
        "<matplotlib.figure.Figure at 0x7f3e37ae75f8>"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "So after the first update we have assigned a high probability to each door position, and a low probability to each wall position. The update step shifted these probabilities to the right, smearing them about a bit. Now let's look at what happens at the next sense."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "update(pos_belief, 1, .6, .2)\n",
      "print(pos_belief)\n",
      "bp.bar_plot(pos_belief)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "[ 0.157  0.313  0.104  0.045  0.037  0.037  0.037  0.037  0.134  0.097]\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAxYAAAGNCAYAAACMgOcOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X9w1/V9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2bdsWBQUF8eCDD+Z6\ntLzz7LPPxgsvvBDLli2L999/P5YsWRJVVVWxcOHCXI+Wl770pS9FdXV1/P3f/3289957UVFREePG\njYv9+/fnerQ0mUvI6NGjM48++miLtSFDhmTmzp2bo4k6h0984hOZ1atX53qMTuMXv/hFpqioKPPa\na6/lepROoXfv3pm/+7u/y/UYeevnP/955vrrr8+89dZbmbvuuiszY8aMXI+Ud5588snMjTfemOsx\nOoW5c+dmxo4dm+sxOq0FCxZkrrzyyszx48dzPUreuffeezNTpkxpsfaFL3wh8/u///s5mih//c//\n/E+mS5cumR/84Act1keNGpWZN29ejqbqGJfMHYuTJ0/Gtm3boqKiosV6RUVFbN68OUdTcTE6cuRI\nnD59Oq688spcj5LXmpqa4rvf/W4cP3487rjjjlyPk7ceffTReOCBB+LOO++MjJfEnVV9fX1cc801\nUVpaGpMnT47/+I//yPVIeenVV1+N0aNHx4MPPhj9+vWLm2++OZYvX57rsTqFTCYTL730UvzRH/1R\n89vp83/Gjx8fGzZsiPfffz8iIn784x/Hxo0b45577snxZPnn1KlT0dTUdMbvUffu3Tv9U/TbfVeo\ni8XBgwejqakp+vXr12K9b9++Z3ygH6SYOXNm3HzzzTFmzJhcj5KXduzYEWPGjIkTJ05EcXFxvPLK\nKzF06NBcj5WXXnzxxaivr481a9ZERHga1FncdtttsXr16hg2bFg0NjbGggULory8PHbu3Bm9e/fO\n9Xh5pb6+PqqqqmL27Nnx1a9+NbZv3978up3HHnssx9Plt+rq6vjP//zP+OM//uNcj5KX/vRP/zR+\n+tOfxqc+9ano0qVLnDp1KubNm9f88QT8n549e8aYMWNiwYIFceONN0a/fv3iO9/5TvzoRz+KIUOG\n5Hq8JJdMWMCFMHv27Ni8eXPU1NT4n8CzGDZsWPzbv/1bHD58OP7xH/8xHnroodi4cWOUlZXlerS8\n8v7778fXvva1qKmpiaKiooj41b+Yumtxpt/7vd9r/vrGG2+MMWPGxODBg2P16tXe6vzXnD59OkaP\nHh3PPPNMRESMHDky9uzZE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LMD3/4w1yPlJc2btyYKSgoyBQUFGQKCwubv546dWquR8s7v75H\nH/956qmncj1a3pkyZUrmuuuuy3Tr1i3Tt2/fzN13351Zv359rsfqNLzdbOseeuihTP/+/TNdu3bN\nXHPNNZk5UhZhAAAAs0lEQVT7778/s2vXrlyPlbdef/31zMiRIzPdu3fPDB06NLNs2bJcj5TXNmzY\nkCksLMxs3bo116PktV/84heZP/uzP8sMGjQoU1xcnCktLc187Wtfy5w4cSLXo+WlV155JXP99ddn\nunXrlikpKcnMmDEjc+TIkVyPlawgk3GPCgAASHPJvMYCAAA4f4QFAACQTFgAAADJhAUAAJBMWAAA\nAMmEBQAAkExYAAAAyYQFAACQ7H8BKbjls59fh/EAAAAASUVORK5CYII=\n",
       "text": [
        "<matplotlib.figure.Figure at 0x7f3e1b27d940>"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Notice the tall bar at position 1. This corresponds with the (correct) case of starting at position 0, sensing a door, shifting 1 to the right, and sensing another door. No other positions make this set of observations as likely. Now lets add an update and then sense the wall."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "predict(pos_belief, 1, .8, .1, .1)\n",
      "update(pos_belief, 0, .6, .2)\n",
      "bp.bar_plot(pos_belief)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAxYAAAGNCAYAAACMgOcOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XFw1/V9+PFXEgQSi5wMwSAoxDKoiFSJTCJVb4e5YR1l\np6J0swXpHJmlYOaO0bJzCkotOzaggM56wOxocdee6ynziAdKM+iNCHFIwWGzIT1IOpgFygoc4fv7\no9f8lhGSL30Hvt/I43HHHby/n08+r7wP0Cff7+f7LchkMpkAAABIUJjrAQAAgK5PWAAAAMmEBQAA\nkExYAAAAy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mxZrkfK\naxs3bswUFhZmtm3blutR8tovfvGLzJ/92Z9lBg8enCkuLs6UlZVlvva1r2VOnjyZ69Hy0iuvvJK5\n/vrrMz169MiUlpZmZs6cmTl69Giux0pWkMl4jgoAAEhzydxjAQAAXDjCAgAASCYsAACAZMICAABI\nJiwAAIBkwgIAAEgmLAAAgGTCAgAASPb/AN7Y5bPgh6s9AAAAAElFTkSuQmCC\n",
       "text": [
        "<matplotlib.figure.Figure at 0x7f3e1b313908>"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "This is exciting! We have a very prominent bar at position 2 with a value of around 35%. It is over twice the value of any other bar in the plot, and is about 4% larger than our last plot, where the tallest bar was around 31%. Let's see one more sense->update cycle."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "predict(pos_belief, 1, .8, .1, .1)\n",
      "update(pos_belief, 0, .6, .2)\n",
      "bp.bar_plot(pos_belief)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAxYAAAGNCAYAAACMgOcOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X901fV9+PFXEgSCRY4MwSAoxDKoiFSJTCJVzw7mDOso\nOypKN1uQzsEsBTN3GC07TkWpZYcNKKCzHmB2tLjTHtejzEM8oDSDnhEhDik4bDakJyQdzAJlBQ7J\n/f7hMd+lhOS6d+DewONxDueE9/188nnd9wEOz9xfBZlMJhMAAAAJCnM9AAAA0PUJCwAAIJmwAAAA\nkgkLAAAgmbAAAACSCQsAACCZsAAAAJJ1GBZbtmyJSZMmxaBBg6KwsDDWrl3b4TfdtWtX3H777dGr\nV68YNGhQPPXUU50yLAAAkJ86DIvjx4/HDTfcEEuXLo3i4uIoKCho9/ijR4/GnXfeGSUlJVFTUxNL\nly6NxYsXx5IlSzptaAAAIL8Uf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1Gp9zJgxmQUL\nFuRoqs5x0TxicerUqdixY0dUVFS0Wq+oqIitW7fmaCouREePHo3m5ua4/PLLcz1KXmtqaorvf//7\nceLEibjttttyPU7eevjhh+O+++6L22+/PTJeEndWdXV1cdVVV0VpaWlMnTo1/uM//iPXI+WlV155\nJcaOHRv3339/DBgwIG688cZYsWJFrsfqEjKZTLz44ovxR3/0Ry1vp8//N3HixNi0aVO89957ERHx\n05/+NDZv3hx33XVXjifLP6dPn46mpqYz/hz17Nmzyz9Fv8N3hbpQHDp0KJqammLAgAGt1vv373/G\nB/pBijlz5sSNN94Y48aNy/UoeWnXrl0xbty4OHnyZBQXF8fLL78cw4cPz/VYeemFF16Iurq6WLdu\nXUSEp0GdxS233BJr166NESNGRGNjYyxcuDDKy8tj9+7d0bdv31yPl1fq6upi5cqVUVlZGV//+tdj\n586dLa/beeSRR3I8XX6rqqqK//zP/4w//uM/zvUoeelP//RP4+c//3l85jOfiW7dusXp06djwYIF\nLR9PwP/Xu3fvGDduXCxcuDCuv/76GDBgQHzve9+Ln/zkJzFs2LBcj5fkogkLOB8qKytj69atUV1d\n7T+BZzFixIj4t3/7tzhy5Ej84z/+YzzwwAOxefPmKCsry/VoeeW9996Lb3zjG1FdXR1FRUUR8dFP\nTD1qcabf+73fa/n6+uuvj3HjxsXQoUNj7dq13ur8NzQ3N8fYsWPj6aefjoiI0aNHx759+2LFihXC\nogMvvPBCjB07NkaNGpXrUfLSsmXLYvXq1fH9738/Ro4cGTt37ow5c+bEkCFD4qGHHsr1eHnnpZde\nioceeigGDRoURUVFMWbMmJg6dWq8/fbbuR4tyUUTFv369YuioqJobGxstd7Y2BglJSU5mooLyaOP\nPhovv/xybN68OYYMGZLrcfLWJZdcEqWlpRERceONN8b27dtjxYoVsXr16hxPll+2bdsWhw4dipEj\nR7asNTU1xY9//ON4/vnn4/jx43HJJZfkcML81atXrxg5cmS8//77uR4l7wwcODCuu+66VmsjRoyI\nDz74IEcTdQ2/+MUv4kc/+lGsXLky16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AEgmLAAAgGTCAgAASPb/\nAB625bXnv+L8AAAAAElFTkSuQmCC\n",
       "text": [
        "<matplotlib.figure.Figure at 0x7f3e1b0be748>"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Here things have degraded a bit due to the long string of wall positions in the map. We cannot be as sure where we are when there is an undifferentiated line of wall positions, so naturally our probabilities spread out a bit."
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Finally, for those viewing this in a Notebook or on the web, here is an animation of that algorithm.\n",
      "<img src=\"animations/02_simulate.gif\">"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "The Effect of Bad Sensor Data"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "You may be suspicious of the results above because I always passed correct sensor data into the functions. However, we are claiming that this code implements a *filter* - it should filter out bad sensor measurements. Does it do that?\n",
      "\n",
      "To make this easy to program and visualize I will change the layout of the hallway to mostly alternating doors and hallways:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "hallway = [1, 0, 1, 0, 0, 1, 0, 1, 0, 0]\n",
      "pos_belief = np.array([.1]*10)\n",
      "measurements = [1, 0, 1, 0, 0]\n",
      "\n",
      "for m in measurements:\n",
      "    update(pos_belief, m, .6, .2)\n",
      "    predict(pos_belief, 1, .8, .1, .1)\n",
      "bp.bar_plot(pos_belief)\n",
      "print(pos_belief)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "[ 0.225  0.063  0.061  0.058  0.093  0.225  0.063  0.061  0.058  0.093]\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAxYAAAGNCAYAAACMgOcOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X901fV9+PFXEgQTixwZgk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BQVFcWYMWNi6tSp8fbbb+d6tCQXTFj069cvioqKorm5uc16c3NzlJaW5mgqziePPvpovPzyy7F+\n/foYMmRIrsfJWxdddFGUlZVFRMQNN9wQW7ZsiaVLl8by5ctzPFl+2bx5cxw4cCBGjhzZutbS0hI/\n/vGP4/nnn4+jR4/GRRddlMMJ81dJSUmMHDky3n///VyPkncGDhwY1157bZu1ESNGxAcffJCjibqH\nX/ziF/GjH/0oamtrcz1K3nr66adj7ty5MWXKlIiIGDlyZOzZsyfmz58vLNpRVlYWb775Zvz617+O\nw4cPx4ABA+K+++6La665JtejJblgXmPRs2fPGDNmTKxdu7bNel1dXVRUVORoKs4Xs2bNitWrV8e6\ndevit3/7t3M9TrfS0tISp06dyvUYeecP/uAP4t1334133nkn3nnnnWhoaIjy8vKYOnVqNDQ0iIoO\nHDt2LHbu3Okfjdpxyy23xK5du9qs/fu//7t/DOnEihUr4uKLL46pU6fmepS8lclkorCw7f9WFhYW\nepS1E8XFxTFgwID48MMPY+3atfGFL3wh1yMluWAesYj46GkqDzzwQIwdOzYqKiriueeei6amJs//\na8fRo0dj9+7dEfHRQ+d79uyJhoaG+K3f+q3WT13nIw8//HB897vfjVdeeSX69OnT+pqd3r17xyWX\nXJLj6fLLX/zFX8Rdd90VgwYNiiNHjsSqVavirbfeitdffz3Xo+Wdjz/r438rKSmJyy677LR/cb7Q\nPfbYYzFp0qQYPHhw/OIXv4innnoqfv3rX8eXv/zlXI+Wdx599NGoqKiIZ555JqZMmRLbtm2LJUuW\neEvQDmQymfjOd74T999/f5SUlOR6nLw1efLk+OY3vxlDhw6Na6+9NrZt2xZ/8zd/47/DM1i7dm20\ntLTEiBEj4v33348///M/j8985jMxffr0XI+WJofvSJUTtbW1mSFDhmR69eqVKS8vz/z4xz/O9Uh5\naf369ZmCgoJMQUFBprCwsPXr6dOn53q0vPObe/TxryeeeCLXo+WdadOmZa6++upMr169Mv3798/c\ncccdmbVr1+Z6rG7D28227/77788MHDgw07Nnz8yVV16ZueeeezI7d+7M9Vh567XXXsuMHj06c/HF\nF2eGDx+eWbJkSa5Hymvr1q3LFBYWZrZs2ZLrUfLar371q8yf/dmfZYYMGZIpLi7OlJWVZb7xjW9k\njh8/nuv0gQo+AAAAXklEQVTR8tLLL7+cueaaazK9evXKlJaWZh555JHM4cOHcz1WsoJMxmNUAABA\nmgvmNRYAAMDZIywAAIBkwgIAAEgmLAAAgGTCAgAASCYsAACAZMICAABIJiwAAIBk/w/4f+M2RB4y\n2gAAAABJRU5ErkJggg==\n",
       "text": [
        "<matplotlib.figure.Figure at 0x7f3e1b23c080>"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "At this point we have correctly identified the likely cases, we either started at position 0 or 5, because we saw the following sequence of doors and walls 1,0,1,0,0. But now lets inject a bad measurement, and see what happens:\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "update(pos_belief, m, .6, .2)\n",
      "predict(pos_belief, 1, .8, .1, .1)\n",
      "bp.bar_plot(pos_belief)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAxYAAAGNCAYAAACMgOcOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X901fV9+PFXEgQTixwZgkFQiGVQEakSmUSqnh3MGdZR\nNhWlmy1I58isBTN3GC07TkGpZYcNKEFnPcDsaHGnPa5HmYd4RCmDnhEhDik4XDakJySdzIJlBQ7J\n/f7hab5NCcm178C9gcfjHM4J7/v55PPK++g9eXJ/FWQymUwAAAAkKMz1AAAAQM8nLAAAgGTCAgAA\nSCYsAACAZMICAABIJiwAAIBkwgIAAEjWZVhs3rw5pkyZEkOGDInCwsJYu3Ztl990165dccstt0RJ\nSUkMGTIkFi5c2C3DAgAA+anLsDh69Ghce+21sWzZsiguLo6CgoJOjz9y5EjcdtttUVp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NxrpgzZ06sX78+Xnvttfjt\n3/7tXI/To7S0tERra2uux8g7f/AHfxBvv/12vPXWW/HWW29FfX19lJeXx/Tp06O+vl5UdOLYsWOx\nZ88e/2jUgZtuuin27t3bbu0//uM//GNIF9asWRMXXnhhTJ8+Pdej5K1MJhOFhe1/rSwsLPQoaxeK\ni4tj0KBB8cEHH8TGjRvjc5/7XK5HSnLePGIR8dHTVO67774YP358VFRUxNNPPx1NTU2e/9eBo0eP\nxr59+yLio4fO9+/fH/X19fFbv/VbbZ+6zkcefPDB+Pa3vx0vvvhi9OvXr+01O3379o2LLroox9Pl\nl7/8y7+MO+64I4YMGRIffvhhrFu3Lt5444145ZVXcj1a3vnlZ338qpKSkrjkkktO+Rfn890jjzwS\nU6ZMiaFDh8ZPf/rTWLhwYfziF7+IL37xi7keLe88/PDDUVFREU8++WRMmzYtdu7cGStWrPCWoJ3I\nZDLxrW99K+69994oKSnJ9Th5a+rUqfH1r389hg8fHldffXXs3Lkz/vZv/9b/h6excePGaGlpiVGj\nRsW7774bf/EXfxGf+tSnYubMmbkeLU0O35EqJ2pqajLDhg3L9OnTJ1NeXp754Q9/mOuR8tKmTZsy\nBQUFmYKCgkxhYWHb1zNnzsz1aHnn1/fol38ee+yxXI+Wd2bMmJG58sorM3369MkMHDgwc9ttt2U2\nbtyY67F6DG8327F77703M3jw4Ezv3r0zl19+eeauu+7K7NmzJ9dj5a2XX345M3bs2MyFF16YGTly\nZGbFihW5Himvvfbaa5nCwsLM9u3bcz1KXvv5z3+e+fM///PMsGHDMsXFxZmysrLM1772tczx48dz\nPVpeeuEge0CfAAAAWklEQVSFFzJXXXVVpk+fPpnS0tLMQw89lDly5Eiux0pWkMl4jAoAAEhz3rzG\nAgAAOHOEBQAAkExYAAAAyYQFAACQTFgAAADJhAUAAJBMWAAAAMmEBQAAkOz/AcPg0hjKRQE2AAAA\nAElFTkSuQmCC\n",
       "text": [
        "<matplotlib.figure.Figure at 0x7f3e1b194b00>"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "That one bad measurment appears to have significantly eroded our knowledge. However, note that our highest probabilities are still at 0 and 5, which is correct. Now let's continue with a series of correct measurements"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "measurements = [0, 1, 0, 1, 0, 0]\n",
      "\n",
      "for i,m in enumerate(measurements):\n",
      "    update(pos_belief, m, .6, .2)\n",
      "    predict(pos_belief, 1, .8, .1, .1)\n",
      "    plt.subplot(3, 2, i+1)\n",
      "    bp.bar_plot(pos_belief, title='step{}'.format(i+1))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAxYAAAGaCAYAAACSU9UtAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3XtUVOX+P/D3DPebJCkCSgppeiwjYbyNiFQ4HsrM4wWz\nrJgsA9NE8ns8dFSUSDPPYuUNvOQB82Thqb5aigrmhQgrCMcrGIlLTRhOkWJ4FvKVeX5/+GNyYmDA\ngZnZw/u1Fkt85tl7vwe38+Ez+zIyIYQAERERERGRGeTWDkBERERERNLHxoKIiIiIiMzGxoKIiIiI\niMzGxoKIiIiIiMzGxoKIiIiIiMzGxoKIiIiIiMzGxoKIiIiIiMzGxoK6hMjISMjlcly6dMlqGW7d\nuoU1a9ZArVbjkUcegbOzM+RyOTZt2mS1TERE1DFsoc6Ul5fj3XffRVRUFO677z64uLjA19cX0dHR\n+OKLL6yWi7oOR2sHILIUmUxm1e3X1dVhwYIFkMlk6NWrF/z9/XH58mWr5yIioo5h7dfzJUuWYOfO\nnRg0aBD+/Oc/o2fPnqioqMD//u//4sCBA1i4cCHeffddq2Yk+8YjFtRlCCFgzQ+a9/DwwL59+1BZ\nWYnKykqo1WqrZSEioo5n7Trz5z//GcXFxTh79iw2b96Mt99+Gx999BG+//57dOvWDf/4xz9w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sTb7zxhujX\nr59wc3MTwcHB4u9//7u4efOmxbPs3LlT3H///cLFxUX4+/uLefPmievXr1s8BxnHOnMb64xprDOs\nM3dinRFCJoQVj88QEREREZFdkMw1FkREREREZLvYWBARERERkdnYWBARERERkdnYWBARERERkdnY\nWBARERERkdnYWBARERERkdnYWBARERERkdnYWBARERERkdnYWBARERERkdnYWBARERERkdnYWFCX\nEBkZCblcjkuXLlktw+XLlzFnzhyMGDECfn5+cHV1RUBAAEaPHo2NGzeivr7eatmIiOju2UKNMeat\nt96CXC6HXC7HgQMHrB2HugA2FtRlyGQyq27//Pnz2LFjB7p3747Jkydj4cKFmDhxIn766SfMmTMH\nERERbC6IiCTK2jXmj4qKipCSkgJPT0/IZDKby0f2ydHaAYgsRQgBIYTVtj969Ghcu3at2fitW7eg\nUqlw5MgRfPTRR1Cr1VZIR0RE5rB2jbnTf//7X8ycOROjRo1CUFAQtm/fbu1I1EXwiAVJ3hdffIGo\nqCgEBAToTy8KDw/HypUrAQByuRz5+fkAgKCgIP1h4aCgIIP11NbWYunSpXjooYfg4eGBbt26YcyY\nMfjkk0+abfPIkSOQy+VQq9U4e/YsJk6cCB8fH3h6eiIiIgJffvlls2WcnJyM5nd0dMTTTz8NAKiq\nqjLrZ0FERB1LKjXmTgsXLkRVVRWysrJ4pIIsikcsSNI2b96MuLg4+Pn5YcKECfD19cUvv/yCM2fO\nYNOmTUhKSkJycjKysrJw8eJFJCQk4J577gEA/Z8AcOXKFTz66KP48ccfERERgfHjx6Ourg579+5F\nTEwMkpOTkZyc3Gz7Fy5cwOjRo/HII48gPj4eP/30E3bu3Inx48dj586dmDx5ssnn0NjYiJycHMhk\nMkRGRnbYz4aIiMwjxRqzb98+bNy4ERs2bEBwcHDn/XCIjBFEEhYaGipcXV3Ff/7zn2aP1dTU6L8f\nO3askMlk4uLFi0bX8/jjjwsHBwfx8ccfG4xfv35dhIaGCrlcLk6cOKEfP3z4sJDJZEImk4m//vWv\nBst8++23wtHRUdx7772irq6u2b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Yaw5TdabVIxbOzs4ICwtDbm6uwXheXl6LL9xCCMjlhqtt+rtOpzMZmIiI\nug7WGSIi+2HyVKjExERkZWVh69atKC0txfz586HVahEXFwcASEpKQlRUlH7+xIkTUVJSgrfeegvl\n5eUoKSmBWq3Gfffdh7CwsM57JkREJEmsM0RE9qHVU6EAICYmBjU1NUhNTUVVVRWGDBmCnJwcBAYG\nAgC0Wi0qKir088PDw5GdnY133nkH7777Ltzd3TFq1Cjs378fbm5unfdMiIhIklhniIjsg8nGAgDi\n4+MRHx9v9LHMzMxmY1OnTsXUqVPNS0ZERF0G6wwRkfR1+F2hiIiIiIio62FjQUREREREZmNjQURE\nREREZmNjQUREREREZmNjQUREREREZmNjQUREREREZmNjQUREREREZmtTY5Geno6goCC4ublBoVCg\noKDA5DLvvfceBg0aBFdXVwQEBCApKcnssEREZJ9YZ4iIpM/kB+RlZ2cjISEBGRkZCA8Px4YNGxAd\nHY2zZ8/qPxX1jxITE7F371784x//wJAhQ1BbW4uqqqoOD09ERNLHOkNEZB9MNhZpaWlQq9WYNWsW\nAGDt2rXYv38/MjIysGLFimbzz507h/Xr1+PUqVMYOHCgfjwkJKQDYxMRkb1gnSEisg+tngrV0NCA\nkpISqFQqg3GVSoXCwkKjy+zevRvBwcHIyclBcHAwgoKCEBsbi59//rnjUhMRkV1gnSEish8yIYRo\n6cHKykr06dMH+fn5CA8P14+npKRgx44dKCsra7ZMXFwctm3bhkceeQSrV68GACxcuBAAcOzYMchk\nMv3c2tpa/ffl5eXmPxsioi5swIAB+u+9vb2tmKTtWGeIiKTDVJ0xeSpUe+l0Oty8eRPbt29H//79\nAQDbt2/HwIEDUVxcjGHDhnX0JomIqAthnSEisk2tNhY9evSAg4MDqqurDcarq6vh7+9vdBl/f384\nOjrqX+wBoH///nBwcMClS5dafMFXKBRtClxcXNyu+Z3JVrIwB3NIIQdgO1nsNced785LBetM62wl\nC3MwhxRyALaTxV5zmKozrV5j4ezsjLCwMOTm5hqM5+XlQalUGl0mPDw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mCC\n",
       "text": [
        "<matplotlib.figure.Figure at 0x7f3e1b0241d0>"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "As you can see we quickly filtered out the bad sensor reading and converged on the most likely positions for our dog."
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Drawbacks and Limitations"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Do not be mislead by the simplicity of the examples I chose. This is a robust and complete implementation of a histogram filter, and you may use the code in real world solutions. If you need a multimodal, discrete filter, this filter works.\n",
      "\n",
      "With that said, while this filter is used in industry, it is not used often because it has several limitations. Getting around those limitations is the motivation behind the chapters in the rest of this book.\n",
      "\n",
      "The first problem is scaling. Our dog tracking problem used only one variable, $pos$, to denote the dog's position. Most interesting problems will want to track several things in a large space. Realistically, at a minimum we would want to track our dogs $(x,y)$ coordinate, and probably his velocity $(\\dot{x},\\dot{y})$ as well. We have not covered the multidimensional case, but instead of a histogram we use a multidimensional grid to store the probabilities at each discrete location. Each *sense()* and *update()* step requires updating all values in the grid, so a simple four variable problem would require $O(n^4)$ running time *per time step*. Realistic filters have 10 or more variables to track, leading to exhorbinant computation requirements.\n",
      "\n",
      "The second problem is that the histogram is discrete, but we live in a continuous world. The histogram requires that you model the output of your filter as a set of discrete points. In our dog in the hallway example, we used 10 positions, which is obviously far too few positions for anything but a toy problem. For example, for a 100 meter hallway you would need 10,000 positions to model the hallway to 1cm accuracy. So each sense and update operation would entail performing calculations for 10,000 different probabilities. It gets exponentially worse as we add dimensions. If our dog was roaming in a $100x100 m^2$ courtyard, we would need 100,000,000 bins ($10,000^2$) to get 1cm accuracy.\n",
      "\n",
      "A third problem is that the histogram is multimodal. This is not always a problem - an entire class of filters, the particle filters, are multimodal and are often used because of this property. But imagine if the GPS in your car reported to you that it is 40% sure that you are on D street, but 30% sure you are on Willow Avenue. I doubt that you would find that useful. Also, GPSs report their error - they might report that you are at $(109.878W, 38.326N)$ with an error of $9m$. There is no clear mathematical way to extract error information from a histogram. Heuristics suggest themselves to be sure, but there is no exact determination. You may or may not care about that while driving, but you surely do care if you are trying to send a rocket to Mars or track and hit an oncoming missle.\n",
      "\n",
      "This difficulty is related to the fact that the filter often does not represent what is physically occuring in the world. Consider this distribution for our dog:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "pos_belief = [0.2245871, 0.06288015, 0.06109133, 0.0581008, 0.09334062, \n",
      "              0.2245871, 0.06288015, 0.06109133, 0.0581008, 0.09334062]\n",
      "bp.bar_plot(pos_belief)  "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAxYAAAGNCAYAAACMgOcOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X901fV9+PFXEgQTixwZgkFQiGVQEakSmUSqnh3MGdZR\ndlSUbrYgnSOzFszcYWnZcSpKLTtsQAk66wFmR4s77XE9yjzEA0oZ9IwIcUjBYbMhPZB0MAuUFTiE\n+/3DY75LCcl178C9gcfjHM4J7/v55PPK++DFJ/dXQSaTyQQAAECCwlwPAAAAdH/CAgAASCYsAACA\nZMICAABIJiwAAIBkwgIAAEgmLAAAgGSdhsWGDRti0qRJMWjQoCgsLIyVK1d2+k23b98et912W5SU\nlMSgQYPiqaee6pJhAQCA/NRpWBw9ejSuv/76WLRoURQXF0dBQUGHxx8+fDjuuOOOKC0tjfr6+li0\naFEsWLAgFi5c2GVDAwAA+aXgk3zydu/evWPp0qXxpS996YzHLFu2LGpqaqK5uTl69eoVERFPP/10\nLFu2LH7+85+nTwwAAOSdLn+NxebNm+Nzn/tca1RERFRWVsa+fftiz549XX05AAAgD/To6m/Y1NQU\nV111VZu1AQMGtN529dVXt64fOnSoqy8PAACcZX369DltrcsfsejsNRgAAMD5p8vD4oorroimpqY2\na83Nza23AQAA558ufyr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qDzzwQIwdOzYqKiriueeei6amJs//\na8fRo0dj9+7dEfHRQ+d79uyJhoaG+K3f+q3WT13nIw8//HB897vfjVdeeSX69OnT+pqd3r17xyWX\nXJLj6fLLX/zFX8Rdd90VgwYNiiNHjsSqVavirbfeitdffz3Xo+Wdjz/r438rKSmJyy677LR/cb7Q\nPfbYYzFp0qQYPHhw/OIXv4innnoqfv3rX8eXv/zlXI+Wdx599NGoqKiIZ555JqZMmRLbtm2LJUuW\neEvQDmQymfjOd74T999/f5SUlOR6nLw1efLk+OY3vxlDhw6Na6+9NrZt2xZ/8zd/47/DM1i7dm20\ntLTEiBEj4v33348///M/j8985jMxffr0XI+WJofvSJUTtbW1mSFDhmR69eqVKS8vz/z4xz/O9Uh5\naf369ZmCgoJMQUFBprCwsPXr6dOn53q0vPObe/TxryeeeCLXo+WdadOmZa6++upMr169Mv3798/c\ncccdmbVr1+Z6rG7D28227/77788MHDgw07Nnz8yVV16ZueeeezI7d+7M9Vh567XXXsuMHj06c/HF\nF2eGDx+eWbJkSa5Hymvr1q3LFBYWZrZs2ZLrUfLar371q8yf/dmfZYYMGZIpLi7OlJWVZb7xjW9k\njh8/nuv0gQo+AAAAXklEQVTR8tLLL7+cueaaazK9evXKlJaWZh555JHM4cOHcz1WsoJMxmNUAABA\nmgvmNRYAAMDZIywAAIBkwgIAAEgmLAAAgGTCAgAASCYsAACAZMICAABIJiwAAIBk/w/4f+M2RB4y\n2gAAAABJRU5ErkJggg==\n",
       "text": [
        "<matplotlib.figure.Figure at 0x7f3e1b004a58>"
       ]
      }
     ],
     "prompt_number": 22
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      " The largest probabilities are in position 0 and position 5. This does not fit our physical intuition at all. A dog cannot be in two places at once (my dog Simon certainly tries - his food bowl and my lap often have equal allure to him). We would have to use heuristics to decide how to interpret this distribution, and there is usually no satisfactory answer. This is not always a weakness - a considerable amount of literature has been written on *Multi-Hypothesis Tracking (MHT)*. We cannot always distill our knowledge to one conclusion, and MHT uses various techniques to maintain multiple story lines at once, using backtracking schemes to go *back in time* to correct hypothesis once more information is known. This will be the subject of later chapters. In other cases we truly have a multimodal situation - we may be optically tracking pedestrians on the street and need to represent all of their positions. \n",
      " \n",
      "In practice it is the exponential increase in computation time that leads to the discrete Bayes filter being the least frequently used of all filters in this book. Many problems are best formulated as discrete or multimodal, but we have other filter choices with better performance. With that said, if I had a small problem that this technique could handle I would choose to use it; it is trivial to implement, debug, and understand, all virtues in my book."
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Generalizing to Multiple Dimensions"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": []
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Summary"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "The code is very small, but the result is huge! We will go into the math more later, but we have implemented a form of a Bayesian filter. It is commonly called a Histogram filter. The Kalman filter is also a Bayesian filter, and uses this same logic to produce its results. The math is a bit more complicated, but not by much. For now, we will just explain that Bayesian statistics compute the likelihood of the present based on the past. If we know there are two doors in a row, and the sensor reported two doors in a row, it is likely that we are positioned near those doors. Bayesian statistics just formalize that example, and Bayesian filters formalize filtering data based on that math by implementing the sense->update->sense->update process. \n",
      "\n",
      "We have learned how to start with no information and derive information from noisy sensors. Even though our sensors are very noisy (most sensors are more than 80% accurate, for example) we quickly converge on the most likely position for our dog. We have learned how the update step always degrades our knowledge, but the addition of another measurement, even when it might have noise in it, improves our knowledge, allowing us to converge on the most likely result.\n",
      "\n",
      "If you followed the math carefully you will realize that all of this math is exact. The bar charts that we are displaying are not an *estimate* or *guess* - they are mathematically exact results that exactly represent our knowledge. The knowledge is probabilistic, to be sure, but it is exact, and correct.\n",
      "\n",
      "However, we are a long way from tracking an airplane or a car. This code only handles the 1 dimensional case, whereas cars and planes operate in 2 or 3 dimensions. Also, our position vector is *multimodal*. It expresses multiple beliefs at once. Imagine if your GPS told you \"it's 20% likely that you are here, but 10% likely that you are on this other road, and 5% likely that you are at one of 14 other locations\". That would not be very useful information. Also, the data is discrete. We split an area into 10 (or whatever) different locations, whereas in most real world applications we want to work with continuous data. We want to be able to represent moving 1 km, 1 meter, 1 mm, or any arbitrary amount, such as 2.347 cm. \n",
      "\n",
      "Finally, the bar charts may strike you as being a bit less certain than we would want. A 25% certaintly may not give you a lot of confidence in the answer. Of course, what is important here is the ratio of this probability to the other probabilities in your vector. If the next largest bar is 23% then we are not very knowledgable about our position, whereas if the next largest is 3% we are in fact quite certain. But this is not clear or intuitive. However, there is an extremely important insight that Kalman filters implement that will signficantly improve our accuracy from the same data.\n",
      "\n",
      "\n",
      "**If you can understand this chapter you will be able to understand and implement Kalman filters.** I cannot stress this enough. If anything is murky, go back and reread this chapter and play with the code. The rest of this book will build on the algorithms that we use here. If you don't intuitively understand why this histogram filter works, and can't at least work through the math, you will have little success with the rest of the material. However, if you grasp the fundamental insight - multiplying probabilities when we measure, and shifting probabilities when we update, leading to a converging solution - then you understand everything important you need to grasp the Kalman filter. "
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "References"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      " * [1] D. Fox, W. Burgard, and S. Thrun. \"Monte carlo localization: Efficient position estimation for mobile robots.\" In *Journal of Artifical Intelligence Research*, 1999.\n",
      " \n",
      " http://www.cs.cmu.edu/afs/cs/project/jair/pub/volume11/fox99a-html/jair-localize.html\n",
      "\n",
      "\n",
      " * [2] Dieter Fox, et. al. \"Bayesian Filters for Location Estimation\". In *IEEE Pervasive Computing*, September 2003.\n",
      " \n",
      " http://swarmlab.unimaas.nl/wp-content/uploads/2012/07/fox2003bayesian.pdf\n",
      " \n",
      " \n",
      " * [3] Sebastian Thrun. \"Artificial Intelligence for Robotics\".\n",
      " \n",
      " https://www.udacity.com/course/cs373\n",
      " \n",
      " "
     ]
    }
   ],
   "metadata": {}
  }
 ]
}