Got PDF book working.

Converted format of all notebooks so they can be processed with nbconvert.
Wrote a build_book script that merges the notebook and creates book.pdf
This commit is contained in:
Roger Labbe committed 2014-05-26 19:31:32 -07:00
1 parent b9f4dbe85e
commit 9c63574e80
19 files changed
+11737 -1126

No files matched your search

+50 -18
View File
@@ -1,7 +1,7 @@
{
"metadata": {
"name": "",
"signature": "sha256:19fd5da8a72ab84659ebb5050018c8255375aa4b43f12f3bca2afe4505bd16c0"
"signature": "sha256:e2baeba25a3174dd9f44aa961606fbda4ef44c61e180085a8179c69f0e69bad4"
},
"nbformat": 3,
"nbformat_minor": 0,
@@ -9,10 +9,11 @@
{
"cells": [
{
"cell_type": "markdown",
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"<h1 align=\"center\">Designing Kalman Filters</h1>"
"Designing Kalman Filters"
]
},
{
@@ -251,23 +252,35 @@
"prompt_number": 2
},
{
"cell_type": "markdown",
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"#### Introduction\n",
"\n",
"In this chapter we will work through the design of several Kalman filters to gain experience and confidence with the various equations and techniques. \n",
"\n",
"For our first multidimensional problem we will track a robot in a 2D space, such as a field. We will start with a simple noisy sensor that outputs noisy $(x,y)$ coordinates which we will need to filter to generate a 2D track. Once we have mastered this concept, we will extend the problem significantly with more sensors and then adding control inputs. \n",
"blah blah\n"
"Introduction"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Tracking a Robot\n",
"In this chapter we will work through the design of several Kalman filters to gain experience and confidence with the various equations and techniques. \n",
"\n",
"For our first multidimensional problem we will track a robot in a 2D space, such as a field. We will start with a simple noisy sensor that outputs noisy $(x,y)$ coordinates which we will need to filter to generate a 2D track. Once we have mastered this concept, we will extend the problem significantly with more sensors and then adding control inputs. \n",
"blah blah"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Tracking a Robot"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This first attempt at tracking a robot will closely resemble the 1-D dog tracking problem of previous chapters. This will allow us to 'get our feet wet' with Kalman filtering. So, instead of a sensor that outputs position in a hallway, we now have a sensor that supplies a noisy measurement of position in a 2-D space, such as an open field. That is, at each time $T$ it will provide an $(x,y)$ coordinate pair specifying the measurement of the sensor's position in the field.\n",
"\n",
"Implemention of code to interact with real sensors is beyond the scope of this book, so as before we will program simple simuations in Python to represent the sensors. We will develop several of these sensors as we go, each with more complications, so as I program them I will just append a number to the function name. *pos_sensor1 ()* is the first sensor we write, and so on. \n",
@@ -519,7 +532,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Step 6: Design the Process Noise Matrix\n",
"##### Step 6: Design the Process Noise Matrix\n",
"Finally, we design the process noise. We don't yet have a good way to model process noise, so for now we will assume there is a small amount of process noise, say 0.1 for each state variable. Later we will tackle this admittedly difficult topic in more detail. We have 4 state variables, so we need a $4{\\times}4$ covariance matrix:\n",
"\n",
"$$\\mathbf{Q} = \\begin{bmatrix}0.1&0&0&0\\\\0&0.1&0&0\\\\0&0&0.1&0\\\\0&0&0&0.1\\end{bmatrix}$$\n",
@@ -554,7 +567,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"#### **Step 7**: Design Initial Conditions\n",
"##### **Step 7**: Design Initial Conditions\n",
"\n",
"For our simple problem we will set the initial position at (0,0) with a velocity of (0,0). Since that is a pure guess, we will set the covariance matrix $\\small\\mathbf{P}$ to a large value.\n",
"$$ \\mathbf{x} = \\begin{bmatrix}0\\\\0\\\\0\\\\0\\end{bmatrix}\\\\\n",
@@ -594,11 +607,18 @@
],
"prompt_number": 9
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Implement the Filter Code"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Implement the Filter Code\n",
"Design is complete, now we just have to write the Python code to run our filter, and output the data in the format of our choice. To keep the code clear, let's just print a plot of the track. We will run the code for 30 iterations."
]
},
@@ -834,12 +854,18 @@
"Finally, let's look at the lower left side of $\\small\\mathbf{P}$, which is all 0s. Why 0s? Consider $\\small\\mathbf{P}_{3,0}$. That stores the term $p\\sigma_3\\sigma_0$, which is the covariance between $\\dot{y}$ and $x$. These are independent, so the term will be 0. The rest of the terms are for similarly independent variables."
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Realistic 2D Position Sensors"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Realistic 2D Position Sensors\n",
"\n",
"The position sensor in the last example are not very realistic. In general there is no 'raw' sensor that provides (x,y) coordinates. We have GPS, but GPS already uses a Kalman filter to create a filtered output; we should not be able to improve the signal by passing it through another Kalman filter unless we incorporate additional sensors to provide additional information. We will tackle that problem later. \n",
"\n",
"Consider the following set up. In an open field we put two transmitters at a known location, each transmitting a signal that we can detect. We process the signal and determine how far we are from that signal, with some noise. First, let's look at a visual depiction of that."
@@ -1148,12 +1174,18 @@
],
"prompt_number": 18
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Linearizing the Kalman Filter"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Linearizing the Kalman Filter\n",
"\n",
"Now that we have seen an example of linearizing the Kalman filter we are in a position to better understand the math. \n",
"\n",
"We start by assuming some function $\\mathbf f$"
+59 -44
View File
@@ -1,7 +1,7 @@
{
"metadata": {
"name": "",
"signature": "sha256:e7d1e5240da92450e6d3790326c446f6c2b8d4ef9dd3aa3ae42956412e150699"
"signature": "sha256:33c57875ece7c340a1489961be89bf26faefec05e914f558690242db4a4be9a8"
},
"nbformat": 3,
"nbformat_minor": 0,
@@ -9,10 +9,11 @@
{
"cells": [
{
"cell_type": "markdown",
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"# The Extended Kalman Filter"
"The Extended Kalman Filter"
]
},
{
@@ -62,7 +63,6 @@
" } \n",
" h2 {\n",
" font-family: 'Open sans',verdana,arial,sans-serif;\n",
" text-indent:1em;\n",
" }\n",
" .text_cell_render h2 {\n",
" font-weight: 200;\n",
@@ -242,13 +242,13 @@
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 2,
"prompt_number": 1,
"text": [
"<IPython.core.display.HTML at 0x1cb1390>"
"<IPython.core.display.HTML at 0x2904910>"
]
}
],
"prompt_number": 2
"prompt_number": 1
},
{
"cell_type": "markdown",
@@ -259,10 +259,21 @@
"The early adopters of Kalman filters were the radar people, and this fact was not lost on them. Radar is inherently nonlinear. Radars measure the slant range to an object, and we are typically interested in the aircraft's position over the ground. We invoke Pythagoras and get the nonlinear equation:\n",
"$$x=\\sqrt{slant^2 - altitude^2}$$\n",
"\n",
"So shortly after the Kalman filter was enthusiastically taken up by the radar industry people began working on how to extend the Kalman filter into nonlinear problems. It is still an area of ongoing research, and in the Unscented Kalman filter chapter we will implement a powerful, recent result of that research. But in this chapter we will cover the most common form, the Extended Kalman filter, or EKF. Today, most real world \"Kalman filters\" are actually EKFs. The Kalman filter in your car's and phone's GPS is an EKF, for example. \n",
"\n",
"###The Problem with Nonlinearity\n",
"\n",
"So shortly after the Kalman filter was enthusiastically taken up by the radar industry people began working on how to extend the Kalman filter into nonlinear problems. It is still an area of ongoing research, and in the Unscented Kalman filter chapter we will implement a powerful, recent result of that research. But in this chapter we will cover the most common form, the Extended Kalman filter, or EKF. Today, most real world \"Kalman filters\" are actually EKFs. The Kalman filter in your car's and phone's GPS is an EKF, for example. "
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"The Problem with Nonlinearity"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You may not realize it, but the only math you really know how to do is linear math. Equations of the form \n",
"$$ A\\mathbf{x}=\\mathbf{b}$$.\n",
"\n",
@@ -272,10 +283,21 @@
"\n",
"That's nonlinear. But it is also a very special form. You spent a lot of time, probably at least a year, learning how to integrate various terms, and you still can not integrate some arbitrary equation - no one can. We don't know how. If you took freshman Physics you perhaps remember homework involving sliding frictionless blocks on a plane and other toy problems. At the end of the course you were almost entirely unequipped to solve real world problems because the real world is nonlinear, and you were taught linear, closed forms of equations. It made the math tractable, but mostly useless. \n",
"\n",
"The mathematics of the Kalman filter is beautiful in part due to the Gaussian equation being so special. It is nonlinear, but when we add and multipy it using linear algebra we get another Gaussian equation as a result. That is very rare. $\\sin{x}*\\sin{y}$ does not yield a $\\sin(\\cdot)$ as an output.\n",
"\n",
"### The Effect of Nonlinear Transfer Functions on Gaussians\n",
"\n",
"The mathematics of the Kalman filter is beautiful in part due to the Gaussian equation being so special. It is nonlinear, but when we add and multipy it using linear algebra we get another Gaussian equation as a result. That is very rare. $\\sin{x}*\\sin{y}$ does not yield a $\\sin(\\cdot)$ as an output."
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"The Effect of Nonlinear Transfer Functions on Gaussians"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Unfortunately Gaussians are not closed under an arbitrary nonlinear function. Recall the equations of the Kalman filter - at each step of its evolution we do things like pass the covariances through our process function to get the new covariance at time $k$. Our process function was always linear, so the output was always another Gaussian. Let's look at that on a graph. I will take an arbitrary Gaussian and pass it through the function $f(x) = 2x + 1$ and plot the result. We know how to do this analytically, but lets do this with sampling. I will generate 500,000 points on the Gaussian curve, pass it through the function, and then plot the results. I will do it this way because the next example will be nonlinear, and we will have no way to compute this analytically."
]
},
@@ -298,13 +320,13 @@
{
"metadata": {},
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAssAAAFyCAYAAAADJZf7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3V+MVOd9//HPzFlmjFlYQ4GyKJD2lwhoKSaGuKoDvcA0\nvXF80QsT1Reto1pFcm5yYam56UVvWlQ1Eq1EVKr0plIrmaruRchF1Lo3IbVWbYkQspQGR8HI9sC4\nDN75x5xn5sz8LpYz3j17Zndm9pk5z5nzfklRmMN692B/+c53n/2c58n1er2eAAAAAKyTT/oGAAAA\nAFcxLAMAAAADMCwDAAAAAzAsAwAAAAMwLAMAAAADMCwDAAAAA2w4LH/00Uc6e/asfu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ZMS2B+nWyipXPF+5otvV/GN9mC8QRk3ABE7wAzC2nLR06+HnXc1xcHqezToPMVmu1lV2/BhH\nAwBYDSvLsBp5M0QJ6qJQ84d6dPWwhA8xcdLioT8DmC8QRk3ABFaWASBmhVprZdmyZxMBAGJlGZYj\nb4awXNHVh7++FfcwjOqMZWD9mC8QRk3ABJplAGMlX/ZU8ltLsElpMsOxDACAPZiiYTXyZogyOzsr\niSYT3ZgvEEZNwATeagBYbxL2IE7KKjkAJA3NMqxG3gySHtuDuFAoxDia4XDS9p0+OG6YLxBGTcAE\nmmUAY8FJK/Gry7adPggAYOs4WI68GQKt7dU8+c1mO7OcRLmiq5mso21ZpudBMV8gjJqACawsAxgb\nhZovf6UpJy2rjrQ2KV/2VPE40Q8AbEGzDKuRN0Ou6D7WGD8ou2N3ah+Gj/kCYdQETKBZBmC14Djr\nzt0iptgzDgAwIrzjwGrkzRDo7I8zU8l/EC5XdFVyG3EPY6wwXyCMmoAJNMsArDMJ+yqvhewyANiB\nZhlWI282mcL7KoetJDSvXPH8xD64OArMFwijJmACexMBgCWWq/W4hwAACGFlGVYjb4Yo6fRkHQ1N\nfrk/zBcIoyZgAivLAKyxVk65c0eMSZIve0qlMhxUAgAxYGUZViNvNlnWyioHO2IkNbOMjWG+QBg1\nARNolgFYxUlLnr8S9zAAAJBEDAOWI282eQq11nZpmVW2Uk56Zrni+XzDsA7MFwijJmDCmivLr7/+\nuvbs2aNDhw617zmOoyNHjujIkSN67bXX2vcvXryoffv2af/+/bp06dKa9wEgkCu67QbRSaLine truncated
"text": [
"<matplotlib.figure.Figure at 0x2dabcd0>"
"<matplotlib.figure.Figure at 0x222e950>"
]
}
],
"prompt_number": 13
"prompt_number": 2
},
{
"cell_type": "markdown",
@@ -330,9 +352,9 @@
{
"metadata": {},
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAsUAAAF9CAYAAADsuhWdAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+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qXf/kXZWRkaMSIEfrVr37lc3vh/JEUI6ief/55PfbY\nY1q1apV27dqlq6++Wl/+8pd14MABn8+xdetWVVdXa+TIkbr77rtVU1Ojmpoaffe73+1z3Lp16zRl\nyhTt2LFDt9xyi772ta9p3759Zz33qXefa2pqVF1dLUl66qmnvNe5/vrr/fiJAUSy/Px81dTUaMuW\nLZKOj0snx5J58+b1OdbhcOi3v/2tmpubtWHDBm3atElz586VJNXV1WnOnDlav369Pv30U333u9/V\n7bffrrfeeqvPOX7zm9/oyiuv1Pbt2zVnzhzdeuutcrlc3te/9rWvKSEhQZs3b9aHH36o22+/Xd3d\n3d7X77nnHu94OnLkSG+sq1ev9h6zbNkyvfnmm/rd736n0tJSXX311br88stVVVXV7+e/7777tGjR\nIm3btk1/+tOfNGzYMJ/b7kxj8NnKJxwOR79vEc/VJr/4xS/0rW99S8uXL9euXbu0du3aPsmqL58F\n3/nOd7ztNtC3mI2Njbrmmms0bdo0bd++Xc8884xeeOEFPfHEE32OW7dunUaPHq2tW7fqhhtu0He+\n8x0dOXLE5zbDeTKAILrooouM2267rc++8ePHG/fee6932+FwGO+99553+/nnnzccDke/c40ePdp4\n9NFHB7zOggULjMmTJ/fZN2nSJOOee+4xDMMwDh48aDgcDqOiosL7+r//+78bo0eP7ncuh8Nh/Pa3\nv/XhpwOAgZ0cc04d2043atQoY9asWT6fc9asWcZ3vvMd7/aCBQuMG264wbu9detWw+FwGLt27fLu\nS0lJMVatWnXOc59pPNy7d6/hcDiMDz/8sM/+SZMmGf/xH//h3T758373u9/1+ec5kzONwc8//3y/\nGBcuXGjcfPPN3m1f2iQ3N9f413/910HHcaoztdsvfvELIy0tzXC5XN593//+943s7Gzv9je+8Q1j\nzpw53u1jx44ZDofDePXVV88ZG8zBnWIE1f79+3XBBRf02XfBBRec8w7uYEybNq3f9v79+02/DgCY\nweFw6HOf+9yAr3V0dOj+++/XtGnTlJmZqZSUFG3fvl3t7e193l9QUODdzszMlCQ1NDR4933rW9/S\nQw89p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+//rrcUYgUgcdsIiLXhtw+MXPmTMTGxjq3jxw5gvHj\nxyM+Ph6pqalITU3tdZccIm/i11BEvfGYTUTkmmhLshmNRiQnJ+OVV15BTEwMkpKSUFNT02dNWiJv\n+PDDD+WOQKRoPGYTEfUm+jrFPasI7N69m2fqiIgUjsdsIqIrRCuKhw0b5rw3OPD1WYhrvfmXd5Ac\nwzX5iEh9zGYzFi5cKHcMUbh7zN61a5fX158lIhKLJ8dt0YriadOm4cyZM6ivr4fZbMalS5cwceLE\nPq9LjolAbm6uWB8rua1bt/ZaR1DJ1JQVUFdeZpWOmvIWFhbKHUE07h6z4+LiVHXMlpua5rMScLyu\nrE/8RqER+SVNeOb2DKQYgl2+nmPmGU+O20MuilevXo09e/agoaEBqampeOmll7Bp0ybMmjULALB5\n8+ah7pqIiETGYzaR8tgcAjYfqkRFixmb78xCdEig3JH82pCL4q1bt2Lr1q19Hl+6dOl1BVKaaxcj\nVzI1ZQXUlZdZpaO2vGrlL8dsuXE+e8afx6vDYsev8i9Cr9PguQWZCAnse8OQ/vjzmElN9AvtfM3V\nd0BTOjVlBdSVl1mlo7a8RK5wPnvGX8erocOC9fvLMC4xDKtnpkCndf8iV38dM2/gbZ4HUV9fL3cE\nt6kpK6CuvMwqHbXlJXKF89kz/jhe5c1dWLP3AuZkROFHN3lWEAP+OWbewjPFRERERF5w4nIbnj1Y\njh/MGI55mTFyx6FrDPk2z0OVn5/PK5mJSJUKCwsxf/58uWN4FY/ZROI4WNKElz+vxhPzRmLyMC5N\n6y2eHLd5ppiIiIhIIoIgYNepWuz7qgG/WZCJ9JgQuSPRANhTPIiCggK5I7hNTVkBdeVlVumoLS+R\nK5zPnvH18bI7BPzxs0v4qLQZmxdniVIQ+/qYyYlniomIiIhE1mW1Y+OH5ei2CXhhURbC9OLine truncated
"text": [
"<matplotlib.figure.Figure at 0x2db2410>"
"<matplotlib.figure.Figure at 0x22bf3d0>"
]
}
],
@@ -364,9 +386,9 @@
{
"metadata": {},
"output_type": "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yy/Fk\nH/QCF5cv6xfqjQHhPsivYn0vERHJb3yvAEzsFYBntp+Dqcksdxwi6iTZa3qv9sIPWRgb54Line truncated
"text": [
"<matplotlib.figure.Figure at 0x4a8ac50>"
"<matplotlib.figure.Figure at 0x3f6bfd0>"
]
}
],
@@ -377,10 +399,10 @@
"metadata": {},
"source": [
"This result may be somewhat suprising to you. The transfer function looks \"fairly\" linear - it is pretty close to a straight line, but the probability distribution of the output is completely different from a Gaussian. Recall the equations for multiplying two univariate Gaussians:\n",
"$$\\begin{align*}\n",
"$$\\begin{aligned}\n",
"\\mu =\\frac{\\sigma_1^2 \\mu_2 + \\sigma_2^2 \\mu_1} {\\sigma_1^2 + \\sigma_2^2}\\mbox{, } \n",
"\\sigma = \\frac{1}{\\frac{1}{\\sigma_1^2} + \\frac{1}{\\sigma_2^2}}\n",
"\\end{align*}$$\n",
"\\end{aligned}$$\n",
"\n",
"These equations do not hold for non-Gaussians, and certainly do not hold for the probability distribution shown in the 'output' chart above. \n",
"\n",
@@ -403,9 +425,9 @@
{
"metadata": {},
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAr0AAAF9CAYAAAAJJNDxAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3Xl8U1XeP/BP0qR7mu57S1tKAaFsZaciq6MCKuqA28Og\ndnAAx8F1REVBR8VnXNDRwXFQEf3xuMIILqPsUvadghZooS20Tfe9pEuS3x/QSOmWpEnuuenn/Xrl\npTdJbz49vZyenvu95ypMJpMJREREREQuTCl1ACIiIiIiR+Ogl4iIiIhcHge9REREROTyOOglIiIi\nIpfHQS8RERERuTwOeomIiIjI5XHQS0RE1EMZDAY88MADCA4OhlKpxP333y9Zlu3bt2PgwIFwd3eH\nUqlEXl6eZFm6snTpUsTHx0sdg6zEQS8JLy4uDsuWLXP45yiVSqxZs8bhn0NErisnJwdKpRI///yz\n1FEs8vXXX+PTTz/Fhg0boNPp8NZbb0mW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tjunt6trl1sW2RyygrI\nK6+csgLyyiunrI7Mln22LdjjvPFyVeH5af3x5P8y0d/PHQMDPYTIZSlRszGXeZjL+oSc6W31f4mh\n+OFyOTamFuDTk4U2fa+2d/ASnZyyAvLKK6esgLzyyikricNe501/f3c8PCECq7+9jCpdc4/7i3w+\ni5qNuczDXNYn9KDXTaXEc9NiMD8xFNW6ZuzPqsApbY1N3qu4uNgmx7UFOWUF5JVXTlkBeeWVU1YS\nhz3Pm4kxfrihvy9e+i4LLT3U14l8PouajbnMw1zWJ/Sgt607EjQI8XbB95fK0diilzoOERE5oAev\nC4PeYMCGo/lSRyEiK+v16g1dsdWVwMfyqnAguxJLzbjKlojIXI66ekNXRF29QQoV9U14+MvzWDQ2\nHDfG2P6aEiLqPVP67F5fyGZvo8N9cKGkHhtTCwAATXoDHrwuTOJURETkKHzdnfH8tBg8/fVFhKtd\nMSCg5wvbiEh8silvaGvuiGDMTwzF/MRQ6PUGbEwtwAepBcgur7f4mCkpKVZMaFtyygrIK6+csgLy\nyiunrCQOqc6bQYEeWDo+Aqt2XUZ5fVOH10U+n0XNxlzmYS7rk+Wgt63fJIVjfmIopg30x8Line truncated
"text": [
"<matplotlib.figure.Figure at 0x2dbd650>"
"<matplotlib.figure.Figure at 0x3f6d910>"
]
}
],
@@ -432,19 +454,12 @@
"output_type": "stream",
"stream": "stdout",
"text": [
"input mean, variance: 0.0005, 0.9988\n",
"output mean, variance: -0.0285, 2.2400"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n"
"input mean, variance: 0.0013, 0.9985\n",
"output mean, variance: -0.0293, 2.2394\n"
]
}
],
"prompt_number": 9
"prompt_number": 6
},
{
"cell_type": "markdown",
@@ -469,20 +484,20 @@
{
"metadata": {},
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAr0AAAF9CAYAAAAJJNDxAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3Xl8U1X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Z/ExDh06\nhPz8fERGRmLx4sUwGAwwGAxYtGhRs8elpqaib9++OHbsGGbPno377rsPZ86caffYV88eGwwG5Ofn\nAwDeeust8+vcfffdVvzERNSd6XQ6GAwG7N+/H8CVfqmpLxk5cmSzxyoUCnz88ccoKyvD1q1bsXfv\nXowYMQIAUFBQgOHDh+PLL79ERkYGFi1ahLlz5+KHH35odox///vfuOWWW3D06FEMHz4cDz74IGpr\na83777vvPri7u2Pfvn04cOAA5s6di/r6evP+J5980tyfRkZGmrMuX77c/JhZs2bh+++/x/r165Ge\nno7bbrsNEyZMQG5ubouf/29/+xtuvPFGHDlyBP/9738REhJicdu11Qe3V96gUChafArYUZu8++67\nePjhh5GSkoITJ07gs88+azYYteRvwaOPPmput9Y+hSwpKcHEiRPRv39/HD16FKtWrcKaNWvwyiuv\nNHtcamoqevTogUOHDmH69Ol49NFHkZeXZ3GbkY1MRA6QlJRkmjNnTrP7evbsaVqyZIl5W6FQmHbs\n2GHe/uijj0wKhaLFsXr06GFaunRpq69zww03mPr06dPsvvj4eNOTTz5pMplMpvPnz5sUCoUpOzvb\nvP8f//iHqUePHi2OpVAoTB9//LEFPx0RUeua+pyr+7ZrRUdHmxITEy0+ZmJiounRRx81b99www2m\n6dOnm7cPHTpkUigUphMnTpjv8/b2Nr366qsdHrut/vD06dMmhUJhOnDgQLP74+PjTa+99pp5u+nn\nXbRokcU/T1va6oM/+uijFhnHjh1reuCBB8zblrRJWFiY6YknnrA5x9Xaard3333XpNVqTbW1teb7\nXnjhBVNwcLB5+89//rNp+PDh5u2ioiKTQqEwffXVVx1mo87hTC85xNmzZzFw4MBm9w0cOLDDGVhb\n9O/fv8X22bNn7f46RET2oFAoMHr06Fb3VVdX46mnnkL//v3h7+8Pb29vHD16FFVVVc2eHxcXZ972\n9/cHABQXF5vve/jhh/Hss89i/PjxeOaZZ7Bv3z6rMh45cgTAlTINb29v8+3s2bOtfmLX1s/TVTpq\nk0uXLsFgMOCGG25waI4zZ84gLi4Orq6u5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s2ACl8vdDslevXlAq\nlcjKysKqVaugVCqhVCrx/PPPW/YZP348Zs2ahXvuuQceHh6IiYnBF198YXn88qzLlV+TXf21lFKp\nhEqlAgA88MADlvfhrC8RWetyXxMTEwMAmDBhgqUvuXrWt1evXvjLX/6Cp556CiEhIfD09MT8+fMB\nABkZGZg+fTrCw8Ph5uaGfv36Yf369c2eP378eKxYsQL3338/vL29ERMTg6+++qrZPidPnsSkSZPg\n6+sLPz8/6HQ6HD9+3PL4c889B6VSib/85S/Q6/WWrFeWN9TV1WHFihWIjIyEl5cXRo8ejZ9++qnV\nn3vLli2488474e3tjcDAQHz44YdWt93lPrixsRHz5s2zZLncb2/YsKFFKcH48ePxwAMPdKhNAGD9\n+vUYMGAA3NzcoNVq8eSTT7bIAbT9t+CVV16x3N9WecP+/fsxYsQIuLu7IywsDMuXL0dDQ4Pl8blz\n52LOnDl47LHH4O/vjx49emDdunVWtxfZjoNecoiPPvoIL774Il555RWcPHkSt956K+68806cP3/e\n6tdITU1FXl4eIiMjsXz5chgMBhgMBixbtqzZflu2bMF1112H48ePY968ebjvvvtw5syZa772lbPH\nBoMBeXl5AIC33nrL8j4zZ87swE9MRN2ZVquFwWDAoUOHADT1S5f7klGjRjXbV6FQ4OOPP0ZZWRl2\n7dqFgwcPYuTIkQCAgoICjBgxAl9//TUyMjKwbNkyLFiwAP/973+bvcY///lP3HzzzTh27BhGjBiB\nBx98EEaj0fL4fffdB3d3d6SkpODw4cNYsGAB6uvrLY8/+eSTlv40MjLSknX16tWWfebOnYvvvvsO\nmzZtQlpaGm699VZMmTIFOTk5LX7+P//5z5gwYQKOHj2Kf//73wgNDbW67drqg69V3qBQKFp8C9he\nm7z77rtYsmQJkpKScPLkSXz++efNBqPW/C149NFHLe3W2reQJSUlmDp1KgYMGIBjx45h/fr12LBh\nA15++eVm+23ZsgW9evVCamoqZs2ahUcffRS5ublWtxnZyEzkAMOGDTPPnz+/2X2xsbHmFStWWLYV\nCoV5z549lu2PPvrIrFAoWr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mM1mZGVl4eOPP271teLi4vD9998jJycH\nRqOxxSf8s2fP4m9/+xtOnz6NF154AefOnUNSUhIAwNfXF3369MEnn3wCADh+/HirZ/Refp9t27ah\nsLAQRqORM8JE1GFhYWHw9vbGl19+idLSUhiNxhYzeNea0evbty8+//xz/PLLLzhx4gT++Mc/tujz\nzGbzNV+jvr4eCxcuxI8//ogLFy7ghx9+QGpqKoYMGWL1zxEXF4eZM2diwYIF2Lp1K86fP499+/bh\n8ccfx759+6x+HXsYMmQIysrK8J///AcA8OGHH7Y4ma69NgGAp59+GmvXrsVbb72FM2fO4PDhw1i6\ndGmL/a71t+DyyW2VlZVobGxEfn4+DAaDZZB77733Amhaczg9PR1ff/013n77bSxevLhZVpIGB73k\nEPPmzcNTTz2Fp556CgkJCdixYwe+/PJLy3I+APDGG2/g1KlTCA4Otizh0toM7EsvvQSlUom+ffvC\nw8MDL774ouUxhUKBGTNm4Pjx4xg8eDA+/PBDfPLJJ83qpd5//31s3boVISEhWLlyJe6///5WM7/z\nzju4cOECoqKi4OHhgU8//dSOLUJE3YFSqcT69euxc+dOhIaGwsPDo8Ug8VplXm+++SY8PT0xcuRI\nTJ06FWPGjMGIESNaPP/q17hyW6lUoqKiAnPnzkV8fDweeOAB3HvvvXj22WdbvF9rr3XZxo0bcd99\n9+Hxxx9Hv379MHv2bOTn50Or1Vr989iDVqvFa6+9hrlz5yIqKgonT55ssa5we20CAIsXL8a7776L\n9evXIyEhAdOnT2+1zOBafwsiIiIQERGBN954Azk5OQgPD0dERIRlqUx/f398/fXX+OWXXzB48GAk\nJSVhzpw5ePrpp6+ZlbqGwtyJjxwVFRXo27cvli1b1mIZKaKuMGHCBERHR3doTUii7op9NhF1Z52a\n6X3xxRcxbNgwfmIhyVjzlRYRNWGfTUTdmc2D3oyMDBQUFCAxMZGDDpIMvyYisg77bCLq7mwe9D71\n1FN47rnn7BiFqON2797N0gYiK7DPJqLuzqZB79dff424uDhERUVxxoCISHDss4mIbLw4xaFDh7B5\n82Z89dVXKCwshFKpREREBGbPnm3Z5/PPP+/ytfyIiOzFaDRi6tSpUsewC/bZROTsrOmzO7V6AwCs\nWrUK3t7eeOKJJ5rdv3PnTgwdOrT1YA0m7EgvhIeLCjfFBXbm7e1mzZo1zdbRE5mcsgLyyiunrIC8\n8sopKwD8/PPPmDRpktQx7M6WPltKthw3dY0mbDpqwLfpRXhoRAQmxwbYvfZf5ONZ1GzM1THM1THW\n9NmSrNPrplbijv7BOF1QjfdTcmCoqJUiBhEROSEXlRJzh0XgpZt7Y3NaAVb+9zwKquqkjkVEErOp\nvOFKf/3rX216nkKhwCNjopBTVotvThWisq4Rj+m07T/RQa5ebFtkcsoKyCuvnLIC8sorp6zOzNY+\nWyqdOW5igzzwzvQ4fH48H4u2ZmDe9RG4Oc4+s74iH8+iZmOujmEu+5P8imw9fF3x4PAe0KiUKJTw\nk/iVV/ASnZyyAvLKK6esgLzyyikriaOzx41GpcT9Q8Px91tjsf1UAZ7+zznkV3T+b43Ix7Oo2Zir\nY5jL/iQf9F42sbc/3kvJwSc/5+FobkWXv39BQUGXv6et5JQVkFdeOWUF5JVXTllJHPY6bqID3PH2\n7X0xMNwLS77KwNe/FsDUiVNaRD6eRc3GXB3DXPbX6fIGe4kP8cTTE3oBAN49kI20vEqEeLng5r5i\nnOhGRETyplIqMHtwGEb39MXre/XYm1mKx8dqEeHjKnU0IuoCnV69oS2dORN4Y2oeLlXWoVeAO8ZF\n+yHEy8XO6YiIrs1ZV29oi6irNzhKo8mMrScv4bPj+bhvSBim9w+Gkld3JJItYVdvaM9IrS8Swr3g\n7arCx6l52JFeiLxyrvBARET2oVIqcPfAUKy+PQ57M0uxbPsZZJcZpY5FRA4k5KA3LtgDN8Line truncated
"text": [
"<matplotlib.figure.Figure at 0x2dbd850>"
"<matplotlib.figure.Figure at 0x22d0210>"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"output mean, variance: 0.0003, 2.2552\n"
"output mean, variance: -0.0019, 2.2466\n"
]
}
],
"prompt_number": 14
"prompt_number": 7
},
{
"cell_type": "markdown",
@@ -511,12 +526,12 @@
"output_type": "stream",
"stream": "stdout",
"text": [
"linear output mean, variance: -0.0168, 7495.4511\n",
"nonlinear output mean, variance: -1.9141, 26283.7039\n"
"linear output mean, variance: -0.1088, 7470.5861\n",
"nonlinear output mean, variance: -2.0348, 26163.5214\n"
]
}
],
"prompt_number": 20
"prompt_number": 8
},
{
"cell_type": "markdown",
@@ -529,4 +544,4 @@
"metadata": {}
}
]
}
}
+59 -24
View File
@@ -1,7 +1,7 @@
{
"metadata": {
"name": "",
"signature": "sha256:a427f15c81a2e5dc1b63cffe28b59aea4fde72a3894132dda51749ce2cdd6035"
"signature": "sha256:0ed2a79c9b9a5af478fd7349a380e31cad560037d74dc59e4deeb96893227198"
},
"nbformat": 3,
"nbformat_minor": 0,
@@ -9,10 +9,11 @@
{
"cells": [
{
"cell_type": "markdown",
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"#Gaussian Probabilities"
"Gaussian Probabilities"
]
},
{
@@ -62,7 +63,6 @@
" } \n",
" h2 {\n",
" font-family: 'Open sans',verdana,arial,sans-serif;\n",
" text-indent:1em;\n",
" }\n",
" .text_cell_render h2 {\n",
" font-weight: 200;\n",
@@ -242,20 +242,26 @@
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 8,
"prompt_number": 1,
"text": [
"<IPython.core.display.HTML at 0x435e510>"
"<IPython.core.display.HTML at 0x1080350>"
]
}
],
"prompt_number": 8
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Introduction"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Introduction\n",
"\n",
"The last chapter ended by discussing some of the drawbacks of the Discrete Bayesian filter. For many tracking and filtering problems our desire is to have a filter that is *unimodal* and *continuous*. That is, we want to model our system using floating point math (continuous) and to have only one belief represented (unimodal). For example, we want to say an aircraft is at (12.34381, -95.54321,2389.5) where that is latitude, longitude, and altidue. We do not want our filter to tell us \"it might be at (1,65,78) or at (34,656,98)\" That doesn't match our physical intuition of how the world works, and as we discussed, it is prohibitively expensive to compute.\n",
"\n",
">So we desire a unimodal, continuous way to represent probabilities that models how the real world works, and that is very computationally efficient to calculate. As you might guess from the chapter name, Gaussian distributions provide all of these features.\n",
@@ -301,12 +307,18 @@
"<p>"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Nomenclature"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Nomenclature\n",
"\n",
"A bit of nomenclature before we continue - this chart depicts the probability of of a *random variable* having any value between ($-\\infty..\\infty)$. For example, for this chart the probability of the variable being 100 is roughly 2.7%, whereas the probability of it being 80 is around 1%.\n",
"> *Random variable* will be precisely defined later. For now just think of it as a variable that can 'freely' and 'randomly' vary. A dog's position in a hallway, air temperature, and a drone's height above the ground are all random variables. The position of the North Pole is not, nor is a sin wave (a sin wave is anything but 'free').\n",
"\n",
@@ -315,12 +327,18 @@
"You will see these distributions called *Gaussian distributions*, *normal distributions*, and *bell curves*. Bell curve is ambiguous because there are other distributions which also look bell shaped but are not Gaussian distributions, so we will not use it further in this book. But *Gaussian* and *normal* both mean the same thing, and are used interchangeably. I will use both throughout this book as different sources will use either term, and so I want you to be used to seeing both. Finally, as in this paragraph, it is typical to shorten the name and just talk about a *Gaussian* or *normal* - these are both typical shortcut names for the *Gaussian distribution*. "
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Gaussian Distributions"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Gaussian Distributions\n",
"\n",
"So let us explore how Gaussians work. A Gaussian is a *continuous probability distribution* that is completely described with two parameters, the mean ($\\mu$) and the variance ($\\sigma^2$). It is defined as:\n",
"$$ \n",
"f(x, \\mu, \\sigma) = \\frac{1}{\\sigma\\sqrt{2\\pi}} e^{-\\frac{1}{2}{(x-\\mu)^2}/\\sigma^2 }\n",
@@ -388,9 +406,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"So what does this curve *mean*? Assume for a moment that we have a themometer, which reads 22$\\,^{\\circ}C$. No thermometer is perfectly accurate, and so we normally expect that thermometer will read $\\pm$ that temperature by some amount each time we read it. Furthermore, a theorem called **Central Limit Theorem** states that if we make many measurements that the measurements will be normally distributed. If that is true, then this chart can be interpreted as a continuous curve depicting our belief that the temperature is any given temperature. In this curve, we assign a probability of the temperature being exactly $22\\,^{\\circ}C$ is $19.95%$. Looking to the right, we assign the probability that the temperature is $24\\,^{\\circ}C$ is $12.10%$. Because of the curve's symmetry, the probability of $20\\,^{\\circ}C$ is also $12.10%$.\n",
"So what does this curve *mean*? Assume for a moment that we have a themometer, which reads 22$\\,^{\\circ}C$. No thermometer is perfectly accurate, and so we normally expect that thermometer will read $\\pm$ that temperature by some amount each time we read it. Furthermore, a theorem called **Central Limit Theorem** states that if we make many measurements that the measurements will be normally distributed. If that is true, then this chart can be interpreted as a continuous curve depicting our belief that the temperature is any given temperature. In this curve, we assign a probability of the temperature being exactly 22$^{\\circ}C$ is $19.95\\%$. Looking to the right, we assign the probability that the temperature is 24$^{\\circ}C$ is $12.10\\%$. Because of the curve's symmetry, the probability of 20$^{\\circ}$C is also $12.10\\%$.\n",
"\n",
"So the mean ($\\mu$) is what it sounds like - the average of all possible probabilities. Because of the symmetric shape of the curve it is also the tallest part of the curve. The thermometer reads $22\\,^{\\circ}C$, so that is what we used for the mean. \n",
"So the mean ($\\mu$) is what it sounds like - the average of all possible probabilities. Because of the symmetric shape of the curve it is also the tallest part of the curve. The thermometer reads $22^{\\circ}C$, so that is what we used for the mean. \n",
"\n",
"> *Important*: I will repeat what I wrote at the top of this section: \"A Gaussian...is completely described with two parameters\"\n",
"\n",
@@ -441,7 +459,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"So what is this telling us? The blue gaussian is very narrow. It is saying that we believe $x=23$, and that we are very sure about that $(90%)$. In contrast, the red gaussian also believes that $x=23$, but we are much less sure about that $(18%)$. Our believe that $x=23$ is lower, and so our belief about the likely possible values for $x$ is spread out - we think it is quite likely that $x=20$ or $x=26$, for example. The blue gaussian has almost completely eliminated $22$ or $24$ as possible value - their probability is almost $0%$, whereas the red curve considers them nearly as likely as $23$.\n",
"So what is this telling us? The blue gaussian is very narrow. It is saying that we believe $x=23$, and that we are very sure about that $(90%)$. In contrast, the red gaussian also believes that $x=23$, but we are much less sure about that $(18%)$. Our believe that $x=23$ is lower, and so our belief about the likely possible values for $x$ is spread out - we think it is quite likely that $x=20$ or $x=26$, for example. The blue gaussian has almost completely eliminated $22$ or $24$ as possible value - their probability is almost $0\\%$, whereas the red curve considers them nearly as likely as $23$.\n",
"\n",
"If we think back to the thermometer, we can consider these three curves as representing the readings from three different thermometers. The blue curve represents a very accurate thermometer, and the red one represents a fairly inaccurate one. Green of course represents one in between the two others. Note the very powerful property the Gaussian distribution affords us - we can entirely represent both the reading and the error of a thermometer with only two numbers - the mean and the variance.\n",
"\n",
@@ -487,12 +505,18 @@
"<div style=\"border:1px dotted black;background-color:#DCDCDC#\">**Sidebar**: An equivalent formation for a Gaussian is $\\mathcal{N}(\\mu,1/\\tau)$ where $\\mu$ is the *mean* and $tau$ the *precision*. Here $1/\\tau = \\sigma^2$; it is the reciprocal of the variance. While we do not use this formulation in this book, it underscores that the variance is a measure of how precise our data is. A small variance yields large precision - our measurement is very precise. Conversely, a large variance yields low precision - our belief is spread out across a large area. You should become comfortable with thinking about Gaussians in these equivelant forms. Gaussians reflect our *belief* about a measurement, they express the *precision* of the measurement, and they express how much *variance* there is in the measurements. These are all different ways of stating the same fact.</div>"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Interactive Gaussians"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Interactive Gaussians\n",
"\n",
"For those that are reading this in IPython Notebook, here is an interactive version of the Gaussian plots. Use the sliders to modify $\\mu$ and $\\sigma^2$. Adjusting $\\mu$ will move the graph to the left and right because you are adjusting the mean, and adjusting $\\sigma^2$ will make the bell curve thicker and thinner."
]
},
@@ -535,12 +559,18 @@
],
"prompt_number": 7
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Computational Properties of the Gaussian"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Computational Properties of the Gaussian\n",
"\n",
"Recall how our discrete Bayesian filter worked. We had a vector implemented as a numpy array representing our belief at a certain moment in time. When we performed another measurement using the *sense()* function we had to multiply probabilities together, and when we performed the motion step using the *update()* function we had to shift and add probabilities. I've promised you that the Kalman filter uses essentially the same process, and that it uses Gaussians instead of histograms, so you might reasonable expect that we will be multipling, adding, and shifting Gaussians in the Kalman filter.\n",
"\n",
"A typical textbook would directly launch into a multipage proof of the behavior of Gaussians under these operations, but I don't see the value in that right now. I think the math will be much more intuitive and clear if we just start developing a Kalman filter using Gaussians. I will provide the equations for multiplying and shifting Gaussians at the appropriate time. You will then be able to develop a physical intuition for what these operations do, rather than be forced to digest a lot of fairly abstract math.\n",
@@ -548,20 +578,25 @@
"The key point, which I will only assert for now, is that all the operations are very simple, and that they preserve the properties of the Gaussian. This is somewhat remarkable, in that the Gaussian is a nonlinear function, and typically if you multiply a nonlinear equation with itself you end up with a different equation. For example, the shape of $sin(x)sin(x)$ is very different from $sin(x)$. But the result of multiplying two Gaussians is yet another Gaussian. This is a fundamental property, and the key reason why Kalman filters are possible."
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Summary and Key Points"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Summary and Key Points\n",
"\n",
"The following points **must** be understood by you before we continue:\n",
"\n",
"* Normal distributions occur throughout nature\n",
"* They express a continuous probability distribution\n",
"* They are completely described by two parameters: the mean ($\\mu$) and variance ($\\sigma^2$)\n",
"* $\\mu$ is the average of all possible values\n",
"* $\\sigma^2$ represents how much our measurements vary from the mean\n",
"\n"
"* $\\sigma^2$ represents how much our measurements vary from the mean"
]
}
],
+40 -52
View File
@@ -1,7 +1,7 @@
{
"metadata": {
"name": "",
"signature": "sha256:43816bf77f55adc378d6365759a668c72b08dfb5d8cb7c26ce484ba0c3ee9571"
"signature": "sha256:184a4be9b0e4d6e3e2d860c8cea84921dd9917218e5400547215445113b16d1c"
},
"nbformat": 3,
"nbformat_minor": 0,
@@ -9,10 +9,11 @@
{
"cells": [
{
"cell_type": "markdown",
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"#Kalman Filter Math"
"Kalman Filter Math"
]
},
{
@@ -62,7 +63,6 @@
" } \n",
" h2 {\n",
" font-family: 'Open sans',verdana,arial,sans-serif;\n",
" text-indent:1em;\n",
" }\n",
" .text_cell_render h2 {\n",
" font-weight: 200;\n",
@@ -244,7 +244,7 @@
"output_type": "pyout",
"prompt_number": 1,
"text": [
"<IPython.core.display.HTML at 0x17ee690>"
"<IPython.core.display.HTML at 0x284b910>"
]
}
],
@@ -259,30 +259,35 @@
"blah blah blah"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Walking Through the Kalman Filter Equations"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"###Walking Through the Kalman Filter Equations\n",
"I promised that you would not have to understand how to derive Kalman filter equations, and that is true. However, I do think it is worth walking through the equations one by one and becoming familiar with the variables. If this is your first time through the material feel free to skip ahead to the next section. However, you will eventually want to work through this material, so why not now? You will need to have passing familarity with these equations to read material written about the Kalman filter, as they all presuppose that you are familiar with the equations. I will reiterate them here for easy reference.\n",
"\n",
"\n",
"$$\n",
"\\begin{align}\n",
"\\begin{aligned}\n",
"\\text{Predict Step}\\\\\n",
"\\mathbf{x}' &= \\mathbf{F x} + \\mathbf{B u}\\tag{1} \\\\\n",
"\\mathbf{P} &= \\mathbf{FP{F}}^T + \\mathbf{Q}\\tag{2} \\\\\n",
"\\mathbf{x}' &= \\mathbf{F x} + \\mathbf{B u}\\;\\;\\;\\;&(1) \\\\\n",
"\\mathbf{P} &= \\mathbf{FP{F}}^T + \\mathbf{Q}\\;\\;\\;\\;&(2) \\\\\n",
"\\\\\n",
"\\text{Update Step}\\\\\n",
"\\mathbf{\\gamma} &= \\mathbf{z} - \\mathbf{H x}\\tag{3} \\\\\n",
"\\mathbf{K}&= \\mathbf{PH}^T (\\mathbf{HPH}^T + \\mathbf{R})^{-1}\\tag{4} \\\\\n",
"\\mathbf{x}&=\\mathbf{x}' +\\mathbf{K\\gamma}\\tag{5} \\\\\n",
"\\mathbf{P}&= (\\mathbf{I}-\\mathbf{KH})\\mathbf{P}\\tag{6}\n",
"\\end{align}\n",
"\\mathbf{\\gamma} &= \\mathbf{z} - \\mathbf{H x}\\;\\;\\;\\;&(3) \\\\\n",
"\\mathbf{K}&= \\mathbf{PH}^T (\\mathbf{HPH}^T + \\mathbf{R})^{-1}\\;\\;\\;\\;&(4) \\\\\n",
"\\mathbf{x}&=\\mathbf{x}' +\\mathbf{K\\gamma}\\;\\;\\;\\;&(5) \\\\\n",
"\\mathbf{P}&= (\\mathbf{I}-\\mathbf{KH})\\mathbf{P}\\;\\;\\;\\;&(6)\n",
"\\end{aligned}\n",
"$$\n",
"\n",
"\n",
"\n",
"I will start with the measurement step, as that is what we started with in the one dimensional Kalman filter case. Our first equation is\n",
"\n",
"$$\n",
@@ -321,7 +326,7 @@
"\n",
"The next line is the formidable:\n",
"\n",
"$$\\mathbf{K}= \\mathbf{PH}^T (\\mathbf{HPH}^T + \\mathbf{R})^{-1}$$\n",
"$$\\mathbf{K}= \\mathbf{PH}^T (\\mathbf{HPH}^T + \\mathbf{R})^{-1}\\tag{4}$$\n",
"\n",
"Unfortunately it is a fair amount of linear algebra to derive this. The derivation can be quite elegant, and I urge you to look it up if you have the mathematical education to follow it. But $\\mathbf{K}$ is just the *Kalman gain* - the ratio of how much measurement vs prediction we should use to create the new estimate. $\\mathbf{R}$ is the *measurement noise*, and $\\mathbf{P}$ is our *uncertainty covariance matrix*.\n",
"\n",
@@ -338,62 +343,45 @@
"\n",
"In other words, the *Kalman gain* equation is doing nothing more than computing a ratio based on how much we trust the prediction vs the measurement. If we are confident in our measurements and unconfident in our predictions $\\mathbf{K}$ will favor the measurement, and vice versa. The equation is complicated because we are doing this in multiple dimensions via matrices, but the concept is simple - scale by a ratio.\n",
"\n",
"Without going into the derivation of $\\mathbf{K}$, I'll say that this equation is the result of finding a value of $\\mathbf{K}$ that optimizes the *mean-square estimation error*. It does this by finding the minimal values for $\\mathbf{P}$ along it's diagonal. Recall that the diagonal of $P$ is just the variance for each state variable. So, this equation for $\\mathbf{K}$ ensures that the Kalman filter output is optimal. To put this in concrete terms, for our dog tracking problem this means that the estimates for both position and velocity will be optimal - a value of $\\mathbf{K}$ that made the position extremely accurate but the velocity very inaccurate would be rejected in favor of a $\\mathbf{K}$ that made both position and velocity just somewhat accurate.\n",
"\n",
"\n",
"Without going into the derivation of $\\mathbf{K}$, I'll say that this equation is the result of finding a value of $\\mathbf{K}$ that optimizes the *mean-square estimation error*. It does this by finding the minimal values for $\\mathbf{P}$ along it's diagonal. Recall that the diagonal of $P$ is just the variance for each state variable. So, this equation for $\\mathbf{K}$ ensures that the Kalman filter output is optimal. To put this in concrete terms, for our dog tracking problem this means that the estimates for both position and velocity will be optimal - a value of $\\mathbf{K}$ that made the position extremely accurate but the velocity very inaccurate would be rejected in favor of a $\\mathbf{K}$ that made both position and velocity just somewhat accurate."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Our next line is:\n",
" $$\\mathbf{x}=\\mathbf{x}' +\\mathbf{K\\gamma}$$\n",
" $$\\mathbf{x}=\\mathbf{x}' +\\mathbf{K\\gamma}\\tag{5}$$\n",
"\n",
"This just multiplies the residual by the Kalman gain, and adds it to the state variable. In other words, this is the computation of our new estimate.\n",
"\n",
"Finally, we have:\n",
"\n",
"$$\\mathbf{P}=(\\mathbf{I}-\\mathbf{KH})\\mathbf{P}$$\n",
"$$\\mathbf{P}=(\\mathbf{I}-\\mathbf{KH})\\mathbf{P}\\tag{6}$$\n",
"\n",
"$I$ is the identity matrix, and is the way we represent $1$ in multiple dimensions. $H$ is our measurement function, and is a constant. So, simplified, this is simply $P = (1-cK)P$. $K$ is our ratio of how much prediction vs measurement we use. So, if $K$ is large then $(1-cK)$ is small, and P will be made smaller than it was. If $K$ is small, then $(1-cK)$ is large, and P will be made larger than it was. So we adjust the size of our uncertainty by some factor of the *Kalman gain*. I would like to draw your attention back to the g-h filter, which included this Python code:\n",
"\n",
" # update filter \n",
" w = w * (1-scale_factor) + z * scale_factor\n",
"\n",
"This multidimensional Kalman filter equation is partially implementing this calculation for the variance instead of the state variable.\n",
"\n",
"This multidimensional Kalman filter equation is partially implementing this calculation for the variance instead of the state variable."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now we have the measurement steps. The first equation is\n",
"\n",
"$$\\mathbf{x}' = \\mathbf{Fx} + \\mathbf{Bu}$$\n",
"$$\\mathbf{x}' = \\mathbf{Fx} + \\mathbf{Bu}\\tag{1}$$\n",
"\n",
"This is just our state transition equation which we have already discussed. $\\mathbf{Fx}$ multiplies $\\mathbf{x}$ with the state transition matrix to compute the next state. $B$ and $u$ add in the contribution of the control input $\\mathbf{u}$, if any.\n",
"\n",
"The final equation is:\n",
"$$\\mathbf{P} = \\mathbf{FPF}^T + \\mathbf{Q}$$\n",
"$$\\mathbf{P} = \\mathbf{FPF}^T + \\mathbf{Q}\\tag{2}$$\n",
"\n",
"$\\mathbf{FPF}^T$ is the way we put $\\mathbf{P}$ into the process space using linear algebra so that we can add in the process noise $\\mathbf{Q}$ to it."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 0
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 0
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
+157 -47
View File
@@ -1,7 +1,7 @@
{
"metadata": {
"name": "",
"signature": "sha256:2d974c6ade3fc545dc4a52ec25342de94ed86181f0c1f6214bef7e63fff5b565"
"signature": "sha256:3b30412bf2631dd597e1e619df3837d5c18dcb65903323a2b7bc4a1c899a076a"
},
"nbformat": 3,
"nbformat_minor": 0,
@@ -9,10 +9,11 @@
{
"cells": [
{
"cell_type": "markdown",
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"#Kalman Filters"
"Kalman Filters"
]
},
{
@@ -62,7 +63,6 @@
" } \n",
" h2 {\n",
" font-family: 'Open sans',verdana,arial,sans-serif;\n",
" text-indent:1em;\n",
" }\n",
" .text_cell_render h2 {\n",
" font-weight: 200;\n",
@@ -244,26 +244,39 @@
"output_type": "pyout",
"prompt_number": 1,
"text": [
"<IPython.core.display.HTML at 0xe448d0>"
"<IPython.core.display.HTML at 0x10d8850>"
]
}
],
"prompt_number": 1
},
{
"cell_type": "markdown",
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"## One Dimensional Kalman Filters\n",
"One Dimensional Kalman Filters"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now that we understand the histogram filter and Gaussians we are prepared to implement a 1D Kalman filter. We will do this exactly as we did the histogram filter - rather than going into the theory we will just develop the code step by step. But first, let's set the book style."
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Tracking A Dog"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#Tracking A Dog\n",
"\n",
"As in the histogram chapter we will be tracking a dog in a long hallway at work. However, in our latest hackathon someone created an RFID tracker that provides a reasonable accurate position for our dog. Suppose the hallway is 100m long. The sensor returns the distance of the dog from the left end of the hallway. So, 23.4 would mean the dog is 23.4 meters from the left end of the hallway.\n",
"\n",
"Naturally, the sensor is not perfect. A reading of 23.4 could correspond to a real position of 23.7, or 23.0. However, it is very unlikely to correspond to a real position of say 47.6. Testing during the hackathon confirmed this result - the sensor is reasonably accurate, and while it had errors, the errors are small. Futhermore, the errors seemed to be evenly distributed on both sides of the measurement; a true position of 23m would be equally likely to be measured as 22.9 as 23.1.\n",
@@ -480,13 +493,19 @@
"You may not have a full understanding of the exact *meaning* of a noise value of 100.0, but as it turns out if you multiply *randn()* with a number $n$, the result is just a normal distribution with $\\sigma = \\sqrt{n}$. So the example with noise = 100 is using the normal distribution $\\mathcal{N}(0,100)$. Recall the notation for a normal distribution is $\\mathcal{N}(\\mu,\\sigma^2)$. If the square root is confusing, recall that normal distributions use $\\sigma^2$ for the variance, and $\\sigma$ is the standard deviation, which we do not use in this book. DogSensor.<code><code>\\_\\_init__()</code> takes the square root of the noise setting so that the *noise &ast; randn()* call properly computes the normal distribution."
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Math with Gaussians"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Math with Gaussians\n",
"\n",
"Let's say we believe that our dog is at 23m, and the variance is 5, or $pos_{dog}=\\mathcal{N}(23,5)$). We can represent that in a plot:\n"
"Let's say we believe that our dog is at 23m, and the variance is 5, or $pos_{dog}=\\mathcal{N}(23,5)$). We can represent that in a plot:"
]
},
{
@@ -590,10 +609,10 @@
"\n",
"In other words the result is a Gaussian with \n",
"\n",
"$$\\begin{align*}\n",
"$$\\begin{aligned}\n",
"\\mu &=\\frac{\\sigma_1^2 \\mu_2 + \\sigma_2^2 \\mu_1} {\\sigma_1^2 + \\sigma_2^2}, \\\\\n",
"\\sigma &= \\frac{1}{\\frac{1}{\\sigma_1^2} + \\frac{1}{\\sigma_2^2}}\n",
"\\end{align*}$$"
"\\end{aligned}$$"
]
},
{
@@ -765,32 +784,38 @@
"$\\sigma_1^2=0$, yielding\n",
"\n",
"$$\n",
"\\begin{align*}\n",
"\\begin{aligned}\n",
"\\mu&=\\frac{0*\\mu_2 + \\sigma_2^2 \\mu_1} { \\sigma_2^2}, \\\\\n",
"\\text{or just}\\\\\n",
"\\mu&=\\mu_1\n",
"\\end{align*}\n",
"\\end{aligned}\n",
"$$\n",
"\n",
"Finally, if we set $\\sigma_1^2 = 9\\sigma_2^2$, then the resulting equation is\n",
"\n",
"$$\n",
"\\begin{align*}\n",
"\\begin{aligned}\n",
"\\mu&=\\frac{9 \\sigma_2^2 \\mu_2 + \\sigma_2^2 \\mu_1} {9 \\sigma_2^2 + \\sigma_2^2} \\\\\n",
"\\text{or just}\\\\\n",
"\\mu&= \\frac{1}{10} \\mu_1 + \\frac{9}{10} \\mu_2\n",
"\\end{align*}\n",
"\\end{aligned}\n",
"$$\n",
"\n",
"This again fits our physical intuition of favoring the second, accurate scale over the first, inaccurate scale."
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Implementing the Sensing Step"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Implementing the Sensing Step\n",
"\n",
"Recall the histogram filter uses a numpy array to encode our belief about the position of our dog at any time. That array stored our belief of our dog's position in the hallway using 10 discrete positions. This was very crude, because with a 100m hallway that corresponded to positions 10m apart. It would have been trivial to expand the number of positions to say 1,000, and that is what we would do if using it for a real problem. But the problem remains that the distribution is discrete and multimodal - it can express strong belief that the dog is in two positions at the same time.\n",
"\n",
"Therefore, we will use a single Gaussian to reflect our current belief of the dog's position. In other words, we will use $dog_{pos} = \\mathcal{N}(\\mu,\\sigma^2)$. Gaussians extend to infinity on both sides of the mean, so the single Gaussian will cover the entire hallway. They are unimodal, and seem to reflect the behavior of real-world sensors - most errors are small and clustered around the mean. Here is the entire implementation of the sense function for a Kalman filter:"
@@ -892,12 +917,18 @@
"Mathematically it makes sense as well. Recall the computation for the variance after the multiplication: $\\sigma^2 = 1/(\\frac{1}{{\\sigma}_1} + \\frac{1}{{\\sigma}_2})$. We take the reciprocals of the sigma from the measurement and prior belief, add them, and take the reciprocal of the result. Think about that for a moment, and you will see that this will always result in smaller numbers as we proceed."
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Implementing Updates"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"###Implementing Updates\n",
"\n",
"That is a beautiful result, but it is not yet a filter. We assumed that the dog was sitting still, an extremely dubious assumption. Certainly it is a useless one - who would need to write a filter to track nonmoving objects? The histogram used a loop of sense and update functions, and we must do the same to accomodate movement.\n",
"\n",
"How how do we perform the update function with gaussians? Recall the histogram method:\n",
@@ -1187,12 +1218,18 @@
"> Before I go on, I want to emphasize that this code fully implements a 1D Kalman filter. If you have tried to read the literatue, you are perhaps surprised, because this looks nothing like the complex, endless pages of math in those books. To be fair, the math gets a bit more complicated in multiple dimensions, but not by much. So long as we worry about *using* the equations rather than *deriving* them we can create Kalman filters without a lot of effort. Moreover, I hope you'll agree that you have a decent intuitive grasp of what is happening. We represent our beliefs with Gaussians, and our beliefs get better over time because more measurement means more data to work with. \"Measure twice, cut once!\""
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Relationship to the g-h Filter"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Relationship to the g-h Filter\n",
"\n",
"In the first chapter I stated that the Kalman filter is a form of g-h filter. However, we have been reasoning about the probability of Gaussians, and not used any of the reasoning or equations of the first chapter. A trivial amount of algebra will reveal the relationship, so let's do that now. It's not particularly illuminating algebra, so feel free to skip to the bottom to see the final equation that relates *g* to the variances.\n",
"\n",
"The equation for our estimate is:\n",
@@ -1210,13 +1247,13 @@
"We can easily put this into the g-h form with the following algebra\n",
"\n",
"$$\n",
"\\begin{align*}\n",
"\\begin{aligned}\n",
"\\mu_{x'}&=(x-x) + \\frac{ya + xb} {a+b} \\\\\n",
"\\mu_{x'}&=x-\\frac{a+b}{a+b}x + \\frac{ya + xb} {a+b} \\\\ \n",
"\\mu_{x'}&=x +\\frac{-x(a+b) + xb+ya}{a+b} \\\\\n",
"\\mu_{x'}&=x+ \\frac{-xa+ya}{a+b} \\\\\n",
"\\mu_{x'}&=x+ \\frac{a}{a+b}(y-x)\\\\\n",
"\\end{align*}\n",
"\\end{aligned}\n",
"$$\n",
"\n",
"We are almost done, but recall that the variance of estimate is given by \n",
@@ -1227,23 +1264,23 @@
"\n",
"We can incorporate that term into our equation above by observing that\n",
"$$ \n",
"\\begin{align*}\n",
"\\begin{aligned}\n",
"\\frac{a}{a+b} &= \\frac{a/a}{(a+b)/a} = \\frac{1}{(a+b)/a}\\\\\n",
" &= \\frac{1}{1 + \\frac{b}{a}} = \\frac{1}{\\frac{b}{b} + \\frac{b}{a}}\\\\\n",
" &= \\frac{1}{b}\\frac{1}{\\frac{1}{b} + \\frac{1}{a}} \\\\\n",
" &= \\frac{\\sigma^2_{x'}}{b}\n",
" \\end{align*}\n",
" \\end{aligned}\n",
"$$\n",
"\n",
"We can tie all of this together with\n",
"\n",
"$$\n",
"\\begin{align*}\n",
"\\begin{aligned}\n",
"\\mu_{x'}&=x+ \\frac{a}{a+b}(y-x)\\\\\n",
"&= x + \\frac{\\sigma^2_{x'}}{b}(y-x) \\\\\n",
"&= x + g_n(y-x)\\\\\n",
"\\blacksquare\n",
"\\end{align*}\n",
"\\end{aligned}\n",
"$$\n",
"\n",
"where\n",
@@ -1273,11 +1310,18 @@
" sensor_error = 40 "
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Introduction to Designing a Filter"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Introduction to Designing a Filter\n",
"So far we have developed our filter based on the dog sensors introduced in the Discrete Bayesian filter chapter. We are used to this problem by now, and may feel ill-equiped to implement a Kalman filter for a different problem. To be honest, there is still quite a bit of information missing from this presentation. The next chapter will fill in the gaps. Still, lets get a feel for it by designing and implementing a Kalman filter for a thermometer. The sensor for the thermometer outputs a voltage that corresponds to the temperature that is being measured. We have read the manufacturer's specifications for the sensor, and it tells us that the sensor exhibits white noise with a standard deviation of 2.13.\n",
"\n",
"We do not have a real sensor to read, so we will simulate the sensor with the following function. We have hard-coded the voltage to 16.3 - obviously the voltage will differ based on the temperature, but that is not important to our filter design."
@@ -1450,12 +1494,18 @@
"The results do in fact look like a normal distribution. Each voltage is Gaussian, and the **Central Limit Theorem** guarantees that a large number of Gaussians is normally distributed. We will discuss this more in a subsequent math chapter."
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Explaining the Results - Multi-Sensor Fusion"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"###Explaining the Results - Multi-Sensor Fusion\n",
"\n",
"So how does the Kalman filter do so well? I have glossed over one aspect of the filter as it becomes confusing to address too many points at the same time. We will return to the dog tracking problem. We used two sensors to track the dog - the RFID sensor that detects position, and the inertial tracker that tracked movement. However, we have focussed all of our attention on the position sensor. Let's change focus and see how the filter performs if the intertial tracker is also noisy. This will provide us with an vital insight into the performance of Kalman filters."
]
},
@@ -1526,13 +1576,26 @@
"We will formalize this mathematically in the next chapter; for now trust this intuitive explanation. We use this sort of reasoning every day in our lives. If one person tells us something that seems far fetched we are inclined to doubt them. But if several people independently relay the same information we attach higher credence to the data. If one person disagrees with several other people, we tend to distrust the outlier. If we know the people that might alter our belief. If a friend is inclined to practical jokes and tall tales we may put very little trust in what they say. If one lawyer and three lay people opine on some fact of law, and the lawyer disagees with the three you'll probably lend more credence to what the lawyer says because of her expertise. In the next chapter we will learn how to mathematicall model this sort of reasoning."
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"More examples"
]
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example: Extreme Amounts of Noise"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### More examples\n",
"\n",
"##### Example: Extreme Amounts of Noise\n",
"So I didn't put a lot of noise in the signal, and I also 'correctly guessed' that the dog was at position 0. How does the filter perform in real world conditions? Let's explore and find out. I will start by injecting a lot of noise in the RFID sensor. I will inject an extreme amount of noise - noise that apparently swamps the actual measurement. What does your intution tell about how the filter will perform if the noise is allowed to be anywhere from -300 or 300. In other words, an actual position of 1.0 might be reported as 287.9, or -189.6, or any other number in that range. Think about it before you scroll down."
]
},
@@ -1585,11 +1648,19 @@
"In this example the noise is extreme yet the filter still outputs a nearly straight line! This is an astonishing result! What do you think might be the cause of this performance? If you are not sure, don't worry, we will discuss it latter."
]
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example: Bad Initial Estimate"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#####Example: Bad Initial Estimate\n",
"\n",
"Now let's lets look at the results when we make a bad initial estimate of position. To avoid obscuring the results I'll reduce the sensor variance to 30, but set the initial position to 1000m. Can the filter recover from a 1000m initial error?"
]
},
@@ -1642,11 +1713,18 @@
"Again the answer is yes! Because we are relatively sure about our belief in the sensor ($\\sigma=30$) even after the first step we have changed our belief in the first position from 1000 to somewhere around 60.0 or so. After another 5-10 measurements we have converged to the correct value! So this is how we get around the chicken and egg problem of initial guesses. In practice we would probably just assign the first measurement from the sensor as the initial value, but you can see it doesn't matter much if we wildly guess at the initial conditions - the Kalman filter still converges very quickly."
]
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example: Large Noise and Bad Initial Estimate"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#####Example: Large Noise and Bad Initial Estimate\n",
"What about the worst of both worlds, large noise and a bad initial estimate?"
]
},
@@ -1753,11 +1831,18 @@
"200 iterations may seem like a lot, but the amount of noise we are injecting is truly huge. In the real world we use sensors like thermometers, laser rangefinders, GPS satellites, computer vision, and so on. None have the enormous error as shown here. A reasonable value for the variance for a cheap thermometer might be 10, for example, and our code is using 30,000 for the variance. "
]
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Exercise: Interactive Plots"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#####Exercise:\n",
"Implement the Kalman filter using IPython Notebook's animation features to allow you to modify the various constants in real time using sliders. Refer to the section **Interactive Gaussians** in the Gaussian chapter to see how to do this. You will use the *interact()* function to call a calculation and plotting function. Each parameter passed into *interact()* automatically gets a slider created for it. I have built the boilerplate for this; just fill in the required code."
]
},
@@ -1855,15 +1940,21 @@
],
"prompt_number": 29
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Exercise - Nonlinear Systems"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#####Exercise - Nonlinear Systems\n",
"\n",
"Our equations are linear: \n",
"$$\\begin{align*}new\\_pos&=old\\_pos+dist\\_moved\\\\\n",
"new\\_position&=old\\_position*measurement\\end{align*}$$\n",
"$$\\begin{aligned}new\\_pos&=old\\_pos+dist\\_moved\\\\\n",
"new\\_position&=old\\_position*measurement\\end{aligned}$$\n",
"\n",
"Do you suppose that this filter works well or poorly with nonlinear systems?\n",
"\n",
@@ -1942,9 +2033,21 @@
"Here we set a bad initial guess of 100. We can see that the filter never 'acquires' the signal. Note now the peak of the filter output always lags the peak of the signal by a small amount. More clearely we can see the large gap in height between the measurement and filter. \n",
"**REWriTE - not seeing heigh gap now**\n",
"\n",
"Maybe we just didn't adjust things 'quite right'. After all, the output looks like a sin wave, it is just offset in $x$ and $y$. Let's test this assumption.\n",
"\n",
"#####Exercise - Noisy Nonlinear Systems\n",
"Maybe we just didn't adjust things 'quite right'. After all, the output looks like a sin wave, it is just offset in $x$ and $y$. Let's test this assumption."
]
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Exercise - Noisy Nonlinear Systems"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Implement the same system, but add noise to the measurement."
]
},
@@ -2017,11 +2120,18 @@
"Very shortly after practioners began implementing Kalman filters they realized the poor performance of them for nonlinear systems and began devising ways of dealing with it. Much of this book is devoted to this problem and its various solutions."
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Summary"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Summary\n",
"This information in this chapter takes some time to assimulate. To truly understand this you will probably have to work through this chapter several times. I encourage you to change the various constants and observe the results. Convince yourself that Gaussians are a good representation of a unimodal belief of something like the position of a dog in a hallway. Then convince yourself that multiplying Gaussians truly does compute a new belief from your prior belief and the new measurement. Finally, convince yourself that if you are measuring movement, that adding the Gaussians correctly updates your belief. That is all the Kalman filter does. Even now I alternate between complacency and amazement at the results. \n",
"\n",
"If you understand this, you will be able to understand multidimensional Kalman filters and the various extensions that have been make on them. If you do not fully understand this, I strongly suggest rereading this chapter. Try implementing the filter from scratch, just by looking at the equations and reading the text. Change the constants. Maybe try to implement a different tracking problem, like tracking stock prices. Experimentation will build your intuition and understanding of how these marvelous filters work."
+218 -119
View File
@@ -1,7 +1,7 @@
{
"metadata": {
"name": "",
"signature": "sha256:fee9697d6045cc2e7b201f1c2087dc4b21e26e84b3d4dbeb2219f4c109bd6893"
"signature": "sha256:254e89db7aa7d5d122fc4ca120623bf57e0bbb51df939e2b783e03617022220b"
},
"nbformat": 3,
"nbformat_minor": 0,
@@ -9,11 +9,11 @@
{
"cells": [
{
"cell_type": "markdown",
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"<h1 align=\"center\">Multidimensional</h1>\n",
"<h1 align=\"center\">Kalman Filters</h1>"
"Multidimensional Kalman Filters"
]
},
{
@@ -63,7 +63,6 @@
" } \n",
" h2 {\n",
" font-family: 'Open sans',verdana,arial,sans-serif;\n",
" text-indent:1em;\n",
" }\n",
" .text_cell_render h2 {\n",
" font-weight: 200;\n",
@@ -245,23 +244,39 @@
"output_type": "pyout",
"prompt_number": 1,
"text": [
"<IPython.core.display.HTML at 0x2b4f7d0>"
"<IPython.core.display.HTML at 0x127a950>"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Introduction"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The techniques in the last chapter are very powerful, but they only work in one dimension. The gaussians represent a mean and variance that are scalars - real numbers. They provide no way to represent multidimensional data, such as the position of a dog in a field. You may retort that you could use two Kalman filters for that case, one tracks the x coordinate and the other tracks the y coordinate. That does work in some cases, but put that thought aside, because soon you will see some enormous benefits to implementing the multidimensional case."
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Multivariate Normal Distributions"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Introduction\n",
"The techniques in the last chapter are very powerful, but they only work in one dimension. The gaussians represent a mean and variance that are scalars - real numbers. They provide no way to represent multidimensional data, such as the position of a dog in a field. You may retort that you could use two Kalman filters for that case, one tracks the x coordinate and the other tracks the y coordinate. That does work in some cases, but put that thought aside, because soon you will see some enormous benefits to implementing the multidimensional case.\n",
"\n",
"\n",
"###Multivariate Normal Distributions\n",
"\n",
"\n",
"What might a *multivariate normal distribution* look like? In this context, multivariate just means multiple variables. Our goal is to be able to represent a normal distribution across multiple dimensions. Consider the 2 dimensional case. Let's say we believe that $x = 2$ and $y = 7$. Therefore we can see that for $N$ dimensions, we need $N$ means, like so:\n",
"\n",
"$$\n",
@@ -507,7 +522,7 @@
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAqsAAAFdCAYAAAAkOCRoAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzsvXeYJGW5v39X7DRhZ2ZnZwNsZslI2iVKDoIBMYBnPR7R\nY44cjnAwIh70q/xMx4BZwYAJBAVRJAgiEpbdZclhc57dydPTqdLvj6F6OlT3dPd0qJ557+vaa6cr\nPlVdXfWp532C5DiOg0AgEAgEAoFA4EPkRhsgEAgEAoFAIBAUQohVgUAgEAgEAoFvEWJVIBAIBAKB\nQOBbhFgVCAQCgUAgEPgWIVYFAoFAIBAIBL5FiFWBQCAQCAQCgW9Ri80cHByslx0CgUAgEAgEghlM\nR0eH53ThWRUIBAKBQCAQ+BYhVgUCgUAgEAgEvkWIVYFAIBAIBAKBbxFiVSAQCAQCgUDgW4RYFQgE\nAoFAIBD4FiFWBQKBQCAQCAS+RYhVgUAgEAgEAoFvEWJVIBAIBAKBQOBbhFgVCAQCgUAgEPgWIVYF\nAoFAIBAIBL5FiFWBQCAQCAQCgW8RYlUgEAgEAoFA4FuEWBUIBAKBQCAQ+BYhVgUCgUAgEAgEvkWI\nVYFAIBAIBAKBbxFiVSAQCAQCgUDgW4RYFQgEAoFAIBD4FiFWBQKBQCAQCAS+RYhVgUAgEAgEAoFv\nEWJVIBAIBAKBQOBb1E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1xsRYtAYRowYv972MFcc\n/FrUOmTrX7TgeK7ecDMvje4pqcmASzVedtzkQvGyI8ikv7+frq7ajChMF4RYFTSc6XbDLjTM7wo+\nvwvV3DhaVVWnLLCnQ/3UWoQYlFs7dDryi60PcWr3ISxpmVOX/WmywkULjufWHY9x9aEXVe3cF7s+\n3NrImdUvwPv6yFx/ut0bBd4IsTo5QqwKGka9h/lrORyXm2yU54W0LaSB5zHbl4DWXhMbijHZsXuV\ny6rWMH/u+pMlJTTjQ7lcr1spntmZIFSeGNjMtlgf7112dl33e0r3wdy5Zx3Pjezi8PYD6rLPTLEq\n4qlnHsXidvv7++nuLq1D20xFiFVBXZlOcajgnWzk1kSdWMgkdPcHUXc8iJQaxeo8GGvBSSRO/izk\nJHnUG1dg16JcVjlMl+uhEF4xjK7XfaYKlTEzwS+2PsSHlp+LLtf3UaRIMhcvWMWtOx/jsLYFDT9/\ntYyXLbbdeiDidScnGo3S2traaDN8jRCrgrqQSqUaIoIyqZZntaxkI9sk9Nf3IyUGGPyPtViWRXj4\nBQJrv03o/iuIn/c9qPM58eqK1SxxtNORWggVP4iUybh52784vnMpB7fNb8j+T+hazp2717JhaBtH\ndyxuiA2lMh2uEb9eh35BnJ/iCLEqqAm5N0K3J3izUlFNUdsk9Jf3IiWHib3hZkADycKafyKx7iNp\n+e256E/9hNSr3lMX+x3HIZlMNmVXrJnMdEz8enpoOy+M7uKLR76t7vt2kSWJiw9Yxa07H+eoWYuQ\nm/h3UK1rJHP9Rl8jMwnhfZ4cIVYFVaXQMH8jMvFzqcSzmts6tJxhcv3pG5Fjexm7+DZQg/BKqAAA\nWoTY635J5LfnYXUfhTV/VVl2lWu/G6Ygy3LdPdyidE9tabbasrZjc/O2h3nHolcTVLSqbrtcjutY\nwh2717J2YDMru6ZvjctSr5HMz35/4Wkmit3/DMNAVYUUmwwx7ieYMm7igOula/YblztMnkLine truncated
"text": [
"<matplotlib.figure.Figure at 0x423b3d0>"
"<matplotlib.figure.Figure at 0x29663d0>"
]
}
],
@@ -551,7 +566,7 @@
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAA1MAAAGpCAYAAABoLmzKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3Xd4FNX6B/DvbEs2FYgJChgElR40FGmhGQioICCCcJVi\nuUgRFC7yA5FiQ6/YUEFUBBEFBAUERXoNKCD9Al5EkN5EQpLNJlt/f+SCIiFtZ/fMnPl+nsfn3g1h\nz3nPLO/M2XnPHMXv9/tBREREREREJWIS3QEiIiIiIiI94mSKiIiIiIioFDiZIiIiIiIiKgVOpoiI\niIiIiEqBkykiIiIiIqJS4GSKiIiIiIioFDiZMqB169bBZNLGoW/VqhVeeOEF0d0goiBhviEitWgp\nn6hh/PjxaN26tehuUIDk+URSwDIyMjBo0CDcfvvtiIiIQOXKlfHUU08hIyOjRO/j8XgwbNgwJCQk\nICoqCg888ADOnTtX4O8qigJFUdToPhHpCPMNEalFrXyyceNGdOrUCZUqVYLJZMLMmTNL3JdFixah\ndevWiI+PR0xMDJo0aYLvvvuuxO9D+sHJFF1x9uxZnD17Fu+88w727duH6dOnY8mSJXjooYdK9D7j\nx4/Hp59+is8++wwbNmzA0aNHS/weRCQ35hsiUota+SQrKwt16tTBe++9BwCl+vIlPT0dHTp0wPLl\ny7Fr1y40adIEnTt3Rnp6eonfi/TBIroDpB3Vq1fHV199deV1lSpVMHToUPzrX/9CVlYWoqOji3wP\nn8+HqVOnYsSIEWjfvj0A4J133kHLli3xn//8B3Xq1Ala/4lIP5hviEgtauQTALj33ntx7733BtSX\nN95446rXb731FmbMmIFFixYhJSUloPcmbeKdKSrUxYsXERERgbCwsGL9/uHDh/HHH3+gefPmV37W\ntGlTWCwWbNu2LVjdJCIJMN8QkVpKmk+CJScnBy6XC2XLlhXaDwoeTqbouo4fP4733nsPw4YNg81m\nK9bfubxWIS4uDsOHD8ett94Kl8uFcuXKXXcdAxER8w0RqaU0+SRYxo0b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N17bMpJxPGWMCZAzLhljAuSNSwQjn2+MGjvHXZ90\nPZkiIiIiIiIShWumiKhYtLCGgfmGyBi0kG8A5hwio+CaKSIiIiIiohDT9WRKdH2lUWtLOe7Ga1tG\nMo6njDEBcsYlY0yAvHGJYOTzjVFj57jrk64nU0RERERERKJwzRQRFYsW1jAw3xAZgxbyDcCcQ2QU\nXDNFRLoyfPhw3HjjjUhKSrrys3nz5qFatWqoXr06vv32W4G9IyIiIioeXU+mRNdXGrW2lONuvLbV\n1rVrV3z33XdXXrtcLowcORKbNm3CqlWr8MwzzwS9DzKN52UyxgTIGZeMMQHyxiWCkc83Ro2d465P\nup5MEZE+NWnSBHFxcVdeb9myBbVr10Z8fDxuvvlm3Hzzzdi9e7fAHhIREREVjWumiKhY1F7D8Ntv\nv6Fjx47Yu3cv5s+fj5UrV6J+/fooV64cFixYgD59+qB9+/ZX/R3mG7n5/UBmpoLTpxWcOWPC778r\nMJsBux0IC/PDbvcjJsaPqlV9CA8X3VsKJq6ZIqJQCiTnWFTuCxFRqT355JMAgAULFkBRlALine truncated
"text": [
"<matplotlib.figure.Figure at 0x40e6fd0>"
"<matplotlib.figure.Figure at 0x29dafd0>"
]
}
],
@@ -565,10 +580,10 @@
"\n",
"The first plot uses the mean and covariance matrices of\n",
"$$\n",
"\\begin{align*}\n",
"\\begin{aligned}\n",
"\\mu &= \\begin{bmatrix}2\\\\7\\end{bmatrix} \\\\\n",
"\\sigma^2 &= \\begin{bmatrix}2&0\\\\0&2\\end{bmatrix}\n",
"\\end{align*}\n",
"\\end{aligned}\n",
"$$\n",
"\n",
"Let this be our current belief about the position of our dog in a field. In other words, we believe that he is positioned at (2,7) with a variance of $\\sigma^2=2$ for both x and y. The contour plot shows where we believe the dog is located with the '+' in the center of the ellipse. The ellipse shows the boundary for the $1\\sigma^2$ probability - points where the dog is quite likely to be based on our current knowledge. Of course, the dog might be very far from this point, as Gaussians allow the mean to be any value. For example, the dog could be at (3234.76,189989.62), but that has vanishing low probability of being true. Generally speaking displaying the $1\\sigma^2$ to $2\\sigma^2$ contour captures the most likely values for the distribution. An equivelent way of thinking about this is the circle/ellipse shows us the amount of error in our belief. A tiny circle would indicate that we have a very small error, and a very large circle indicates a lot of error in our belief. We will use this throughout the rest of the book to display and evaluate the accuracy of our filters at any point in time. "
@@ -581,10 +596,10 @@
"The second plot uses the mean and covariance matrices of\n",
"\n",
"$$\n",
"\\begin{align*}\n",
"\\begin{aligned}\n",
"\\mu &=\\begin{bmatrix}2\\\\7\\end{bmatrix} \\\\\n",
"\\sigma^2 &= \\begin{bmatrix}2&0\\\\0&9\\end{bmatrix}\n",
"\\end{align*}\n",
"\\end{aligned}\n",
"$$\n",
"\n",
"This time we use a different variance for $x$ (2) vs $y$ (9). The result is an ellipse. When we look at it we can immediately tell that we have a lot more uncertainty in the $y$ value vs the $x$ value. Our belief that the value is (2,7) is the same in both cases, but errors are different. This sort of thing happens naturally as we track objects in the world - one sensor has a better view of the object, or is closer, than another sensor, and so we end up with different error rates in the different axis."
@@ -596,10 +611,10 @@
"source": [
"The third plot uses the mean and covariance matrices of:\n",
"$$\n",
"\\begin{align*}\n",
"\\begin{aligned}\n",
"\\mu &=\\begin{bmatrix}2\\\\7\\end{bmatrix} \\\\\n",
"\\sigma^2 &= \\begin{bmatrix}2&1.2\\\\1.2&2\\end{bmatrix}\n",
"\\end{align*}\n",
"\\end{aligned}\n",
"$$\n",
"\n",
"This is the first contour that has values in the off-diagonal elements of $cov$, and this is the first contour plot with a slanted ellipse. This is not a coincidence. The two facts are telling use the same thing. A slanted ellipse tells us that the $x$ and $y$ values are somehow **correlated**. We denote that in the covariance matrix with values off the diagonal. What does this mean in physical terms? Think of trying to park your car in a parking spot. You can not pull up beside the spot and then move sideways into the space because most cars cannot go purely sideways. $x$ and $y$ are not independent. This is a consequence of the steering system in a car. When your tires are turned the car rotates around its rear axle while moving forward. Or think of a horse attached to a pivoting exercise bar in a corral. The horse can only walk in circles, he cannot vary $x$ and $y$ independently, which means he cannot walk straight forward to to the side. If $x$ changes, $y$ must also change in a defined way. \n",
@@ -611,13 +626,19 @@
"** wikipedia article 'correlation and dependence' claims multivariate normals are a special case, where the correlation coeff $p$ completely defines the dependence. FIGURE THIS OUT!**"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Unobserved Variables"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"###Unobserved Variables\n",
"\n",
"Let's say we are tracking an aircraft and we get the following data for the $x$ coordinate at time $t$=1,2, and 3 seconds. What does your intuition tell you the value of $x$ will be at time $t$=4 seconds?\n"
"Let's say we are tracking an aircraft and we get the following data for the $x$ coordinate at time $t$=1,2, and 3 seconds. What does your intuition tell you the value of $x$ will be at time $t$=4 seconds?"
]
},
{
@@ -635,7 +656,7 @@
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAsYAAAF/CAYAAABKRQ+VAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHChJREFUeJzt3X+s1nWhB/D3OZzjQSIOivkDJ+aPKf5A48eWIiqKel3L\n25y75bRc3eEtcWpNbU1tq0V1uQ6dc2qh7U5cZia5LLvThjW1siGUYkO5rewQBIQIyiE4HM5z//BC\nkRy+J4TzfL74em1sfM/zcJ6P7M3xzXPez0NLo9FoBAAA3uVam30AAAAogWIMAABRjAEAIIliDAAA\nSRRjAABIohgDAECSpK3ZB9jmueeeS3d3d7OPAQDAPmzkyJGZOHHiTm8rphh3d3dnwoQJzT4GvM0P\nf/jDXHTRRc0+BuyUfFIq2aRUixYt6vc2Uwqo0NXV1ewjQL/kk1LJJnWkGAMAQBRjqHTeeec1+wjQ\nL/mkVLJJHSnGUOH4449v9hGgX/JJqWSTOlKMocKzzz7b7CNAv+STUskmdaQYAwBAFGOoNGXKlGYf\nAfoln5RKNqkjxRgAAKIYQyU7OUomn5RKNqkjxRgAAKIYQyU7OUomn5RKNqkjxRgAAKIYQyU7OUom\nn5RKNqkjxRgAAKIYQyU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PPzVe/+tUcdthhb3vGeMaMGZW//uCDD87BBx+c5K29\nck9PT7Zs2ZL29vbdODLAu89vfjMka9bsev22eXNLnnxyv4wbt2mQTgWwbxnQxvipp57KSSedlBNP\nPPFtP/5ZTzzxRCZOnKgUUxt2cjRbb2/y3/+934Due999HVm1ypaC5vO1kzoa0DPGRx11VE4++eQc\ncsghOzxj3PJPDtlWrlyZG264IY899thOb58xY8b2t3/r7OzMuHHjtn8rZtsfMNeuXbt+t10vXvxK\n1q2blIFYv74lXV1/zv/+7++KOb/rd+f1NqWcx/W793rx4sVZv359krfegnj69Onpz4Dex/jqq6/u\n97aBvPguSTZt2pTzzz8/X/ziF3PBBRe87XbvYwywc319yb//+3vy2GPVzxofffTWPPnkGznwwEE4\nGEANveP3MR5o+e1Po9HIpz71qVx22WU7LcUA9K+1Nbniis0DKsbXXbdJKQbYTQN+H+Odufvuuwd0\nv5///OeZN29e5syZk/Hjx2f8+PFZuXLlO3loGDT/+G1BaIYTT9ya8eN7d3mfQw7py+mn7/o+MFh8\n7aSO3lExfu655wZ0vylTpqSnpye//vWvt/849NBD38lDA7yrHHpoI3PmdGfChC07vf3ww7fm4Yff\nzLHHeqs2gN3V75Ri3rx5ueSSS5IkDz30UFpaWrJtjrzt5729nplg37dtwA/Ndswxffn2t7uzZMmQ\nPPjgfvnDH4bkfe/ryyc+sTknn7w1Rxzhn76jHL52Ukf9FuO1a9du//kPfvCDnHnmmTvc3mg0MoDX\n7QGwBx1ySCOHHNKbqVN7s2lT0tER/9IdwB7SbzG+8sort/+8vb19p/+Qx69+9au9cyooyLPPPuuZ\nD4o0dKh8Ui7ZpI4GtDG+7rrrdvrx4447bo8eBgAAmmWX72N8/fXXZ/bs2YNyEO9jDADA3rar9zHe\n5TPGf/nLX/bKgQAAoDS7LMaNRiOrVq3a5Q/Y13kvTkomn5RKNqmjXf7Ldz09Pbn22mt3+QLine truncated
"text": [
"<matplotlib.figure.Figure at 0x410e750>"
"<matplotlib.figure.Figure at 0x283bbd0>"
]
}
],
@@ -662,7 +683,7 @@
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAsYAAAF/CAYAAABKRQ+VAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAH/JJREFUeJzt3X2QnXV9NvBrX0JISLLBBBR8WE3A8JoCJtUQI6UUHccH\nEEqpSJGxTlBJSrUCrVLaYo221EYGEbFIO4/BIlSDIuoz+A5GBwigAjUJig8uZk1CEmNCXkw2u88f\nNJGYX072aHLOvXs+nxlmcp9d93xlrhy++9tr79M2MDAwEAAAaHHtzR4AAACqwGIMAACxGAMAQBKL\nMQAAJLEYAwBAEosxAAAkSTqbPcAO999/fzZu3NjsMQAAGObGjx+fadOm7fZ4ZRbjjRs35uUvf3mz\nx6Bi7r777px11lnNHoOKkQtK5IISuaDkkUceKT6uSkGl9fT0NHsEKkguKJELSuSCeliMAQAgFmMq\n7owzzmj2CFSQXFAiF5TIBfWwGFNpRx99dLNHoILkghK5oEQuqIfFmEpbtGhRs0egguSCErmgRC6o\nh8UYAACStA0MDAw0e4gk+frXv+52bQAA7HePPPJI/uiP/mi3x50YAwBALMZUnG4YJXJBiVxQIhfU\nw2IMAADRMQYAoMXoGAMAQA0WYypNN4wSuaBELiiRC+phMQYAgOgYAwDQYnSMAQCgBosxlaYbRolc\nUCIXlMgF9bAYAwBAdIwBAGgxOsYAAFCDxZhK0w2jRC4okQtK5IJ6WIwBACA6xgAAtBgdYwAAqMFi\nTKXphlEiF5TIBSVyQT0sxgAAEB1jAABajI4xAADUYDGm0nTDKJELSuSCErmgHhZjAACIjjEAAC1G\nxxgAAGqwGFNpumGUyAUlckGJXFAPizEAAETHGACAFqNjDAAANViMqTTdMErkghK5oEQuqIfFGAAA\nomMMAECL0TEGAIAaLMZUmm4YJXJBiVxQIhfUw2IMAADRMQYAoMXoGAMAQA0WYypNN4wSuaBELiiR\nC+phMQYAgOgYAwDQYnSMAQCgBosxlaYbRolcUCIXlMgF9b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A1GAxptJ0wyiRC0rkghK5oB4WYwAAiI4xAAAtRscY\nAABqsBhTabphlMgFJXJBiVxQD4sxAABExxgAgBajYwwAADVYjKk03TBK5IISuaBELqjHoBfjrVu3\n5tFHH819992XJNm4cWM2bdq03wYDAIBG6hzMJz3xxBOZP39+xo0blxUrVuTUU0/N448/nkWLFuXy\nyy/f3zPSwmbNmtXsEagguaBELiiRC+oxqBPjf//3f8873vGOfOhDH0pn53O79IknnpglS5bs1+EA\nAKBRBrUYr1q1KieddNIuj40YMSL9/f37ZSjYQTeMErmgRC4okQvqMajF+CUveUm+8Y1v7PLY4sWL\nM2nSpP0yFAAANNqg7mPc09OTefPm5eCDD87TTz+d448/Pk8//XSuuuqqdHd375NB3McYAIBG2NN9\njAf1y3fd3d25/vrr8/DDD2fNmjWZOHFiXv7yl2fUqFH7fFAAAGiGQd+ubcSIETnuuOPyqle9Kkcf\nfXQ2btyY1atX78/ZQDeMIrmgRC4okQvqMagT45tvvjnf/va3M2bMmLS377pL33jjjftlMAAAaKRB\nLcYPPfRQ/u3f/i2jR4/e3/PALtx/khK5oEQuKJEL6jGoxfj000/PBz7wgRx22GG7nRjPmTLine truncated
"text": [
"<matplotlib.figure.Figure at 0x40e01d0>"
"<matplotlib.figure.Figure at 0x29dadd0>"
]
}
],
@@ -689,7 +710,7 @@
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAswAAAF/CAYAAABdZ59cAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3Xt0XFd9L/DvOTOj9/ttW5b8dizHTvyIE2wRIA4NIeRC\nbtJQCqSs3KSUtAVuSRdQekuhiy5IaXnckjQN5ZVbSgjpvSEkkJIHBIXETiIHv+WXZMmWrfdzJM3r\nnPvHyVhzzt77zJmRPDPOfD9rsRYzGskDa+voN7/z3b+tmaZpgoiIiIiIpPRsvwEiIiIiolzGgpmI\niIiIyAULZiIiIiIiFyyYiYiIiIhcsGAmI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Hy5gePH2WWmhRkc1NHYmHwtPvecH/39Or74xVn4fMCH\nP3wUQ0MannpKcfJOgqYmA+fOcaoLZV9WC+bu7m48/PDDOHDgAF5//XV8//vfx+nTp7P5log8Y4aZ\nMu3sWQ2lpWbSzGiytXnZZTF0dWW9X0KXOCuSkbxN/LWvFeFTn5qF/43hLG972y7ce+8cHnigMOn3\nclIG5YqsrsKKigoEAgHMzs5idnYWBQUFqKyszOZbIiLKWV1dyeMYXqxdG8OJE+ww08IMDGLine truncated
"text": [
"<matplotlib.figure.Figure at 0x40daa90>"
"<matplotlib.figure.Figure at 0x2cd1cd0>"
]
}
],
@@ -720,7 +741,7 @@
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAswAAAF/CAYAAABdZ59cAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3XmYXHWZL/DvOaeq931Pp5cknYV0SEg6IWjSqBAQWRxl\nYFRcuMqVUXFc7oBXHR191Md5FJ0LeAVkcNyYcWQbL7KomIBgR0iATsjeWXpP7/te2zn3jx/VXVXn\nd06drq50VdLfz/PkSdfSnYO+feo973l/708xDMMAERERERFJqYk+ACIiIiKiZMaEmYiIiIjIBhNm\nIiIiIiIbTJiJiIiIiGwwYSYiIiIissGEmYiIiIjIhivRB2Dn1VdfxeTkZKIPg4iIiIgucHl5edi6\ndav0taROmCcnJ1FXV5fowyCSevrpp/He97430YdBZMLYpGTG+KRk1djYaPkaWzKIYtTe3p7oQyCS\nYmxSMmN80vmICTMRERERkQ0mzEQxuuqqqxJ9CERSjE1KZoxPOh8xYSaK0bp16xJ9CERSjE1KZoxP\nOh8xYSaKUUNDQ6IPgUiKsUnJjPFJ5yMmzERERERENpgwE8Wovr4+0YdAJMXYpGTG+KTzERNmIiIi\nIiIbTJiJYsQ+PEpWjE1KZoxPOh8xYSYiIiIissGEmShG7MOjZMXYpGTG+KTzERNmIiIiIiIbTJiJ\nYsQ+PEpWjE1KZox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wbFT3e3gvLy+VWYnZ47ufCPkgkjkYjo\nPPP66y5ceqnz/uWgLVv8OHCAFWaKn7NnVSxbFt8ZzEHLlxusMFPSYCQSxYg9zJQohw5p2LTJuh3D\nKjbr6gI4cMDFyQMUN6Il49z0MC9bpqOnhz33lByYMBMRnWcOHXLZJsxWKip0BAJAVxeTEIqP7m51\n3i0ZTpWV6ejpYZpCyYGRSBQj9jBTIgwNKRgbU7BihXWSYhWbigJs2hTAoUPsY6b46OpSUV4+v1sW\nTs+dTJgpmTASiYjOI4cPa7j4Yj/UGM/etbUBHD/OPmaKj1gW/TlVVmYwYaakwUgkihF7mCkRDh3S\nsHGjfTuGXWzW1gZw7BgTZlq4qSnA41GQl+eswmwYQH+/gp07nZ07c3MN+HzAxMRCjpIoPpgwExGd\nR44f11BbO//+5SAmzBQvfX0qSkp0KA5a4gcHFbznPdmoq8vF1Vdno78/+jcpimjL6O1lqkKJxygk\nihF7mCkRTp7UsG6dfcJsF5tr1wbQ2qrC6433kdFS09uroLQ0enXZMIBPfSoTW7f60do6ghUrWvH3\nf5/paFpLaanBhJmSQsKj8Fvf+hY2bNiADRs24Nvf/naiD4eIKGkZRjBhjr1nNC0NqKzUceoUq8y0\nMH19KkpLo8fiCy+40NWl4tvfnoamAR/72An09yt47jmLnXdClJXp6O7mVBdKvIQmzC0tLXjkkUdw\n+PBhHDx4EL/85S/R1taWyEMicow9zLTYzp5VkJlpRO0ZjRabF10UQFNTwusldJ4TLRnRy8T33JOG\nO++chuut4SzvfOdO3HXXDB58MDXq93JSBiWLhEZhTk4O3G43pqenMT09jZSUFOTm5ibykIiIklZT\nU/R2DCfWrAng9GlWmGlhensVlJTYV5hbW1WcOqXhb/7GF/b89df70Nys4fhx+zSkpMRAfzLine truncated
"text": [
"<matplotlib.figure.Figure at 0x43e1850>"
"<matplotlib.figure.Figure at 0x2b0c410>"
]
}
],
@@ -735,11 +756,18 @@
"What makes this possible? Imagine for a moment that we superimposed the velocity from a *different* airplane over the position graph. Cleary the two are not related, and there is no way that combining the two could possibly yield any additional information. In contrast, the velocity of the this airplane tells us something very important - the direction and speed of travel. So long as the aircraft does not alter its velocity the velocity allows us to predict where the next position is. After a relatively small amount of error in velocity the probability that it is a good match with the position is very small. Think about it - if you suddenly change direction your position is also going to change a lot. If the position measurement is not in the direction of the assumed velocity change it is very unlikely to be true. The two are correlated, so if the velocity changes so must the position, and in a predictable way. "
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Kalman Filter Algorithm"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Kalman Filter Algorithm\n",
"So in general terms we can show how a multidimensional Kalman filter works. In the example above, we compute velocity from the previous position measurements using something called the **measurement function**. Then we predict the next position by using the current estimate and something called the **state transition function**. In our example above,\n",
"\n",
"$$new\\_position = old\\_position + velocity*time$$ \n",
@@ -766,38 +794,44 @@
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAsAAAAF9CAYAAAAKk97ZAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3Xd8VGWi//HvpHd6AE1oK0VdaugkIF1XcX+KDSwLLiw/\nVn+KLgosFhAX4S7ci9xVBHRB9op3LegVVuMVlCogrFSlawplQKUF05Pz+yNkliGZMCFPkjkzn/fr\nxQvmzMmZZ76cZJ48+c6Jw7IsSwAAAECACKrtAQAAAAA1iQkwAAAAAgoTYAAAAAQUJsAAAAAIKEyA\nAQAAEFCYAAMAACCgMAEGfMCECRMUFBSkoKAg9e/fv7aHY8zatWsVFBSkjIwMt+07d+50Pd/y7keJ\npUuXKiio/C/TQUFBWrZsWbU+flpamoKCgrR+/fpqfZya5q/PC4D3mAADVXT5RKSgoEB33nmn2rRp\no+PHj3t1jBdffFEnTpzQH/7wBzkcjuoaqjGXTl5L/wQHB5d5vn369JHT6VRCQoLb9vbt28vpdOqr\nr7664mO1aNFC06dPNzr+ymrRooXrecbExKhTp07661//Wqtjcjqduueee67640eNGnXFb7aaNWsm\np9OpXr16XfXjVEV53wDU9uS1ur/xyM3N1TPPPKPrrrtOkZGRSkxM1H333aczZ8647Tdt2jS1bNmy\n2sYB+DsmwIBBhYWFuu+++/TNN99o7dq1uuaaa7z6uJiYGDVu3FjR0dGyy++mefnll+V0Ol1/Tpw4\noaZNm7rtExoaqvj4+DKTmODgYMXHx6thw4ZXfBxf+IbA4XBo4sSJcjqd2rlzp371q19pzJgxev/9\n92ttTPHx8YqIiKjWxwgKClJ8fLxCQ0Or9XHsovRzszo/RydMmKDly5frlVde0YEDB/TWW2+pYcOG\n+vnnn6vtMYFAxAQYMKSwsFAjRozQ3r179cUXX7hNfv/whz/o+uuvV1RUlOLj4zVmzBidO3fO62Mv\nXbpUnTp1UnJysuLj4/X666+rVatWat68ufbu3StJys/P18MPP6xf/OIXioiIUEJCgiZOnKj8/HzX\ncaZNm6b+/ftr5syZaty4seLj4/Xcc89d1fOtU6eO4uPj3f6UTla3bNlS5YpD6aprenq6pk+f7jrW\nCy+84Lbf7Nmz1apVK0VFRalz585auXJlmWMFBQXptdde09ixY1W3bl3VqVNHM2bMqNR4YmJiFB8f\nr+uuu04zZ85U69attWLFCtf9pSuTK1as0J133qnY2Fg1aNDAbaV4yZIluv766xUZGakbbrhBb7zx\nhttj7NixQ927d1dERIR69uypQ4cOlRlHRESEK4s333yz3LHu3btXt912m+rWrau6devqlltu0ZEj\nRySVrPyWrmKuW7fOdawBAwa4Pt7pdLr9/61bt67MY5w7d06jRo1SgwYNFBUVpSFDhujAgQOu+0vr\nL//4xz/Upk0bxcXF6e677zY+kStdJf7rX/+qpk2bqk6dOvrd737ndt6fPn1aw4cPV3R0tFq1aqVV\nq1a5HcObz53Sn3JI0ujRo13ZXLoanJ+fr6effloJCQmKiYlR7969tXnz5ko9n3fffVdPPPGEhg4d\nqmbNmqlv3776y1/+4vopyrRp01yfB+np6a5xtGrVyu04X375pfr27auoqCg1b95cEydOVF5enuv+\nm266Sffee6/uu+8+RUVFqVWrVnrnnXcqNVbAzpgAAwYUFhbq/vvv1+7du8tMfiUpJydH8+fP17ff\nfqsPP/xQX375pcaPH1+px0hLS9Orr76qAQMGaOLEifrggw/Up08fLViwQFLJi294eLiWLFmigwcP\naunSpXrrrbc0bdo0t+Ns27ZNZ8+e1Zdffqmnn35aL774oldVhMtVtArWtWtXOZ3OKq2Q/vOf/9SJ\nEydck5HSleY//OEPrn3++Mc/6pVXXtFf/vIXffvtt3rkkUc0fPhwff3112WON2vWLCUkJGjr1q1a\nvXq12rRpc9Vjk6SwsDAVFBSU2T558mT1799fO3bs0AcffKAmTZpIkhYtWqQnn3xS06ZN0/79+zVj\nxgxNmDBBH374oaSS6swdd9yhZs2aadeuXXriiSc0f/78MivgmZmZOnHihKTyV8czMzOVkpKikJAQ\nrVmzRlu2bNGwYcN09OhRSdL8+fN14sQJ3XPPPerdu7cr10sn840bN3arqJT3OI899pg2btyoDz/8\nUF999ZWCgoJ0++23q6ioyG2/xYsX68MPP9R7772njz/+WK+88orXGVfG0qVL9b//+7/64IMPtHLl\nSr344ouu+/7f//t/2rdvn9auXau33npL//mf/+n2sd587pT+lENy/+nHpTWUUaNG6dNPP9Xy5cu1\nZ88e/epXv9LgwYN17Ngxr59H3bp1tWbNGmVnZ5d7/1NPPeX6PEhISHCNY9u2ba59du/erUGDBmnI\nkCHas2ePli9frk8++USTJk1yO9aKFSt0ww03aNeuXXr44Yd1//33l/tNF+CXLABV4nA4rGuvvdZy\nOBzWHXfc4dXHzJ8/34qLiyuz/fnnn7duuummMtuXLFli9ejRw7Isy3r11Vetnj17WpZlWQsWLLB+\n9atfeXycJ5980urQoYPb8a+55hqruLjYta1OnTrWX/7yF6/GXcrhcFgRERFWTEyM689DDz1UZr8v\nvvjCcjgcVnp6ernH+f777yu837Isq0WLFtb06dPLbM/KyrIiIiKsd99912370KFDrfHjx5cZ7/Dh\nw715ah7HMG3aNMuyLCs/P9967bXXLIfDYS1cuLDMc/nDH/5Q7jGuvfZa689//rPbtnHjxlm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MTL3Zz+FweP3/WRNvMLz8DZCVOdcqevPd5feV91wsy/LqOXr7\nueONTZs2lflmMC4urlLHiIyM1LBhwzRs2DC99NJLSkpK0ty5c7V06VKvPt7hcOjBBx/UH//4xzL3\nNWrUyOPHXc3XAcCumAADBpS+yD733HNatWqVHnjgAW3atEnBwcHauHGj2rdvr4kTJ7r2z8zMLPeF\nOSYmxmP370rWr1+voUOHuq0+f//99z5xFQVPSicKFT1nT13b66+/XuHh4UpPT9ctt9xSbWMsVb9+\n/aue8MfHx+vaa6/VkSNHNHbs2HL3ad26tX766Se3Fbrdu3dX+v+vU6dOWrp0qfLy8hQeHu5xP0+5\neqNly5YKCgrSzp07dcMNN0iSMjIydPr0adc3fp5U5vnUr19fUkmHvvSbmgsXLrjdV2r37t3q0aOH\npJI3ATZs2FBxcXFq2bKlgoODtXv3bl1//fWufS9Vmc+d0NBQFRYWltneqVMnSdLx48d18803e/0c\nryQkJEQtWrRwPe9SYWFh5Y5Dkjp37qxvvvnmiufrnj173G7v3btXt99+e9UGDNgEb4IDDAoJCdGy\nZcu0c+dO14+627Vrp3379mnVqlX67rvv9Oqrr+r9998vd7Wle/fu2rlzpz777DM5nc4yL3oVadeu\nnTZu3Kj169fr0KFDeuGFF7R58+YrrupUx6rP6dOn5XQ6XdWKU6dOyel06vz58277NWzYUC1atNAr\nr7yio0eP6tSpU2WO1aZNG3322Wc6duyYcnNzXW+yio2N1eOPP66pU6fqzTff1JEjR7RlyxY999xz\nevfdd40+HxMZTZ06VS+//LLmz5+vgwcP6p///Kf+/Oc/u94UdvPNN6tFixZ69NFHtW/fPr3zzjv6\n7//+b7dj/Pzzz643PUnS2bNn5XQ69cMPP7j2GT9+vHJycjRixAj985//1IEDB/Tqq6+WuZLine truncated
"text": [
"<matplotlib.figure.Figure at 0x4581f90>"
"<matplotlib.figure.Figure at 0x2ccd1d0>"
]
}
],
"prompt_number": 14
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"The Equations"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### The Equations\n",
"\n",
"The brilliance of the Kalman filter is taking the insights of the chapter up to this point and finding an optimal mathematical solution. The Kalman filter finds what is called a *least squared fit* to the set of measurements to produce an optimal output. We will not trouble ourselves with the derivation of these equations. It runs to several pages, and offers a lot less insight than the words above, in my opinion. Furthermore, to create a Kalman filter for your application you will not be manipulating these equations, but only specifing a number of parameters that are used by them. It would be going too far to say that you will never need to understand these equations; but to start we can pass them by and I will present the code that implements them. So, first, let's see the equations. \n",
"> Kalman Filter Predict Step:\n",
"\n",
"> $$\n",
"\\begin{align}\n",
"\\hat{\\mathbf{x}}_{t|t-1} &= \\mathbf{\\Phi_t}\\hat{\\mathbf{x}}_{t-1} + \\mathbf{B u}_t\\tag{1} \\\\\n",
"\\mathbf{P}_{t|t-1} &= \\mathbf{\\Phi_tP}_{t-1}\\mathbf{\\Phi}^T_t + \\mathbf{Q}_t\\tag{2}\n",
"\\end{align}\n",
"\\begin{aligned}\n",
"\\hat{\\mathbf{x}}_{t|t-1} &= \\mathbf{\\Phi_t}\\hat{\\mathbf{x}}_{t-1} + \\mathbf{B u}_t\\;\\;\\;&(1) \\\\\n",
"\\mathbf{P}_{t|t-1} &= \\mathbf{\\Phi_tP}_{t-1}\\mathbf{\\Phi}^T_t + \\mathbf{Q}_t\\;\\;\\;&(2)\n",
"\\end{aligned}\n",
"$$\n",
"\n",
"> Kalman Filter Update Step:\n",
"\n",
">$$\n",
"\\begin{align*}\n",
"\\mathbf{\\gamma} &= \\mathbf{z}_t - \\mathbf{H}_t\\hat{\\mathbf{x}}_t\\tag{3} \\\\\n",
"\\mathbf{K}_t &= \\mathbf{P}_t \\mathbf{H}^T_t (\\mathbf{H}_t \\mathbf{P}_t \\mathbf{H}^T_t + \\mathbf{R}_t)^{-1}\\tag{4} \\\\\n",
"\\begin{aligned}\n",
"\\mathbf{\\gamma} &= \\mathbf{z}_t - \\mathbf{H}_t\\hat{\\mathbf{x}}_t\\;\\;\\;&(3) \\\\\n",
"\\mathbf{K}_t &= \\mathbf{P}_t \\mathbf{H}^T_t (\\mathbf{H}_t \\mathbf{P}_t \\mathbf{H}^T_t + \\mathbf{R}_t)^{-1}\\;\\;\\;(4) \\\\\n",
"\\\\\n",
"\\hat{\\mathbf{x}}_t &= \\hat{\\mathbf{x}}_{t|t-1} + \\mathbf{K}_t \\gamma \\tag{5} \\\\\n",
"\\mathbf{P}_{t|t} &= (\\mathbf{I} - \\mathbf{K}_t \\mathbf{H}_t)\\mathbf{P}_{t|t-1} \\tag{6}\n",
"\\end{align*}\n",
"\\hat{\\mathbf{x}}_t &= \\hat{\\mathbf{x}}_{t|t-1} + \\mathbf{K}_t \\gamma \\;\\;\\;&(5) \\\\\n",
"\\mathbf{P}_{t|t} &= (\\mathbf{I} - \\mathbf{K}_t \\mathbf{H}_t)\\mathbf{P}_{t|t-1} \\;\\;\\;&(6)\n",
"\\end{aligned}\n",
"$$\n",
"\n",
"Dash off, wipe the blood out of your eyes, and we'll disuss what this means. "
@@ -807,25 +841,42 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"These are nothing more than linear algebra equations that implement the algorithm we used in the last chapter, but using multidimensional Gaussians instead of univariate Gaussians, and optimized for a least squares fit. Each capital letter denotes a matrix or vector. The subscripts indicate which time step the data comes from; $t$ is now, $t-1$ is the previous step. $A^T$ is the transpose of A, and $A^{-1}$ is the inverse. Finally, the hat denotes an estimate, so $\\hat{x}_t$ is the estimate of $x$ at time $t$.\n",
"\n",
"##### Kalman Equations Expressed as an Algorithm\n",
"These are nothing more than linear algebra equations that implement the algorithm we used in the last chapter, but using multidimensional Gaussians instead of univariate Gaussians, and optimized for a least squares fit. Each capital letter denotes a matrix or vector. The subscripts indicate which time step the data comes from; $t$ is now, $t-1$ is the previous step. $A^T$ is the transpose of A, and $A^{-1}$ is the inverse. Finally, the hat denotes an estimate, so $\\hat{x}_t$ is the estimate of $x$ at time $t$."
]
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Kalman Equations Expressed as an Algorithm"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Different texts use different notation and variable names for the Kalman filter. Later we will expose you to these different forms to prepare you for reading the original literature. However, I find much of the notation very dense, and unnecessary for writing code. The subscripts indicate the time step, but we know the left hand side is for this time step, and the right hand side is for the previous step. For most of this book I'm going to use the following simplified equations, which express an algorithm.\n",
"\n",
"$$\n",
"\\begin{align}\n",
"\\begin{aligned}\n",
"\\text{Predict Step}\\\\\n",
"\\mathbf{x}' &= \\mathbf{F x} + \\mathbf{B u}\\tag{1} \\\\\n",
"\\mathbf{P} &= \\mathbf{FP{F}}^T + \\mathbf{Q}\\tag{2} \\\\\n",
"\\mathbf{x}' &= \\mathbf{F x} + \\mathbf{B u}\\;\\;\\;&(1) \\\\\n",
"\\mathbf{P} &= \\mathbf{FP{F}}^T + \\mathbf{Q}\\;\\;\\;&(2) \\\\\n",
"\\\\\n",
"\\text{Update Step}\\\\\n",
"\\mathbf{\\gamma} &= \\mathbf{z} - \\mathbf{H x}\\tag{3} \\\\\n",
"\\mathbf{K}&= \\mathbf{PH}^T (\\mathbf{HPH}^T + \\mathbf{R})^{-1}\\tag{4} \\\\\n",
"\\mathbf{x}&=\\mathbf{x}' +\\mathbf{K\\gamma}\\tag{5} \\\\\n",
"\\mathbf{P}&= (\\mathbf{I}-\\mathbf{KH})\\mathbf{P}\\tag{6}\n",
"\\end{align}\n",
"$$\n",
"\n",
"\\mathbf{\\gamma} &= \\mathbf{z} - \\mathbf{H x} \\;\\;\\;&(3)\\\\\n",
"\\mathbf{K}&= \\mathbf{PH}^T (\\mathbf{HPH}^T + \\mathbf{R})^{-1}\\;\\;\\;&(4) \\\\\n",
"\\mathbf{x}&=\\mathbf{x}' +\\mathbf{K\\gamma} \\;\\;\\;&(5)\\\\\n",
"\\mathbf{P}&= (\\mathbf{I}-\\mathbf{KH})\\mathbf{P}\\;\\;\\;&(6)\n",
"\\end{aligned}\n",
"$$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This is an algorithm, so $=$ denotes assignment, not equality. For example, equation (6) has P on both sides of the $=$. This equation updates the value of P by the computation on the right hand side. \n",
"\n",
"Here, a $'$ means estimate, so $\\mathbf{x}'$ is the estimate of the state $\\mathbf{x}$. Many texts use $\\hat{\\mathbf{x}}$ or $\\mathbf{x}^*$ to express this. I find these choices unfortunate because we will often want to express these in matrix form. The notation of a hat over a matrix is clumsy at best, and an asterisk followin a matrix normally means the *complex congugate* of the matrix, which is *not* what is intended. So I use $'$. \n",
@@ -843,12 +894,18 @@
"> Later, if you become interested in the details of numerical computation you may change the implementation to be faster or more numerically stable than this written form, but for most of this book our code will follow the Kalman filter equations almost exactly. "
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Tracking a Dog"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Tracking a Dog\n",
"\n",
"Let's go back to our tried and true problem of tracking our dog. This time we will include the fundamental insight of this chapter - that of using *unobserved variables* to improve our estimates. In simple terms, our algorithm is:\n",
"\n",
" 1. predict the next value for x with \"x + vel*time\"\n",
@@ -902,17 +959,17 @@
"\n",
"\n",
"$$\n",
"\\begin{align*}\n",
"\\begin{aligned}\n",
"{\\begin{bmatrix}x\\\\\\dot{x}\\end{bmatrix}}' &=\\begin{bmatrix}1&\\Delta t \\\\ ?&?\\end{bmatrix} \\times \\begin{bmatrix}x \\\\ \\dot{x}\\end{bmatrix}\n",
"\\end{align*}\n",
"\\end{aligned}\n",
"$$\n",
"\n",
"When we multiply the first row of $\\mathbf{F}$ that out we get:\n",
"$$ \n",
"\\begin{align*}\n",
"\\begin{aligned}\n",
"x' &= 1 \\times x + \\Delta t * \\dot{x} \\mbox{, or} \\\\\n",
"x' &= \\dot{x}(\\Delta t) + x\n",
"\\end{align*}\n",
"\\end{aligned}\n",
"$$\n",
"\n",
"Now we have to account for the second row. I've let it somewhat unstated up to now, but we are assuming constant velocity for this problem. Naturally this assumption is not true; if our dog moves it must accelerate and deaccelerate. If you cast your mind back to the $g-h Filter$ chapter we explored the effect of assuming constant velocity. So long as the acceleration is small compared to $\\Delta t$ the filter will still perform well. \n",
@@ -931,10 +988,10 @@
"Which, when multiplied out, yields our desired equations:\n",
"\n",
"$$\n",
"\\begin{align*}\n",
"\\begin{aligned}\n",
"x' &= x + \\dot{x} \\\\\n",
"\\dot{x}' &= \\dot{x}\n",
"\\end{align*}\n",
"\\end{aligned}\n",
"$$\n",
"\n",
"In the vocabulary of Kalman filters we call this *transforming the state matrix*. We take our state matrix, which for us is $(\\begin{smallmatrix}x \\\\ \\dot{x}\\end{smallmatrix})$,and multipy it by a matrix we will call $F$ to compute the new state. In this case, $F=(\\begin{smallmatrix}1&1\\\\0&1\\end{smallmatrix})$. \n",
@@ -1026,12 +1083,18 @@
"The covariance matrix ($\\small{\\mathbf{P}}$) is a $n{\\times}n$ matrix that specifies the variances and covariances of each state variable. This is a complicated topic, and I'd rather demostrate the matrix rather than talk about it abstractly here. For now, recognize that the Kalman filter will be calculating the covariance matrix at each step, just like the 1-D filter computed the variance of the mean at each step. So as with those examples we can make an initial guess and trust that $\\small{\\mathbf{P}}$ will converge to a smaller value as the filter progresses. I find this description somewhat unsatisfactory for several reasons, but until you've seen some examples it is hard to talk about in an understandable way."
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Implementing the Kalman Filter"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Implementing the Kalman Filter\n",
"\n",
"As promised, the Kalman filter equations are already programmed for you. In many circumstances you will never have to write your own Kalman filter equations. We will look at the code later, but for now we will just import the code and use it. I have placed it in *KalmanFilter.py*, so let's start by importing it and creating a filter."
]
},
@@ -1103,10 +1166,6 @@
"\n",
"> Summary: For our dog tracking problem, in the 1-D case $\\mu$ was the position, and $\\sigma^2$ was the variance. In the 2-D case $\\small\\mathbf{x}$ is our position and velocity, and $\\small\\mathbf{P}$ is the *covariance* of the position and velocity. It is the same thing, just in higher dimensions!\n",
"\n",
">| | 1D | 2D and up|\n",
">|--|----|---|\n",
">|state|$\\mu$|$x$|\n",
">|uncertainty|$\\sigma^2$|$\\small\\mathbf{P}$|\n",
"\n",
"All that is left is to run the code! The *DogSensor* class from the previous chapter has been placed in *DogSensor.py*."
]
@@ -1152,7 +1211,7 @@
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 35
"prompt_number": 17
},
{
"cell_type": "markdown",
@@ -1220,7 +1279,7 @@
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 36
"prompt_number": 18
},
{
"cell_type": "markdown",
@@ -1241,9 +1300,9 @@
{
"metadata": {},
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAsgAAAF9CAYAAAAZRJ4tAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3Xdc1WX7wPHP2QdEcOIEyT0SxBypaYo+ztS0VEzTcuSg\nZaZlpZXrsfErsyx9nIlaae5RauLCAW4SKlNBc+AolX044/v7AyGRwz5Mr/fr5au+6/7eR6/oOrf3\nfV8qRVEUhBBCCCGEEACoi7oDQgghhBBCFCeSIAshhBBCCHEfSZCFEEIIIYS4jyTIQgghhBBC3EcS\nZCGEEEIIIe4jCbIQQgghhBD3kQRZCCHuef3111Gr1ajVajp16lTU3XGYvXv3olaruXTpUrrzp06d\nSvu89q4LIcTDShJkIUSpoFarWbFiRdqx2Wymf//+1K9fn6tXr+aojZkzZ3Lt2jUmTpyISqUqqK46\nzP3JbeovjUaT4fO2a9eO6Ohoatasme5806ZNiY6OJjQ0NNt3eXl58eGHHzq0/0IIUVxpi7oDQgjh\naBaLBX9/f8LDw9m7dy/Vq1fP0XMuLi64uLhQpkwZSkoNpS+++IJBgwalO1e5cuV0xzqdDnd39wzP\najQa3N3dSUhIyPY9JeELgxBCOIqMIAshShWLxcLgwYM5c+YMe/bsSZccT5w4kUaNGuHs7Iy7uzuj\nRo3i7t27OW57+fLlNGvWjCeeeAJ3d3cWL15M7dq1qVWr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l5P5K4UaiQuhRuJCqJG4yD1KqVIPTI7h7gjyfaWk2eHRpw/GefMyda4u\nOhprs2ZOeyFPTYYJ8pAhQ/D19SUoKChl38KFC6lYsSKVKlVi1apVD90vhBBCCCEeT/aqVdHEx+es\nEUVBFx6OIZMlo7YGDbgzZcoDj+/Zo6N9e88cdSnDEovdu3djNBp5/fXXOXToEBaLhcDAQMLCwkhM\nTKRp06ZERkY+cP/9pMSi4JK/YyGEEEKo0Z49S6HQUDQWC/8eOwYeHtlq56+/dIwb58apU1oGD06k\natU92S6xyLDQo379+kRFRaVsh4WFUbVqVYoVKwZAmTJlOHjwILdv31bdHxISkq1OCSGEEEKIgsFR\nqhSxmzcnz4aRjelrw8OTE+N//tHy3nuJdGt0CvOV8+zFlO0+ZakXMTExlChRgqlTp7Jo0SLine truncated
"text": [
"<matplotlib.figure.Figure at 0x44c7a10>"
"<matplotlib.figure.Figure at 0x2bd7cd0>"
]
},
{
@@ -1251,11 +1310,11 @@
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAsgAAAFyCAYAAADoEiz4AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X9wldd97/vPerYQP2zABkQkxZJ/VlJCQDaQXhtoJqDE\nTY5x73EbND7OJE0nbnWNnV5uJj1D5t65cc5MGqYdGtIemyGTNjNpk3OMr8lJwfdeT0zTXNtJRRIl\nRHHDL8dENkgYsEHCtrxB2vcPIVkG/eKJtJ+t9Xm/ZjxmL222nk9YXvmy9H2eFQqFQkEAAAAAJElJ\n1hcAAAAAlBIKZAAAAGAYCmQAAABgGApkAAAAYBgKZAAAAGAYCmQAAABgmHEL5NbWVi1btkzvfe97\nde+990qSdu7cqbq6OtXX12vPnj1D7x1tHABQPLlcTrfddptuu+02bdq0SRLrNgBciTDWc5D7+/v1\nnve8R9/4xje0atUqnT59WnPnzlVDQ4NaW1vV29urtWvX6siRI8rn8yOOAwCKa+7cuerp6Rl6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hsNgCQAzYQQbg\nIrMCOYRg86g3x54fMntwzOyMNTteZPbgmDmtzApkyetGPQCY7pIQ+KkfAAsZF8geuxGOPTLine truncated
"text": [
"<matplotlib.figure.Figure at 0x43e1150>"
"<matplotlib.figure.Figure at 0x283e650>"
]
}
],
"prompt_number": 37
"prompt_number": 19
},
{
"cell_type": "markdown",
@@ -1270,12 +1329,18 @@
"In the previous chapter we filtered very noisy signals with much simpler code than the code above. However, realize that right now we are working with a very simple example - an object moving through 1-D space and one sensor. That is about the limit of what we can compute with the code in the last chapter. In contrast, we can implement very complicated, multidimensional filter with this code merely by altering are assignments to the filter's variables. Perhaps we want to track 100 dimensions in financial models. Or we have an aircraft with a GPS, INS, TACAN, radar altimeter, baro altimeter, and airspeed indicator, and we want to integrate all those sensors into a model that predicts position, velocity, and accelerations in 3D (which requires 9 state variables). We can do that with the code in this chapter."
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Walking Through the KalmanFilter Code (Optional)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"###Walking Through the KalmanFilter Code (Optional)\n",
"\n",
"The code in the $KalmanFilter$ is a nearly verbatim transcription of the linear algebra equations. I take advantage of numpy matrices to implement the linear algebra. It is worth looking at this code if for no other reason than to realize how easy it is to implement linear algebra with Python and numpy. For most of this book you will only really need to know how to call this class, not how to implement it from scratch.\n",
"\n",
"> **sidebar**: numpy provides two data structures which can be used to perform linear algebra: *numpy.array* and *numpy.matrix*. The usual advice is to use *numpy.array*, not *numpy.matrix*. Ever the contrarian, I have chosen to use *numpy.matrix*, but for what I think are good pedalogical reasons. *numpy.array* is usually recommended because it can be sized to any arbitrary number of dimensions, and *numpy.matrix* is constrained to two dimensions. However, for Kalman filters we only need 2 dimensions. More importantly, *numpy.matrix* allows you to use very natural sytax. Multipying a by b is written *a&ast;b* if using *numpy.matrix*, but *a.dot(b)* if they are *numpy.array*. It is also more natural to mix scalars and matrices using *numpy.matrix*. Finally, the resulting code is extremely close to the equivelent Matlab code; if you are more familiar with Matlab than Python this code should feel very familiar to you.\n",
@@ -1305,10 +1370,10 @@
"This is nothing more than a transliteration of these equations.\n",
"\n",
"$$\n",
"\\begin{align}\n",
"\\begin{aligned}\n",
"\\mathbf{x}' &= \\mathbf{F x} + \\mathbf{B u}\\\\\n",
"\\mathbf{P} &= \\mathbf{FP{F}}^T + \\mathbf{Q}\n",
"\\end{align}\n",
"\\end{aligned}\n",
"$$\n",
"\n",
"Finally, the *update()* function implements the Kalman filter update equations in an equally straightforward way:\n",
@@ -1376,13 +1441,21 @@
],
"language": "python",
"metadata": {},
"outputs": []
"outputs": [],
"prompt_number": 20
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Adjusting the Filter"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"###Adjusting the Filter\n",
"Your results will vary slightly depending on what numbers your random generator creates for the noise componenet of the noise, but the filter in the last section should track the actual position quite well. Typically as the filter starts up the first several predictions are quite bad, and varies a lot. But as the filter builds its state the estimates become much better. \n",
"\n",
"Let's start varying our parameters to see the effect of various changes. This is a *very normal* thing to be doing with Kalman filters. It is difficult, and often impossible to exactly model our sensors. An imperfect model means imperfect output from our filter. Engineers spend a lot of time tuning Kalman filters so that they perform well with real world sensors. We will spend time now to learn the effect of these changes. As you learn the effect of each change you will develop an intuition for how to design a Kalman filter. As I wrote earlier, designing a Kalman filter is as much art as science. The science is, roughly, designing the $\\small{\\mathbf{H}}$ and $\\small{\\mathbf{F}}$ matrices - they develop in an obvious manner based on the physics of the system we are modelling. The art comes in modelling the sensors and selecting appropriate values for the rest of our variables.\n",
@@ -1403,21 +1476,21 @@
{
"metadata": {},
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAsYAAAF9CAYAAAAHja6eAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3Xd4VFX6wPHvnZqEFCBAAiEh9A5SQkkApQiCBVHBRhNd\nUcEVV0R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CgQQC0atWKVq1aueR6x44dIzIyssJji9pL6uS0TeKnXRI7bavt8StaRlEgKsrC/Pke\nVTQj19JMYlx3gTqrpVeeueLwOd9++y0LFy7k7Nmz2Gw20tPTMZvNnDt3jqCgIFXmZc/1hBBCCCEq\nU1KSnuDg4olxt24Wfv7ZSE5OfmlFTaKZxNiZhFYNp0+fZurUqaxbt45u3boB0LJlSxRFoUmTJiQk\nJNz0fJ2uZBNsd3d3ACwWCyaTifQiFew3u14BNzc3IH+3QL1eysSFfWJjY2v9yoeWSfy0S2KnbbU9\nfkU7UhTw9YXQUCsHDhjp2bNmlVNIVlWOzMxMdDod9evXx2Kx8OGHH3L9+nV0Oh333nsvW7ZsYcOG\nDVitVk6ePMnevXuLnd+wYUMSExOLPVe/fn38/Pw4cOAAAOvWrSv3ekUFBATg5+fHrl27XPSuhRBC\nCKFFHu+8g+78edXGK3rjXVE1tZ+xJMblCAsLY+LEidx+++20a9eOzMzMwvKJ4OBgli1bxjvvvEOL\nFi0YM2ZMiU03XnrpJWbMmEH79u2ZPXs2AAaDgddee40nn3ySu+66i/r16xeuLN/segUMBgNvv/02\nTz31FMHBwfz3v/+thK+E0LravOJRE0j8tEtip22aip+i4DlnDvor6n3KXrDr3Y1qamKsUyq5Ke7m\nzZuJiIgo8fy5c+do3LhxZU5FVDKJsRBCCOE6uvPn8evTh+vHjqk2Zrdufnz9dQahocUX/q5d03Hr\nrf6cOHGNPyo8q6X4+HgGDBhg9/GyYixELVHbe3FqncRPuyR22qal+BkSE7G2bavaeDYbnDlT8uY7\ngFtuUWjWzEpCgkG161UHkhgLIYQQQtQAhsOHVU2Mz5/XUaeOgqdn6a/XxO2hJTEWopbQVJ2cKEHi\np10SO23TUvwMhw9jbddOtfGSkw2lrhYXiIqqeYlxzXo3QgghhBC1VPYLL4C3959PKAqU0jLine truncated
"text": [
"<matplotlib.figure.Figure at 0x44365d0>"
"<matplotlib.figure.Figure at 0x2854e10>"
]
},
{
"metadata": {},
"output_type": "display_data",
"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iRkiVLAtC0\naVOCgoIYN26cqz79QgghhBDZRhJjBxgMBo4cOcKuXbvo27cv3bt3Z/PmzXz66adERkaya9Line truncated
"text": [
"<matplotlib.figure.Figure at 0x4442650>"
"<matplotlib.figure.Figure at 0x2cdfcd0>"
]
}
],
"prompt_number": 38
"prompt_number": 21
},
{
"cell_type": "markdown",
@@ -1444,7 +1517,17 @@
],
"language": "python",
"metadata": {},
"outputs": []
"outputs": [
{
"metadata": {},
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAsYAAAF9CAYAAAAHja6eAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3XtczfcfB/DXuVe6oHRBya0ityh3NtmQ21wqP2YMs2zs\nYhuzmY2NYZuNbQxzGWajMPeR+2WIRMjkMoQk966nc/v+/midSd9Sp3PqxOv5eHjw/Z7v9/N5n9P7\nkXffPheJIAgCiIiIiIiecdLyDoCIiIiIyBqwMCYiIiIiAgtjIiIiIiIALIyJiIiIiACwMCYiIiIi\nAsDCmIiIiIgIAAtjIiIiIiIALIyJyEpIpVLjn6pVq6Jt27b4448/yiWW6dOno3379qhUqRKkUvFv\nk0uWLEHdunVha2uLVq1a4dixY/leT09Px7Bhw1C5cmVUrlwZI0aMQFZWVr5rYmJiEBQUBFtbW9Sr\nVw/Lli2zyPvZunUrmjZtChsbG3h7e2PWrFkW6edJivOZPMnZs2cRHh6OOnXqQCqVYsqUKRaKloie\nRSyMichqzJkzBykpKTh48CAaN26MsLAwHD16tMzjyMrKQv/+/fHGG29AIpEUeH3nzp0YOXIk3nnn\nHZw4cQJ+fn4ICQnB/fv3jde88cYb2LdvH7Zu3YotW7Zg586dGD16tPH1O3fuoFu3bmjcuDFOnDiB\nMWPGYPjw4di7d69Z30tCQgL69OmDjh07Ij4+HhMnTsSECROwdOlSs/ZTHE/6TIojIyMDXl5e+PLL\nL+Hu7i769SEiMplARGQFJBKJsGzZMuNxWlqaIJFIhO+++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OPexLDvCAxzAsSw7wgc3g6\nqioLyszMhEQigYuLC3Q6HX744Qc8fPgQEokE/fv3x+7du7Ft2zbo9Xr8888/iImJyXe/m5sbzp49\nm++ci4sLHB0dcfz4cQDAxo0bn9jfo1xdXeHo6Ii//vrLQu+aiIiI6NnDwvgJ/Pz8MHr0aLzwwgto\n2LAhMjMzjcMnvLy8sHLlSnzzzTeoU6cOBg4cWGDTjU8++QTjx4+Hv78/pk6dCgCQyWT4/PPP8frr\nr6NHjx5wcXExPlkuqr88MpkMX3/9NUaNGgUvLy/8+eefZfBJWBZ/yicxzAsSw7wgMcwLMgeJUMaL\n4u7atQvNmzcvcD45ORnVq1cvy1CojPFrTERERGUpLi4OnTt3Lvb1fGJMVoHrT5IY5gWJYV6QGOYF\nmQMLYyIiIiIisDAmK8GxYSSGeUFimBckhnlB5sDCmIiIiIgILIzJSnBsGIlhXpAY5gWJYV6QObAw\nJiIiIiICC2OyEhwbRmKYFySGeUFimBdkDiyMiYiIiIjAwpisBMeGkRjmBYlhXpAY5gWZAwtjMgtn\nZ2dcuXKlvMMgIiIiMhkLYyq1vF3FS7O7OMeGkRjmBYlhXpAY5gWZAwvjJ/jtt98QHBwMf39/DB8+\nHAMHDkSDBg1w9uxZGAwGzJw5E82aNYOfnx8mTJgAnU4HALh69Speeukl1KlTB7Vq1cKwYcOQlpZm\nbHf79u1o2bIlvLy8EBQUhN27dxtfa9q0Kfbt22c8fvxp7OjRo/HRRx9hyJAh8PLyQtOmTZGRkQEA\n2LRpE9q2bYs6depgwIABuHXrlvGeXr16wcfHB59++ilatWqF4OBgZGdnAwDu37+PiIgI+PLine truncated
"text": [
"<matplotlib.figure.Figure at 0x2cabad0>"
]
}
],
"prompt_number": 22
},
{
"cell_type": "markdown",
@@ -1457,20 +1540,19 @@
"To some extent you can get similar looking output by varying either $\\small{\\mathbf{R}}$ or $\\small{\\mathbf{Q}}$, but I urge you to not 'magically' alter these until you get output that you like. Always think about the physical implications of these assignments, and vary $\\small{\\mathbf{R}}$ and/or $\\small{\\mathbf{Q}}$ based on your knowledge of the system you are filtering."
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"A Detailed Examination of the Covariance Matrix"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### A Detailed Examination of the Covariance Matrix\n",
"\n",
"So far I have not given a lot of coverage of the covariance matrix. It is time to look at it more closely. Recall this table comparing the one dimensional and multidimensional Kalman filter.\n",
"\n",
"| | 1D | 2+D|\n",
"|--|----|---|\n",
"|state|$\\mu$|$x$|\n",
"|uncertainty|$\\sigma^2$|$\\small\\mathbf{P}$|\n",
"\n",
"This should remind you that $\\small\\mathbf{P}$, the covariance matrix is nothing more than the variance of our state - such as the position of our dog. It has many elements in it, but don't be daunted; we will learn how to interpret a very large $9{\\times}9$ covariance matrix, or even larger.\n",
"So far I have not given a lot of coverage of the covariance matrix. $\\small\\mathbf{P}$, the covariance matrix is nothing more than the variance of our state - such as the position of our dog. It has many elements in it, but don't be daunted; we will learn how to interpret a very large $9{\\times}9$ covariance matrix, or even larger.\n",
"\n",
"Recall the beginning of the chapter, where we provided the equation for the covariance matrix. It read:\n",
"\n",
@@ -1511,11 +1593,11 @@
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAr0AAAGNCAYAAAActsnoAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl4VFW67/FfVaoykYExImAYHICWgICgYmQQQU4LOCuN\nVxsFbUHsg4pDD6jYfWg9NrQ+aoPIsR1arkA7AioIigoitkYBJ67KEAaDGiDzVKm6f+RAt1pAUqmq\nvdau7+d5eGSHUHn1Z+39ZuXda3tCoVBIAAAAgIt5nS4AAAAAiDWaXgAAALgeTS8AAABcj6YXAAAA\nrkfTCwAAANej6QUAAIDr0fQCQJSsWbNGXq8Zp9WhQ4dq5syZTpcBAMYw4+wMAC524MAB3XDDDTrx\nxBOVnp6uzp07a+rUqTpw4ECTXicQCOj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Prt\nb9O0fXuSnniiXMnJTldkr4ON79y5KVq8mP+QAOwS8Uzvt99+q7179yovL0+FhYUaNGiQdu3adejP\nmekFYIL77kvV8uV+LV1aruzsmNzCkHA+/9yr88/P1N/+VqEzz2RvYwDOa8xMb8QrvTk5OcLine truncated
"text": [
"<matplotlib.figure.Figure at 0x45a1990>"
"<matplotlib.figure.Figure at 0x22e5350>"
]
}
],
"prompt_number": 39
"prompt_number": 23
},
{
"cell_type": "markdown",
@@ -1540,11 +1622,11 @@
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAr0AAAGNCAYAAAActsnoAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xd4VGX6//HPtJRJQlBiREooUqQEBSwLRFACqIuufFXs\nIiqLC9hA7LrYUCysLIuriKuigrKsygqoKCAgKAhGkSIouhjKhhJKCimTZH5/8IMVHSAZZnLOc+b9\nui6uyxMmJ7d+PJM7T+7zHFcwGAwKAAAAcDC31QUAAAAA0UbTCwAAAMej6QUAAIDj0fQCAADA8Wh6\nAQAA4Hg0vQAAAHA8ml4AMWnBggVyu3kLrKmBAwfqhhtusLoMAKgx3vEB4Bf27NmjYcOGqWXLlvL7\n/WrSpIluueUW7dmzp0bnqaio0IgRI5Senq7k5GRdcskl2r59e0Rrrays1F133aV27dopKSlJDRo0\n0HXXXafNmzeHfc4xY8bI7XbrkUceCfn3LpdLLpcr7PMDgFVoegHgF7Zt26Zt27Zp3LhxWrNmjV55\n5RXNnDlTV1xxRY3O8/DDD+u1117T66+/rkWLFunnn3+u8TmOprS0VCtXrtSjjz6qlStX6t1339Xq\n1at1/vnnq7KyssbnW758uaZOnar69esfsbHlmUYATOS1ugAAsJPWrVvrX//618HjZs2aafjw4brz\nzjtVWFiolJSUo56jqqpKL774ou6++26df/75kqRx48apR48eWr16tdq3bx+RWpOSkvTxxx8fPG7R\nooVGjRqlSy65RN99912Nvk5RUZGuv/56vfbaaxFvz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EV2ZiM/56PpBQAAgOMx0wsAAACjMdMLAAAAiKYXh8Fsk7nIzmzkZy6yMxv5OR9N\nLwAAAByPmV4AAAAYjZleAAAAQDS9OAxmm8xFdmYjP3ORndnIz/loegEAAOB4zPQCAADAaMz0AgAA\nAJK8VhcAe1q8eLGysrKsLgNhIDuzmZ5fQYG0fLlXGzd6tGmTW5s3u7Vjh0sej5SQEFR8vFS/fpVO\nPbVSHTpUqFWrKnkd8p3I9OxiHfk5n0PeagAAVggEpIULvVq40KfPP/fqhx88Ou20CrVsWaVGjarU\nrl1A6elVqqiQystdKi2VNm1ya+5cn/7ylwTl57t06aXluvbacnXoUGn1vw4AB2OmFwBQI8GgtHq1\nR2+9Fad33olTkyZV6t07oKysCnXqVKH4+Oqfa/Nml6ZMideUKXFKTw9q9Oh9Oussml8ANVOdmV5W\negEA1RIISO++G6fnn4/X3r0uXXFFuT74oFAnn1wV9jkbNQrqnntKNXJkqWbM8OnGG5PVq1dAo0aV\n6Pjjo7ImAyBGcSMbQmK/QnORndnsmF9pqfTKK3E644w6mjIlTg8/XKKvvy7Q/feXHlPD+0sej3Tp\npQF98cVeJSYG1b17Ha1e7YnIuWuLHbND9ZGf87HSCwAIqbJSmjw5Ts8+m6gOHSo0cWJx1EcP6tSR\nxowp0ZlnVuiSS5I1aVKxevSoiOrXBBAbmOkFAPzGkiVe3XtvolJTgxo9ukSnnlr7c7aLF3t1441J\nmjChWH360PgCODz26QUA1MimTW7dcEOShgzx6847SzVzZpElDa8kZWVVaOrUIt1yS5LWreLine truncated
"text": [
"<matplotlib.figure.Figure at 0x43e1b90>"
"<matplotlib.figure.Figure at 0x2853350>"
]
}
],
"prompt_number": 40
"prompt_number": 24
},
{
"cell_type": "markdown",
@@ -1561,17 +1643,17 @@
"\n",
"Look at the computation for the off diagonal elements. \n",
"\n",
"$$\\begin{align*}\n",
"$$\\begin{aligned}\n",
"\\mathbf{P}_{0,1}&=p\\sigma_1\\sigma_2 \\\\\n",
"\\mathbf{P}_{1,0}&=p\\sigma_2\\sigma_1.\n",
"\\end{align*}$$\n",
"\\end{aligned}$$\n",
"\n",
"If we re-arrange terms we get\n",
"$$\\begin{align*}\n",
"$$\\begin{aligned}\n",
"\\mathbf{P}_{0,1}&=p\\sigma_1\\sigma_2 \\\\\n",
"\\mathbf{P}_{1,0}&=p\\sigma_1\\sigma_1 \\mbox{, yielding} \\\\\n",
"\\mathbf{P}_{0,1}&=P_{1,0}\n",
"\\end{align*}$$\n",
"\\end{aligned}$$\n",
"\n",
"In general, we can state that $\\small\\mathbf{P}_{i,j}=\\small\\mathbf{P}_{j,i}$.\n",
"\n",
@@ -1629,21 +1711,21 @@
{
"metadata": {},
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAroAAAF9CAYAAADr+MuIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3XmcjXX/x/HXdfbZGYx9DEOWsS9ZGrJXSoWQJREhWiik\nqB+hcEfFLUsqFImQm5KtzU6UZSy3fZgxdmY9c7br98e5DWP2hWvm+DwfD4+Hs1zX+c57jjOf+fpc\n36+iqqqKEEIIIYQQHkan9QCEEEIIIYS4F6TQFUIIIYQQHkkKXSGEEEII4ZGk0BVCCCGEEB5JCl0h\nhBBCCOGRpNAVQgghhBAeSQpdIYQQQgjhkaTQFUKIPNDpdCl/AgMDadasGatWrdJ8LLf+bNiwQZOx\nCCFEQSCFrhBC5NFnn31GTEwMW7dupVatWnTt2pXdu3drMpaVK1cSExOT8qdVq1aajEMIIQoCKXSF\nECKPAgICCAoKokaNGnz88ce4XC62b9+uyViKFi1KUFBQyh+j0ajJOIQQoiCQQlcIIfLo1k7qdrud\nr776Cp1OR5MmTbJ1bGRkJL6+vvj5+aX7Z9u2bTkaS58+fShRogRNmjRhyZIlOf5ahBDCkyjqrU9o\nIYQQOabT6TCbzRgMBpKSkqhatSpz5syhefPm2Tre6XRy9uzZDB8vU6YMFoslW+eaPHkyrVq1wm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IAiKkiT\na0MEu4BXUHgvihFRFFBAgQtcmgSQIoQuURAiIM1ASJCankw77x9zE4jppJzM8HzWYi2nnDM7v4yZ\nJzvP2VujKIqCEEIIIYQQbkar9gCEEEIIIYQoC1LoCiGEEEIItySFrhBCCCGEcEtS6AohhBBCCLck\nha4QQgghhHBLUugKIYQQQgi3JIWuEEIIIYRwS1LoCiFECWi12ux/lStXJjQ0lNWrV6s+lqx/mzdv\nVmUsQghREUihK4QQJfTxxx+TkJBAVFQUQUFBDBgwgAMHDqgyllWrVpGQkJD97/7771dlHEIIURFI\noSuEECXk5+eHv78/LVq0YObMmTgcDvbs2aPKWCpVqoS/v3/2P4PBoMo4hBCiIpBCVwghSihrJ3Wr\n1crXX3+NVqulU6dORTo2NjYWb29vfHx88vy3e/fuYo1l2LBhVKtWjU6dOrF06dJify1CCOFONErW\nT2ghhBDFptVqMZlM6PV60tPTadasGZ9//jn33HNPkY632+38+eef+T5eq1YtzGZzkc41ffp07r//\nfkwmE2vWrGHq1KnMnz+f4cOHF+l4IYRwN1LoCiFECWi1Wj788EP69evH4cOHefrpp5k6dSr//Oc/\n1R4aI0aMYP/+/fz2229qD0UIIVQhrQtCCFFC/v7+NGrUiP79+zN16lTeeustrl27VqRjS7t14VYh\nISGcPXv2to8XQghXp1d7AEII4U5GjRrFtGnT+Pjjj3nvvfcKfX7t2rU5cuRIvo/XqlXrtscSExND\nw4YNb/t4IYRwdVLoCiFEKTKZTDz33HNERETw2muv4enpWeDzdTpdqRSja9asIS4ujrCwMDw9PYmM\njGT+/PnMnTu3xOcWQghXJa0LQghRysaNG0dycjLz588vt9c0m83MnTuXLl260KZNG77++mu++OIL\nnn766XIbgxBCVDQFXox29epVHnzwQaxWK4qi8MYbbzBw4ECWL1/Om2++iUajYdasWTzyyCPlOWYh\nhBBCCCEKVWCha7PZsFgseHp6cvXqVZo3b05cXBzNmjVj//79ZGRkcP/993Pq1KnyHLMQQgghhBCF\nKrB1Qa/XZ/eX3bhxA5PJxP79+2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q1a5fr8SlTpqDT6di/fz/e3t7MmzePNWvWZD/eoUMHli5disVi4aWXXuJf//oX3377\nLeAsTrN6fW/t671VVnF9qzp16jBhwgRefPHFYn0ttWvXxmw2c+bMmUJbJvJzu8cJIYQQQpQ3aV0o\nQNbqAkOHDuVf//oXCQkJKIrCqVOn2L59OwCpqal4e3vj6enJn3/+ycKFC3Mcv3z5clJSUrILRF9f\n3+zHGzVqxKFDhwBYu3Ztkcc1ePBgFixYwJEjR1AUhcuXL7N69epc4/676tWrExoayrvvvktqaipW\nq5X9+/fnaLXIL4NbzxETE1Pksd4Od+0TchWSv7okf/VI9uqS/NXlrvlLofs/f78wLOu2RqLine truncated
"text": [
"<matplotlib.figure.Figure at 0x4453d10>"
"<matplotlib.figure.Figure at 0x2851510>"
]
},
{
"metadata": {},
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAsYAAAF9CAYAAAAHja6eAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3Xl4VOXZx/HvmSWTPUBCFkKGbOwQ9tWwIy6ACBWsglhf\nNypaUZFSqda1RVtb1FLF2hatuEAVN6qiiEjYJUDYyh4CWSAEsi+znfePMRMmM4EkHDIJ3J/r4rqc\nOWfOPPkxSW4e7/M8iqqqKkIIIYQQQlzldL4egBBCCCGEEM2BFMZCCCGEEEIghbEQQgghhBCAFMZC\nCCGEEEIAUhgLIYQQQggBSGEshBBCCCEEIIWxEEIIIYQQgBTGQgjRYDqdzvWnTZs2DB06lJUrV/pk\nLAcPHmT06NEEBgYSFxfHSy+91OBrjBw50u1r0ul0PPHEE5dhtEII0bxJYSyEEI3wyiuvkJeXR1pa\nGj179mTq1Kls3bq1ScdgsVi44YYbCAgIYOvWrSxcuJAnn3ySt99+u0HXURSFuXPnkpeX5/qzYMGC\nyzRqIYRovqQwFkKIRggLCyMyMpJu3brxpz/9CYfDwcaNG5t0DF9++SXHjh3jrbfeokePHkyfPp0Z\nM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jNgwAC+++4717FevXqxbt061+Pas7GzZ8/mN7/5DTNn\nzsRsNtOrVy9KS0sB+Pzzzxk6dCiJiYnceuutnDp1yvWaiRMn0qlTJ5566ikGDRrE6NGjqaioAODc\nuXPcf//9dOnShT59+vDOO++4vd9DDz3EjTfeiNls5qGHHnIdmzp1Kh06dABg+PDhmM1mFixYoFX8\nQgghhBBNRgrjejCZTGzatImvvvqKu+++mxkzZrBy5Ur++te/8vXXX/PVV1/x448/cuDAAZYsWQKA\nxWLhzjvvZM+ePezZs4dz587x4osvuq45Z84cnnjiCbKysvj444+JiYlxHVMUBUVRLjim5cuXM2PG\nDI4fP86yZcswGAxs376dhx9+mMWLF3P48GFSUlJ45JFHXK8ZNGgQb7zxBn//+99ZvXo1/v7+bN26\nFYBZs2bh5+fHrl27WLlyJS+++CI7d+50vfb777/n73//Oxs3buTTTz8lPT0dgBUrVpCVlQXA+vXr\nycrK4oUXXrjExH1D+rq0JXlqS/LUluSpHclSW5Knb0lhXA8JCQmEhobSpk0bkpOTMZvN5Ofns2zZ\nMh5//HGio6MJDg7m7rvv5osvvgCgY8eOTJkyhcDAQEJCQrjpppvYu3ev65o6nY5jx45RXFxMXFwc\nXbt2bdCYhg0bxrhx41AUhR49euDv78+7777LbbfdRp8+fdDpdMyePZvVq1djsVhcX0d8fDwRERGE\nhYVhNps5c+YMeXl5rFmzhueffx6TyUR8fDwTJ05k1apVrve74YYbiI2NpX379nTr1o0jR45okKwQ\nQgghRPNh8PUA6st/4UICXnrJ4/mKefOonD+/XufXde7FVM/eGgwG9Ho9BoMBm81GdnY2s2bNQqdz\n/vvC4XAQHR0NQH5+PvPnz2fz5s2Ul5djtVrp3bu365r/+te/WLRoEa+++iodO3bklVdeaVBxnJSU\n5PFcdnY2Gzdu5L333nM9ZzKZXO0U1WPX6/Wux1arlZycHAC38dntdqZMmeJ6HBYW5vpvPzLine truncated
"png": "iVBORw0KGgoAAAANSUhEUgAAAroAAAF9CAYAAADr+MuIAAAABHNCSVQICA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1hEbG0toaCjh4eF069aN6OhoTp8+zZIl\nS3jsscfo0KEDwcHBzJ49m5UrVwLQvXt3Jk+eTGBgICEhIdx4443s27ev9pg6nY5jx45RXFxMVFQU\nvXv3vqgxjRw5kgkTJqAoCn379sXf359PPvmEadOmkZiYiE6nY86cOaxZs4bq6urazxETE0Pbtm0J\nCwsjOjqaM2fOkJeXx7p163juuecwmUzExMQwadIkvvnmm9r3mzhxIp06daJz58706dOHjIyMK5Cs\nEEIIIUTTM2g9gAv5v/giAX//u9P9FfPmUTl/foOe7+659amZXTUYDOj1egwGAxaLhezsbO699150\nOvvPBTabjQ4dOgBw+vRp5s+fz5YtWygvL8dsNjNgwIDaY77//vu8+uqrvP7663Tv3p3XXnvtoord\nrl27Ot2XnZ3NTz/9xKefflp7n8lkqm1fqBm7Xq+vvW02m8nJyQFwGJ/VamXy5Mm1t8PCwmLine truncated
"text": [
"<matplotlib.figure.Figure at 0x4ab3c10>"
"<matplotlib.figure.Figure at 0x2bd8110>"
]
}
],
"prompt_number": 46
"prompt_number": 25
},
{
"cell_type": "markdown",
@@ -1658,16 +1740,33 @@
"In contrast, the second plot, with $\\small\\mathbf{R}=0.5$, has a final ellipse that is taller than wide. The ellipses in the second plot are all much smaller than the ellipses in the first plot. This stands to reason because a small $\\small\\mathbf{R}$ implies a small amount of noise in our measurements. Small noise means accurate predictions, and thus a strong belief in our position. "
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Question: Explain Ellipse Differences"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Why are the ellipses for $R=5$ shorter, and more tilted than the ellipses for $\\small\\mathbf{R}=0.5$. Hint: think about this in the context of what these ellipses mean physically, not in terms of the math. If you aren't sure about the answer,change $\\small\\mathbf{R}$ to truly large and small numbers such as 100 and 0.1, observe the changes, and think about what this means. "
]
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Solution"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##### Question: Explain Ellipse Differences\n",
"\n",
"Why are the ellipses for $R=5$ shorter, and more tilted than the ellipses for $\\small\\mathbf{R}=0.5$. Hint: think about this in the context of what these ellipses mean physically, not in terms of the math. If you aren't sure about the answer,change $\\small\\mathbf{R}$ to truly large and small numbers such as 100 and 0.1, observe the changes, and think about what this means. \n",
"\n",
"##### Solution\n",
"\n",
"The $x$ axis is for position, and $y$ is velocity. An ellipse that is vertical, or nearly so, says there is no correlation between position and velocity, and an ellipse that is diagnal says that there is a lot of correlation. Phrased that way, it sounds unlikely - either they are correlated or not. But this is a measure of the *output of the filter*, not a description of the actual, physical world. When $\\small\\mathbf{R}$ is very large we are telling the filter that there is a lot of noise in the measurements. In that case the Kalman gain $\\small\\mathbf{K}$ is set to favor the prediction over the measurement, and the prediction comes from the velocity state variable. So, there is a large correlation between $x$ and $\\dot{x}$. Conversely, if $\\small\\mathbf{R}$ is small, we are telling the filter that the measurement is very trustworthy, and $\\small\\mathbf{K}$ is set to favor the measurement over the prediction. Why would the filter want to use the prediction if the measurement is nearly perfect? If the filter is not using much from the prediction there will be very little correlation reported. \n",
"\n",
"**This is a critical point to understand!**. The Kalman filter is just a mathematical model for a real world system. A report of little correlation *does not mean* there is no correlation in the physical system, just that there was no correlation in the mathematical model. It's just a report of how much measurement vs prediction was incorporated into the model. \n",
@@ -1689,11 +1788,11 @@
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAA3wAAAF9CAYAAABf12quAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3Xd8FHX++PHXzJb0hEAgJEASSoBAkFBCrwIqAqJy2PXs\nIEE9LOgdeHqKeP7UU/A4xK9nBU5B6SoqSIQgIBA6SK+B0EJJ353y+2PIQoRQk+wmeT8fj3nMzNZP\n3ruEvOf9KYppmiZCCCGEEEIIISod1dsNEEIIIYQQQghRNiThE0IIIYQQQohKShI+IYQQQgghhKik\nJOETQgghhBBCiEpKEj4hhBBCCCGE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OR//3Oybp2NW25xc9ddhbRrp1eYMZ1VjXTpFKJkUuETQghRatxu2LlT5fffbWzZYmPr\nViu5273bRrVq1jT6jRpZyV2fPm7i4w3q1TOkUid8SmgoDB7sYvBgFwcOKEyf7sdTTwVhGHDnnS7u\nvbeQqCi5GCGEqBgk4ROilMk4Du+S+JcPXYc9e1S2bLF5krvff7excyfUrQsJCTpNm+r07+Line truncated
"text": [
"<matplotlib.figure.Figure at 0x45089d0>"
"<matplotlib.figure.Figure at 0x2589110>"
]
}
],
"prompt_number": 43
"prompt_number": 26
},
{
"cell_type": "markdown",
@@ -1718,7 +1817,7 @@
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 29
"prompt_number": 26
}
],
"metadata": {}
+94 -38
View File
@@ -1,7 +1,7 @@
{
"metadata": {
"name": "",
"signature": "sha256:136798fb33e978117815e8cc04f4e7c4365f59442a30151e6a2f3e3d796c5e9f"
"signature": "sha256:0b133277ac85f975c916bc21148ad9bfba4634dc26c82d0842b53aee56e01439"
},
"nbformat": 3,
"nbformat_minor": 0,
@@ -17,11 +17,21 @@
"\n",
"### Version 0.0\n",
"\n",
"Not ready for public consumption. In development.\n",
"\n",
"\n",
"# Motivation\n",
"\n",
"Not ready for public consumption. In development."
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Motivation"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This is a book for programmers that have a need or interest in Kalman filtering. The motivation for this book came out of my desire for a gentle introduction to Kalman filtering. I'm a software engineer that spent almost two decades in the avionics field, and so I have always been 'bumping elbows' with the Kalman filter, but never had the need to implement one myself. As I moved into solving tracking problems with computer vision I needed to start implementing them. There are classic textbooks in the field, such as Grewal and Andrew's excellent *Kalman Filtering*. But sitting down and trying to read these books is a dismal and trying experience if you do not have the background. Typcially the first few chapters fly through several years of undergraduate math, blithely referring you to textbooks on, for example, It\u014d calculus, and presenting an entire semester's worth of statistics in a few brief paragraphs. These books are good textbooks for an upper undergraduate course, and an invaluable reference to researchers and professionals, but the going is truly difficult for the more casual reader. Symbology is introduced without explanation, different texts use different words and variables names for the same concept, and the books are almost devoid of examples or worked problems. I often found myself able to parse the words and comprehend the mathematics of a defition, but had no idea as to what real world phenomena these words and math were attempting to describe. \"But what does that *mean?*\" was my repeated thought.\n",
"\n",
"However, as I began to finally understand the Kalman filter I realized the underlying concepts are quite straightforward. A few simple probability rules, some intuition about how we integrate disparate knowledge to explain events in our everyday life and the core concepts of the Kalman filter are accessible. Kalman filters have a reputation for difficulty, but shorn of much of the formal terminology the beauty of the subject and of their math became clear to me, and I fell in love with the topic. \n",
@@ -37,13 +47,21 @@
"\n",
"This book has supporting libraries for computing statistics, plotting various things related to filters, and for the various filters that we cover. This does require a strong caveat; most code is written for didactic purposes. It is rare that I chose the most efficient solution (which often obscures the intent of the code), and I mostly did not concern myself with numerical stability. This is important to understand - Kalman filters in aircraft are carefully designed and implemented to be numerically stable; the naive implemention is not stable in many cases. If you are serious about Kalman filters this book will not be the last book you need. My intention is to introduce you to the concepts and mathematics, and to get you to the point where the textbooks are approachable.\n",
"\n",
"Finally, this book is free. The cost for the books required to learn Kalman filtering is somewhat prohibitive even for a Silicon Valley engineer like myself; I cannot believe the are within the reach of someone in a depressed economy, or a financially struggling student. I have gained so much from free software like Python, and free books like those from Allen B. Downey [here](http://www.greenteapress.com/). It's time to repay that. So, the book is free, it is hosted on free servers, and it uses free software for all of the code. \n",
"\n",
"\n",
"\n",
"\n",
"###Reading the book\n",
"\n",
"Finally, this book is free. The cost for the books required to learn Kalman filtering is somewhat prohibitive even for a Silicon Valley engineer like myself; I cannot believe the are within the reach of someone in a depressed economy, or a financially struggling student. I have gained so much from free software like Python, and free books like those from Allen B. Downey [here](http://www.greenteapress.com/). It's time to repay that. So, the book is free, it is hosted on free servers, and it uses free software for all of the code. "
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Reading the book"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"There are multiple ways to read this book. However, it is intended to be interactive and I recommend using it in that form. If you install IPython on your computer and then clone this book you will be able to run all of the code in the book yourself. You can perform experiments, see how filters react to different data, see how different filters react to the same data, and so on. I find this sort of immediate feedback both vital and invigorating. You do not have to wonder \"what happens if\". Try it and see!\n",
"\n",
"If you do not want to do that you can read this book online. the website http://nbviewer.org provides an IPython Notebook server that renders a notebook stored at github (or elsewhere). The rendering is done in real time when you load the book. If you read my book today, and then I make a change tomorrow, when you go back tomorrow you will see that change. \n",
@@ -51,11 +69,21 @@
"You may access this book via nbviewer at any by using this address:\n",
"http://nbviewer.ipython.org/github/rlabbe/Kalman-Filters-and-Random-Signals-in-Python/blob/master/Introduction.ipynb\n",
"\n",
"Finally, you may generate output in a variety of formats. I will not cover how to do that, other than to point you to [IPython nbconvert](http://ipython.org/ipython-doc/rel-1.0.0/interactive/nbconvert.html). You can convert this book into static HTML pages, latex, or PDF. While I don't recommend it particularly, it is useful for those that don't want to program and/or are working offline.\n",
"\n",
"\n",
"###Installation and Software Requirements\n",
"\n",
"Finally, you may generate output in a variety of formats. I will not cover how to do that, other than to point you to [IPython nbconvert](http://ipython.org/ipython-doc/rel-1.0.0/interactive/nbconvert.html). You can convert this book into static HTML pages, latex, or PDF. While I don't recommend it particularly, it is useful for those that don't want to program and/or are working offline."
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Installation and Software Requirements"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"If you want to run the notebook on your computer, which is what I recommend, then you will have to have IPython installed. I do not cover how to do that in this book; requirements change based on what other python installations you may have, whether you use a third party package like Anaconda Python, what operating system you are using, and so on. \n",
"\n",
"To use all features you will have to have Ipython 2.0 installed, which is released and stable as of April 2014. Most of the book does not require that, but I do make use of the interactive plotting widgets introduced in this release. A few cells will not run if you have an older version installed.\n",
@@ -65,26 +93,51 @@
"You will need a recent version of NumPy, SciPy, and Matplotlib installed. I don't really know what the minimal might be. \n",
"I have numpy 1.71, SciPy 0.13.0, and Matplotlib 1.3.1 installed on my machines.\n",
"\n",
"Personally, I use the Anaconda Python distribution in all of my work, [available here](https://store.continuum.io/cshop/anaconda/). I am not selecting them out of favoritism, I am merely documenting my environment. Should you have trouble running any of the code, perhaps knowing this will help you.\n",
"\n",
"###Provided Libraries\n",
"\n",
"\n",
"Personally, I use the Anaconda Python distribution in all of my work, [available here](https://store.continuum.io/cshop/anaconda/). I am not selecting them out of favoritism, I am merely documenting my environment. Should you have trouble running any of the code, perhaps knowing this will help you."
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Provided Libraries"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"I've not structured anything nicely yet. For now just look for any .py files in the base directory. As I pull everything together I will turn this into a python library, and probably create a separate git project just for the python code.\n",
"\n",
"There are python files with a name like *xxx*_internal.py. I use these to store functions that are useful for the book, but not of general interest. Often the Python is the point and focus of what I am talking about, but sometimes I just want to display a chart. IPython Notebook does not allow you to collapse the python code, and so it sometimes gets in the way. Some IPython books just incorporate .png files for the image, but I want to ensure that everything is open - if you want to look at the code you can. \n",
"\n",
"Some chapters introduce functions that are useful for the rest of the book. Those functions are initially defined within the Notebook itself, but the code is also stored in a Python file that is imported if needed in later chapters. I do document when I do this where the function is first defined. But this is still a work in progress.\n",
"Some chapters introduce functions that are useful for the rest of the book. Those functions are initially defined within the Notebook itself, but the code is also stored in a Python file that is imported if needed in later chapters. I do document when I do this where the function is first defined. But this is still a work in progress."
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"License"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<a rel=\"license\" href=\"http://creativecommons.org/licenses/by-nc-sa/4.0/\"><img alt=\"Creative Commons License\" style=\"border-width:0\" src=\"http://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png\" /></a><br /><span xmlns:dct=\"http://purl.org/dc/terms/\" property=\"dct:title\">Kalman Filters and Random Signals in Python</span> by <a xmlns:cc=\"http://creativecommons.org/ns#\" href=\"https://github.com/rlabbe/Kalman-Filters-and-Random-Signals-in-Python\" property=\"cc:attributionName\" rel=\"cc:attributionURL\">Roger Labbe</a> is licensed under a <a rel=\"license\" href=\"http://creativecommons.org/licenses/by-nc-sa/4.0/\">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.<br />\n",
"\n",
"\n",
"###License\n",
"\n",
"\n",
"<a rel=\"license\" href=\"http://creativecommons.org/licenses/by-nc-sa/4.0/\"><img alt=\"Creative Commons License\" style=\"border-width:0\" src=\"http://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png\" /></a><br /><span xmlns:dct=\"http://purl.org/dc/terms/\" property=\"dct:title\">Kalman Filters and Random Signals in Python</span> by <a xmlns:cc=\"http://creativecommons.org/ns#\" href=\"https://github.com/rlabbe/Kalman-Filters-and-Random-Signals-in-Python\" property=\"cc:attributionName\" rel=\"cc:attributionURL\">Roger Labbe</a> is licensed under a <a rel=\"license\" href=\"http://creativecommons.org/licenses/by-nc-sa/4.0/\">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.<br />Based on a work at <a xmlns:dct=\"http://purl.org/dc/terms/\" href=\"https://github.com/rlabbe/Kalman-Filters-and-Random-Signals-in-Python\" rel=\"dct:source\">https://github.com/rlabbe/Kalman-Filters-and-Random-Signals-in-Python</a>.\n",
"\n",
"\n",
"###Contact\n",
"\n"
"Based on a work at <a xmlns:dct=\"http://purl.org/dc/terms/\" href=\"https://github.com/rlabbe/Kalman-Filters-and-Random-Signals-in-Python\" rel=\"dct:source\">https://github.com/rlabbe/Kalman-Filters-and-Random-Signals-in-Python</a>."
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Contact"
]
},
{
@@ -106,6 +159,10 @@
" margin-left: 0% !important;\n",
" margin-right: auto;\n",
" }\n",
" div.text_cell code {\n",
" background: #F6F6F9;\n",
" color: #0000FF;\n",
" }\n",
" h1 {\n",
" font-family: 'Open sans',verdana,arial,sans-serif;\n",
"\t}\n",
@@ -127,7 +184,6 @@
" } \n",
" h2 {\n",
" font-family: 'Open sans',verdana,arial,sans-serif;\n",
" text-indent:1em;\n",
" }\n",
" .text_cell_render h2 {\n",
" font-weight: 200;\n",
@@ -199,7 +255,7 @@
" max-height: 300px;\n",
" }\n",
" code{\n",
" font-size: 78%;\n",
" font-size: 70%;\n",
" }\n",
" .rendered_html code{\n",
" background-color: transparent;\n",
@@ -307,13 +363,13 @@
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 2,
"prompt_number": 1,
"text": [
"<IPython.core.display.HTML at 0x3f0ff50>"
"<IPython.core.display.HTML at 0x2c2e590>"
]
}
],
"prompt_number": 2
"prompt_number": 1
}
],
"metadata": {}
+232 -8
View File
@@ -1,7 +1,7 @@
{
"metadata": {
"name": "",
"signature": "sha256:2b562cd882f0e19a9a7799763a6bf0d8986d23e7d0d648364928721d3c8a1026"
"signature": "sha256:b884811797e64562baf3c2f742fbb57d9857907b27eeb0885fa24fc3a524bb18"
},
"nbformat": 3,
"nbformat_minor": 0,
@@ -9,22 +9,246 @@
{
"cells": [
{
"cell_type": "markdown",
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"<center><h1>Kalman and Bayesian Filters in Python</h1></center>\n",
"\n",
"<p>\n",
"<center><a href =\"http://nbviewer.ipython.org/urls/raw.github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/master/toc.ipynb\">Table of Contents</a></center>"
"Signals and Noise"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"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": []
"outputs": [
{
"html": [
"<style>\n",
" div.cell{\n",
" width: 850px;\n",
" margin-left: 0% !important;\n",
" margin-right: auto;\n",
" }\n",
" div.text_cell code {\n",
" background: #F6F6F9;\n",
" color: #0000FF;\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: 36pt;\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: 1.5em;\n",
" margin-top: 0.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: 'Open sans',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: 300px;\n",
" }\n",
" div.output_subarea.output_stream.output_stdout.output_text {\n",
" overflow-x: auto;\n",
" overflow-y: scroll;\n",
" max-height: 300px;\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 0x10e5990>"
]
}
],
"prompt_number": 1
}
],
"metadata": {}
+4 -3
View File
@@ -1,7 +1,7 @@
{
"metadata": {
"name": "",
"signature": "sha256:5cac6d1e4e2cb015dbc3ae11ac0be80b8490b74c9ff0d054c006b499e2186165"
"signature": "sha256:5478490f2384cc166dd45368779e2c93fa7ab3ef0d0a4ef4c3f103c9c96f1a9a"
},
"nbformat": 3,
"nbformat_minor": 0,
@@ -9,10 +9,11 @@
{
"cells": [
{
"cell_type": "markdown",
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"# Unscented Kalman Filters"
"Unscented Kalman Filters"
]
},
{
+297 -692
View File
File diff suppressed because it is too large. Load diff
+10194
View File
File diff suppressed because it is too large. Load diff
+27
View File
@@ -0,0 +1,27 @@
%((* extends 'report.tplx' *))
%===============================================================================
% Latex Book
%===============================================================================
((* block predoc *))
((( super() )))
((* block tableofcontents *))\tableofcontents((* endblock tableofcontents *))
((* endblock predoc *))
((* block title *))
\title{Kalman and Bayesian Filters in Python}
((* endblock title *))
% Define block headings
% Note: latex will only number headings that aren't starred
% (i.e. \subsection , but not \subsection* )
((* block h1 -*))\chapter((* endblock h1 -*))
((* block h2 -*))\section((* endblock h2 -*))
((* block h3 -*))\subsection((* endblock h3 -*))
((* block h4 -*))\subsubsection((* endblock h4 -*))
((* block h5 -*))\paragraph*((* endblock h5 -*))
((* block h6 -*))\subparagraph*((* endblock h6 -*))
+22
View File
@@ -0,0 +1,22 @@
echo "merging book..."
python nbmerge.py Preface.ipynb Signals_and_Noise.ipynb g-h_filter.ipynb discrete_bayes.ipynb Gaussians.ipynb Kalman_Filters.ipynb Multidimensional_Kalman_Filters.ipynb Kalman_Filter_Math.ipynb Designing_Kalman_Filters.ipynb Extended_Kalman_Filters.ipynb Unscented_Kalman_Filter.ipynb > book.ipynb
echo "creating pdf..."
python nbconvert --to latex --template book --post PDF book.ipynb
mkdir output
copy /y *.tex output
copy /y *.pdf output
echo "done."
Executable
+11
View File
@@ -0,0 +1,11 @@
#! /bin/bash
echo "merging book..."
ipython nbmerge.py Preface.ipynb Signals_and_Noise.ipynb g-h_filter.ipynb discrete_bayes.ipynb Gaussians.ipynb Kalman_Filters.ipynb Multidimensional_Kalman_Filters.ipynb Kalman_Filter_Math.ipynb Designing_Kalman_Filters.ipynb Extended_Kalman_Filters.ipynb Unscented_Kalman_Filter.ipynb > Kalman_and_Bayesian_Filters_in_Python.ipynb
echo "creating pdf..."
ipython nbconvert --to latex --template book --post PDF Kalman_and_Bayesian_Filters_in_Python.ipynb
echo "done."
Executable
+5
View File
@@ -0,0 +1,5 @@
#! /bin/bash
rm *.tex
rm *.toc
rm ./*_files/*.png
rmdir ./*_files/
+95 -26
View File
@@ -1,7 +1,7 @@
{
"metadata": {
"name": "",
"signature": "sha256:21d9832d6077dac81c77a2069d45a9bbf83c85aa80ab3aa2a0df2870fec18787"
"signature": "sha256:1556bb7a2a15e47b34d1f079dab4a85d78afe50dc20aeb56325b4990232aeebd"
},
"nbformat": 3,
"nbformat_minor": 0,
@@ -9,10 +9,11 @@
{
"cells": [
{
"cell_type": "markdown",
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"#Discrete Bayes Filter"
"Discrete Bayes Filter"
]
},
{
@@ -254,15 +255,23 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The Kalman filter belongs to a family of filters called *bayesian filters*. Without going into"
"The Kalman filter belongs to a family of filters called *bayesian filters*. Without going into\n",
"\n",
"blah blah"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Tracking a Dog"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Tracking a Dog\n",
"\n",
"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",
@@ -367,11 +376,18 @@
],
"prompt_number": 5
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Extracting Information from Multiple Sensor Readings"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Extracting Information from Multiple Sensor Readings\n",
"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",
@@ -411,18 +427,25 @@
"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": [
"####Noisy Sensors\n",
"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 array by these values the end result will no longer represent a true probability distribution. \n"
"However, we more or less chose 0.6 and 0.2 at random; if we multiply the pos array by these values the end result will no longer represent a true probability distribution. "
]
},
{
@@ -516,12 +539,18 @@
"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": [
"#### Incorporating Movement Data\n",
"\n",
"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 presense 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",
@@ -569,10 +598,21 @@
"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.\n",
"\n",
"#### Adding Noise to the Update\n",
"\n",
"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 Update"
]
},
{
"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 insummountable 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",
@@ -745,12 +785,18 @@
],
"prompt_number": 14
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Integrating Measurements and Movement Updates"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Integrating Measurements and Movement Updates\n",
"\n",
"The problem of loosing 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",
@@ -897,12 +943,18 @@
"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": "heading",
"level": 2,
"metadata": {},
"source": [
"The Effect of Bad Sensor Data"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# The Effect of Bad Sensor Data\n",
"\n",
"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:"
@@ -1012,12 +1064,18 @@
"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 to the Discrete Bayesian Filter"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Drawbacks and Limitations to the Discrete Bayesian Filter\n",
"\n",
"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",
@@ -1063,19 +1121,30 @@
]
},
{
"cell_type": "markdown",
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"####Generalizing to Multiple Dimensions\n",
"\n"
"Generalizing to Multiple Dimensions"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Summary"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Summary\n",
"\n",
"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 it's results. The math is a bit more complicated, but not by much. For now, we will just explain that Bayesian statistics compute the liklihood 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 formalizes 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 noisey (most sensors are more then 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 knowlege, allowing us to converge on the most likely result.\n",
+147 -54
View File
@@ -1,7 +1,7 @@
{
"metadata": {
"name": "",
"signature": "sha256:d9983a12d2de111eca8f8d2ef0ebbb01623530d2e91fda95463c95650560ad9d"
"signature": "sha256:1c41d8aae6dda2b175616950de778f3a126060ab72aade94f4566c62d364f0c7"
},
"nbformat": 3,
"nbformat_minor": 0,
@@ -9,10 +9,11 @@
{
"cells": [
{
"cell_type": "markdown",
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"# The g-h Filter"
"The g-h Filter"
]
},
{
@@ -62,7 +63,6 @@
" } \n",
" h2 {\n",
" font-family: 'Open sans',verdana,arial,sans-serif;\n",
" text-indent:1em;\n",
" }\n",
" .text_cell_render h2 {\n",
" font-weight: 200;\n",
@@ -242,20 +242,26 @@
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 4,
"prompt_number": 1,
"text": [
"<IPython.core.display.HTML at 0x2b89490>"
"<IPython.core.display.HTML at 0x21b4910>"
]
}
],
"prompt_number": 4
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Building Intuition via Thought Experiments"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Building Intuition via Thought Experiments\n",
"\n",
"Imagine that we live in a world without scales - the devices you stand on to weigh yourself. One day at work a coworker comes running up to you and announces her invention to you. After she explains, you eagerly stand on it and announce the results: \"172 lbs\". You are estatic - for the first time in your life you know what you weigh. More importantly, dollar signs dance in your eyes as you imagine selling this device to weight loss clinics across the world! This is fantastic!\n",
"\n",
"Another coworker hears the commotion and comes over to find out what has you so excited. You explain the invention and once again step onto the scale, and proudly proclaim the result: \"161 lbs.\" And then you hesitate, confused.\n",
@@ -628,12 +634,18 @@
"This obviously has no effect, and can be removed. I wrote this to emphasize that in the prediction step you need to predict next value for **all** state variables, both *weight* and *gain_rate*. In this case we are assuming that the the gain does not vary, but when we generalize this algorithm we will remove that assumption. "
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"The g-h Filter"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### The g-h Filter\n",
"\n",
"This algorithm is known as the g-h filter. *g* and *h* refer to the two scaling factors that we used in our example. *g* is the scaling we used for the measurement (weight in our example), and *h* is the scaling for the change in measurement over time (lbs/day in our example)."
]
},
@@ -686,12 +698,18 @@
"So, the algorithm is simple. The state is initialized with $\\mathbf{x_0}$. We then enter a loop, predicting the state for time $k$ from the values from time $k-1$. We then get the measurement $z_k$ and choose some intermediate point between the measurements and prediction, creating the estimate $\\mathbf{\\hat{x}_k}$."
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Exercise: Write Generic Algorithm"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Exercise: Write Generic Algorithm\n",
"\n",
"In the example above, I explicitly coded this to solve the weighing problem that we've been discussing throughout the chapter. For example, the variables are named \"weight_scale\", \"gain\", and so on. I did this to make the algorithm easy to follow - you can easily see that we correctly implemented each step. But, this is specialized code. Rewrite it to work with any data. Use this function signature:\n",
"\n",
" def g_h_filter (data, x0, dx, g, h)\n",
@@ -706,9 +724,15 @@
" 'dt' is the length of the time step \n",
" \"\"\"\n",
"\n",
"Test it by passing in the same weight data as before, plot the results, and visually determine that it works.\n",
" \n",
"#### Solution and Discussion"
"Test it by passing in the same weight data as before, plot the results, and visually determine that it works."
]
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Solution and Discussion"
]
},
{
@@ -764,16 +788,26 @@
"language": "python",
"metadata": {},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'weights' is not defined",
"output_type": "pyerr",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m<ipython-input-2-6154b8dfda65>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 42\u001b[0m \u001b[0mplt\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mxlim\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m10\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 43\u001b[0m \u001b[0mplt\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mplot\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m9\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m160\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m170\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mc\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;34m'g'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 44\u001b[1;33m \u001b[0mdata\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mg_h_filter\u001b[0m \u001b[1;33m(\u001b[0m\u001b[0mdata\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mweights\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mx0\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m160\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mdx\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mg\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m6.\u001b[0m\u001b[1;33m/\u001b[0m\u001b[1;36m10\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mh\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;36m2.\u001b[0m\u001b[1;33m/\u001b[0m\u001b[1;36m3\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mdt\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m1.\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 45\u001b[0m \u001b[0mplot_g_h_results\u001b[0m \u001b[1;33m(\u001b[0m\u001b[0mweights\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mdata\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;31mNameError\u001b[0m: name 'weights' is not defined"
]
},
{
"metadata": {},
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAsUAAAFyCAYAAAAd7KdIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAAC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NvRCwYT\ncgGTQ68fUsWxCtUcr1Htmlq1lrdSEIPvC1iCnWIAgOONn0T3k/d+otrcWk6iA2A5imLYjlLine truncated
"text": [
"<matplotlib.figure.Figure at 0x3ab7290>"
"<matplotlib.figure.Figure at 0x322a910>"
]
}
],
"prompt_number": 11
"prompt_number": 2
},
{
"cell_type": "markdown",
@@ -792,12 +826,18 @@
"I'll let you decide which form of the equation is more expressive. One form explicitly uses $g$ and $(1-g)$ to compute the point between the two values, the other finds the difference between the points, and adds a fraction of that to the first value. Both are computing the same thing. You'll see both forms in the literature, so I have used both to expose you to them. "
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Choice of g and h"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Choice of g and h\n",
"\n",
"The g-h filter is not one filter - it is a classification for a family of filters. Eli Brookner in *Tracking and Kalman Filtering Made Easy* lists 11, and I am sure there are more. Not only that, but each type of filter has numerous subtypes. Each filter is differentiated by how g and h are chosen. So there is no 'one fits all' advice that I can give here. Some filters set g and h as constants, others vary them dynamically. The Kalman filter varies them dynamically at each step $k$ and bases it on the number of state variables there are in $\\mathbf{x}$. Some filters allow g and h to take any value within a range, others constrain one to be dependent on the other by some function $f(\\dot{}), \\mbox{where }g = f(h)$.\n",
"\n",
"The topic of this book is not the entire family of g-h filters; more importantly, we are interested in the *Bayesian* aspect of these filters, which I have not addressed yet. Therefore I will not cover selection of g and h in depth. Eli Brookner's book mentioned in the previous paragraph is an excellent resource for that topic, if it interests you. If this strikes you as an odd position for me to take, recognize that the typical formulation of the Kalman filter does not use g and h at all; the Kalman filter is a g-h filter because it mathematically reduces to this algorithm. When we design the Kalman filter we will be making a number of carefully considered choices to optimize it's performance, and those choices indirectly affect g and h. Don't worry if this is not too clear right now, it will be much clearer later after we develop the Kalman filter theory.\n",
@@ -805,12 +845,18 @@
"However, it is worth seeing how varying g and h affects the results, so we will work through some examples. This will give us strong insight into the fundamental strengths and limitations of this type of filter, and help us understand the behavior of the rather more sophisticated Kalman filter."
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Exercise: create measurement function"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Exercise: create measurement function\n",
"\n",
"Now let's write a function that generates noisy data for us. Recall from chapter 0 that we model a noisy signal as the signal plus white noise generated by *numpy.random.randn()*. We want a function that we call with the starting value, the amount of change per step, the number of steps, and the amount of noise we want to add. It should return a list of the data. Test it by creating 30 points, filtering it with *g_h_filter()*, and plot the results with *plot_g_h_results()*"
]
},
@@ -826,10 +872,11 @@
"prompt_number": 12
},
{
"cell_type": "markdown",
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"#### Solution"
"Solution"
]
},
{
@@ -857,12 +904,18 @@
],
"prompt_number": 13
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Exercise: Bad Initial Conditions"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Excercise: Bad Initial Conditions\n",
"\n",
"Now write code that uses *gen_data* and *g_h_filter* to filter 100 data points that starts at 5, has a derivative of 2, a noise scaling factor of 10, and uses g=0.2 and h=0.02. Set you initial guess for x to be 100."
]
},
@@ -878,10 +931,11 @@
"prompt_number": 14
},
{
"cell_type": "markdown",
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"#### Solution and Discussion"
"Solution and Discussion"
]
},
{
@@ -896,25 +950,37 @@
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAsgAAAFyCAYAAADoEiz4AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3Xd4FOXaBvB7ZrZkU+kSIECQaggh9CZKEQGp0gRBwQ+k\nqqhYERUV5KCcAyh6sBxRDipVkCgghI70HHoLUgMEkJa6bWa+P5aEhEySzWY3u0nu33Wd6zo75Z03\n+Lg+vHnmeQVVVVUQEREREREAQPT2BIiIiIiIfAkTZCIi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tzBTz+lYsT1TyE/\n/phPbiuthQkyEREReZfFAsPy5bAOGQI5PLzAq7e69euhc2FlVYs+NhaW556DWEQJsj4mBsFt20It\nWxZJ27fD/uijmtcp4eFI/fprpCxZAv2qVTBNmZLv2IcPS/i4axwOyQ3w9MvBOH78DtCqea51yEeP\nSnj88SDsXG9BufRLUOrWzXbe1rkz9Lt2obwxGY0by3jiCRsGD7bi+ectmgkyAPj5OfoeGxcsQPpb\nb+U7Z1/BBJl8AmsKSQvjgrQwLkoe/dq1kBs0gFKjBpRatQqcnPpPnoxH3PAyG1JSoNu/H5Line truncated
"text": [
"<matplotlib.figure.Figure at 0x3ac4250>"
"ename": "NameError",
"evalue": "name 'gen_data' is not defined",
"output_type": "pyerr",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m<ipython-input-3-c60d1f9dbeb1>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mzs\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mgen_data\u001b[0m \u001b[1;33m(\u001b[0m\u001b[0mx0\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m5\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mdx\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m2\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mcount\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m100\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mnoise_factor\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m10\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 2\u001b[0m \u001b[0mdata\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mg_h_filter\u001b[0m \u001b[1;33m(\u001b[0m\u001b[0mdata\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mzs\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mx0\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m100.\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mdx\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m2.\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mdt\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m1.\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mg\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m0.2\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mh\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m0.01\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[0mplot_g_h_results\u001b[0m \u001b[1;33m(\u001b[0m\u001b[0mmeasurements\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mzs\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mfiltered_data\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mdata\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;31mNameError\u001b[0m: name 'gen_data' is not defined"
]
}
],
"prompt_number": 15
"prompt_number": 3
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The filter starts out with estimates that are far from the measured data due to the bad initial guess of 100. You can see that it 'rings' before settling in on the measured data. 'Ringing' means that the signal overshoots and undershoots the data in a sinusodial type pattern. This is a very common phenomena in filters, and a lot of work in filter design is devoted to minimizing ringing. That is a topic that we are not yet prepared to address, but I wanted to show you the phenomenon."
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Exercise: Extreme Noise"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The filter starts out with estimates that are far from the measured data due to the bad initial guess of 100. You can see that it 'rings' before settling in on the measured data. 'Ringing' means that the signal overshoots and undershoots the data in a sinusodial type pattern. This is a very common phenomena in filters, and a lot of work in filter design is devoted to minimizing ringing. That is a topic that we are not yet prepared to address, but I wanted to show you the phenomenon.\n",
"\n",
"\n",
"####Exercise: Extreme Noise\n",
"\n",
"Rerun the same test, but this time use a noise factor of 100. Remove the initial condition ringing by changing the initial condition from 100 down to 5."
]
},
@@ -930,10 +996,11 @@
"prompt_number": 16
},
{
"cell_type": "markdown",
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"##### Solution and Discussion"
"Solution and Discussion"
]
},
{
@@ -967,12 +1034,18 @@
"At this point we don't know enough to really judge this. We added **a lot** of noise; maybe this is as good as filtering can get. However, the existance of the multitude of chapters beyond this one should suggest that we can do much better than this."
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Excercise: The Effect of Acceleration"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Excercise: The Effect of Acceleration\n",
"\n",
"Write a new data generation function that adds in a constant acceleration factor to each data point. In other words, increment dx as you compute each data point so that the velocity (dx) is ever increasing. Set the noise to 0, $g=0.2$ and $h=0.02$ and plot the results. Explain what you see."
]
},
@@ -988,10 +1061,11 @@
"prompt_number": 18
},
{
"cell_type": "markdown",
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"#####Solution and Discussion"
"Solution and Discussion"
]
},
{
@@ -1035,12 +1109,18 @@
"> The 'take home' point is that the filter is only as good as the mathematical model used to express the system. "
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Exercise: Varying g"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Exercise: Varying g\n",
"\n",
"Now let's look at the effect of varying g. Before you perform this exercise, recall that g is the scale factor for choosing between the measurement and prediction. What do you think of a large value of g will be? A small value? \n",
"\n",
"Now, let the $noise\\_factor=50$ and $dx=5$. Plot the results of $g = 0.1\\mbox{, } 0.5,\\mbox{ and } 0.9$."
@@ -1058,10 +1138,11 @@
"prompt_number": 20
},
{
"cell_type": "markdown",
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"####Solution and Discussion"
"Solution and Discussion"
]
},
{
@@ -1207,12 +1288,18 @@
],
"prompt_number": 23
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Varying h"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Varying h\n",
"\n",
"Now let's leave g unchanged and investigate the effect of modifying h. We know that h affects how much of we favor the measurement of $\\dot{x}$ vs our predictiton. But what does this *mean*? If our signal is changing a lot (quickly relative to the time step of our filter), then a large $h$ will cause us to react to those transient changes rapidly. A smaller $h$ will cause us to react more slowly.\n",
"\n",
"We will look at three examples. We have a noiseless measurement that slowly goes from 0 to 1 in 50 steps. Our first filter uses a nearly correct initial value for $\\dot{x}$ and a small $h$. You can see from the output that the filter output is very close to the signal. The second filter uses the very incorrect guess of $\\dot{x}=2$. Here we see the filter 'ringing' until it settles down and finds the signal. The third filter uses the same conditions but it now sets $h=0.5$. If you look at the amplitude of the ringing you can see that it is much smaller than in the second chart, but the frequency is greater. It also settles down a bit quicker than the second filter, though not by much."
@@ -1265,12 +1352,18 @@
],
"prompt_number": 24
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Summary"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Summary\n",
"\n",
"I encourage you to experiment with this filter to develop your understanding of how it reacts. It shouldn't take too many attempts to come to the realization that ad-hoc choices for $g$ and $h$ do not perform very well. A particular choice might perform well in one situation, but very poorly in another. Even when you understand the effect of $g$ and $h$ it can be difficult to choose proper values. In fact, it is extremely unlikely that you will choose values for $g$ and $h$ that is optimal for any given problem. Filters are *designed*, not selected *ad hoc*. \n",
"\n",
"In some ways I do not want to end the chapter here, as there is a significant amount that we can say about selecting $g$ and $h$. But the g-h filter in this form is not the purpose of this book. Designing the Kalman filter requires you to specify a number of parameters - indirectly they do relate to choosing $g$ and $h$, but you will never refer to them direcly when designing Kalman filters. Furthermore, due to your choices $g$ and $h$ will vary at every time step in a very non-obvious manner. "
+26
View File
@@ -0,0 +1,26 @@
"""
usage:
python nbmerge.py A.ipynb B.ipynb C.ipynb > merged.ipynb
"""
import io
import os
import sys
from IPython.nbformat import current
def merge_notebooks(filenames):
merged = None
for fname in filenames:
with io.open(fname, 'r', encoding='utf-8') as f:
nb = current.read(f, 'json')
if merged is None:
merged = nb
else:
merged.worksheets[0].cells.extend(nb.worksheets[0].cells)
merged.metadata.name += "_merged"
print current.writes(merged, 'json')
if __name__ == '__main__':
merge_notebooks(sys.argv[1:])
-1
View File
@@ -29,7 +29,6 @@
}
h2 {
font-family: 'Open sans',verdana,arial,sans-serif;
text-indent:1em;
}
.text_cell_render h2 {
font-weight: 200;