Merge branch 'master' of https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python
This commit is contained in:
commit
908a4f74e0
@ -27,6 +27,7 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from __future__ import division, print_function\n",
|
||||
"%matplotlib inline"
|
||||
]
|
||||
},
|
||||
@ -514,7 +515,7 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"abddition:\n",
|
||||
"addition:\n",
|
||||
" [[2. 4.]\n",
|
||||
" [6. 8.]]\n",
|
||||
"\n",
|
||||
@ -535,7 +536,7 @@
|
||||
"source": [
|
||||
"x = np.array([[1., 2.],\n",
|
||||
" [3., 4.]])\n",
|
||||
"print('abddition:\\n', x + x)\n",
|
||||
"print('addition:\\n', x + x)\n",
|
||||
"print('\\nelement-wise multiplication\\n', x * x)\n",
|
||||
"print('\\nmultiplication\\n', np.dot(x, x))\n",
|
||||
"print('\\ndot is also a member of np.array\\n', x.dot(x))"
|
||||
@ -714,12 +715,14 @@
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 18,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"scrolled": true
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"[<matplotlib.lines.Line2D at 0x22b94689be0>]"
|
||||
"[<matplotlib.lines.Line2D at 0x24ec4f535c0>]"
|
||||
]
|
||||
},
|
||||
"execution_count": 18,
|
||||
@ -972,6 +975,57 @@
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.6.10"
|
||||
},
|
||||
"nbdime-conflicts": {
|
||||
"local_diff": [
|
||||
{
|
||||
"diff": [
|
||||
{
|
||||
"diff": [
|
||||
{
|
||||
"diff": [
|
||||
{
|
||||
"key": 4,
|
||||
"op": "addrange",
|
||||
"valuelist": "10"
|
||||
},
|
||||
{
|
||||
"key": 4,
|
||||
"length": 1,
|
||||
"op": "removerange"
|
||||
}
|
||||
],
|
||||
"key": 0,
|
||||
"op": "patch"
|
||||
}
|
||||
],
|
||||
"key": "version",
|
||||
"op": "patch"
|
||||
}
|
||||
],
|
||||
"key": "language_info",
|
||||
"op": "patch"
|
||||
}
|
||||
],
|
||||
"remote_diff": [
|
||||
{
|
||||
"diff": [
|
||||
{
|
||||
"diff": [
|
||||
{
|
||||
"key": 0,
|
||||
"length": 1,
|
||||
"op": "removerange"
|
||||
}
|
||||
],
|
||||
"key": "version",
|
||||
"op": "patch"
|
||||
}
|
||||
],
|
||||
"key": "language_info",
|
||||
"op": "patch"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1669,6 +1669,57 @@
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.6.10"
|
||||
},
|
||||
"nbdime-conflicts": {
|
||||
"local_diff": [
|
||||
{
|
||||
"diff": [
|
||||
{
|
||||
"diff": [
|
||||
{
|
||||
"diff": [
|
||||
{
|
||||
"key": 4,
|
||||
"op": "addrange",
|
||||
"valuelist": "10"
|
||||
},
|
||||
{
|
||||
"key": 4,
|
||||
"length": 1,
|
||||
"op": "removerange"
|
||||
}
|
||||
],
|
||||
"key": 0,
|
||||
"op": "patch"
|
||||
}
|
||||
],
|
||||
"key": "version",
|
||||
"op": "patch"
|
||||
}
|
||||
],
|
||||
"key": "language_info",
|
||||
"op": "patch"
|
||||
}
|
||||
],
|
||||
"remote_diff": [
|
||||
{
|
||||
"diff": [
|
||||
{
|
||||
"diff": [
|
||||
{
|
||||
"key": 0,
|
||||
"length": 1,
|
||||
"op": "removerange"
|
||||
}
|
||||
],
|
||||
"key": "version",
|
||||
"op": "patch"
|
||||
}
|
||||
],
|
||||
"key": "language_info",
|
||||
"op": "patch"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -611,6 +611,57 @@
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.6.10"
|
||||
},
|
||||
"nbdime-conflicts": {
|
||||
"local_diff": [
|
||||
{
|
||||
"diff": [
|
||||
{
|
||||
"diff": [
|
||||
{
|
||||
"diff": [
|
||||
{
|
||||
"key": 4,
|
||||
"op": "addrange",
|
||||
"valuelist": "10"
|
||||
},
|
||||
{
|
||||
"key": 4,
|
||||
"length": 1,
|
||||
"op": "removerange"
|
||||
}
|
||||
],
|
||||
"key": 0,
|
||||
"op": "patch"
|
||||
}
|
||||
],
|
||||
"key": "version",
|
||||
"op": "patch"
|
||||
}
|
||||
],
|
||||
"key": "language_info",
|
||||
"op": "patch"
|
||||
}
|
||||
],
|
||||
"remote_diff": [
|
||||
{
|
||||
"diff": [
|
||||
{
|
||||
"diff": [
|
||||
{
|
||||
"key": 0,
|
||||
"length": 1,
|
||||
"op": "removerange"
|
||||
}
|
||||
],
|
||||
"key": "version",
|
||||
"op": "patch"
|
||||
}
|
||||
],
|
||||
"key": "language_info",
|
||||
"op": "patch"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
File diff suppressed because one or more lines are too long
@ -202,7 +202,7 @@
|
||||
{
|
||||
"data": {
|
||||
"text/latex": [
|
||||
"$$\\phi$$"
|
||||
"$\\displaystyle \\phi$"
|
||||
],
|
||||
"text/plain": [
|
||||
"\\phi"
|
||||
@ -236,7 +236,7 @@
|
||||
{
|
||||
"data": {
|
||||
"text/latex": [
|
||||
"$$\\frac{1}{2 \\sqrt{\\phi}}$$"
|
||||
"$\\displaystyle \\frac{1}{2 \\sqrt{\\phi}}$"
|
||||
],
|
||||
"text/plain": [
|
||||
" 1 \n",
|
||||
@ -268,7 +268,7 @@
|
||||
{
|
||||
"data": {
|
||||
"text/latex": [
|
||||
"$$\\left(\\phi - 1\\right) \\left(\\phi^{2} + 1\\right)$$"
|
||||
"$\\displaystyle \\left(\\phi - 1\\right) \\left(\\phi^{2} + 1\\right)$"
|
||||
],
|
||||
"text/plain": [
|
||||
" ⎛ 2 ⎞\n",
|
||||
@ -299,7 +299,7 @@
|
||||
{
|
||||
"data": {
|
||||
"text/latex": [
|
||||
"$$\\phi^{2} - 3 \\phi - 4$$"
|
||||
"$\\displaystyle \\phi^{2} - 3 \\phi - 4$"
|
||||
],
|
||||
"text/plain": [
|
||||
" 2 \n",
|
||||
@ -357,7 +357,7 @@
|
||||
{
|
||||
"data": {
|
||||
"text/latex": [
|
||||
"$$2 t + 2$$"
|
||||
"$\\displaystyle 2 t + 2$"
|
||||
],
|
||||
"text/plain": [
|
||||
"2⋅t + 2"
|
||||
@ -392,7 +392,7 @@
|
||||
{
|
||||
"data": {
|
||||
"text/latex": [
|
||||
"$$\\left[\\begin{matrix}\\frac{x}{\\sqrt{x^{2} + z^{2}}} & 0 & \\frac{z}{\\sqrt{x^{2} + z^{2}}}\\end{matrix}\\right]$$"
|
||||
"$\\displaystyle \\left[\\begin{matrix}\\frac{x}{\\sqrt{x^{2} + z^{2}}} & 0 & \\frac{z}{\\sqrt{x^{2} + z^{2}}}\\end{matrix}\\right]$"
|
||||
],
|
||||
"text/plain": [
|
||||
"⎡ x z ⎤\n",
|
||||
@ -439,7 +439,7 @@
|
||||
{
|
||||
"data": {
|
||||
"text/latex": [
|
||||
"$$\\left[\\begin{matrix}\\frac{\\Delta{t}^{5}}{20} & \\frac{\\Delta{t}^{4}}{8} & \\frac{\\Delta{t}^{3}}{6}\\\\\\frac{\\Delta{t}^{4}}{8} & \\frac{\\Delta{t}^{3}}{3} & \\frac{\\Delta{t}^{2}}{2}\\\\\\frac{\\Delta{t}^{3}}{6} & \\frac{\\Delta{t}^{2}}{2} & \\Delta{t}\\end{matrix}\\right]$$"
|
||||
"$\\displaystyle \\left[\\begin{matrix}\\frac{\\Delta{t}^{5}}{20} & \\frac{\\Delta{t}^{4}}{8} & \\frac{\\Delta{t}^{3}}{6}\\\\\\frac{\\Delta{t}^{4}}{8} & \\frac{\\Delta{t}^{3}}{3} & \\frac{\\Delta{t}^{2}}{2}\\\\\\frac{\\Delta{t}^{3}}{6} & \\frac{\\Delta{t}^{2}}{2} & \\Delta{t}\\end{matrix}\\right]$"
|
||||
],
|
||||
"text/plain": [
|
||||
"⎡ 5 4 3⎤\n",
|
||||
|
@ -110,7 +110,7 @@
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.6.5"
|
||||
"version": "3.6.10"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
@ -153,6 +153,57 @@
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.6.10"
|
||||
},
|
||||
"nbdime-conflicts": {
|
||||
"local_diff": [
|
||||
{
|
||||
"diff": [
|
||||
{
|
||||
"diff": [
|
||||
{
|
||||
"diff": [
|
||||
{
|
||||
"key": 4,
|
||||
"op": "addrange",
|
||||
"valuelist": "10"
|
||||
},
|
||||
{
|
||||
"key": 4,
|
||||
"length": 1,
|
||||
"op": "removerange"
|
||||
}
|
||||
],
|
||||
"key": 0,
|
||||
"op": "patch"
|
||||
}
|
||||
],
|
||||
"key": "version",
|
||||
"op": "patch"
|
||||
}
|
||||
],
|
||||
"key": "language_info",
|
||||
"op": "patch"
|
||||
}
|
||||
],
|
||||
"remote_diff": [
|
||||
{
|
||||
"diff": [
|
||||
{
|
||||
"diff": [
|
||||
{
|
||||
"key": 0,
|
||||
"length": 1,
|
||||
"op": "removerange"
|
||||
}
|
||||
],
|
||||
"key": "version",
|
||||
"op": "patch"
|
||||
}
|
||||
],
|
||||
"key": "language_info",
|
||||
"op": "patch"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -109,7 +109,58 @@
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.6.10"
|
||||
"version": "3.7.13.6.5"
|
||||
},
|
||||
"nbdime-conflicts": {
|
||||
"local_diff": [
|
||||
{
|
||||
"diff": [
|
||||
{
|
||||
"diff": [
|
||||
{
|
||||
"diff": [
|
||||
{
|
||||
"key": 4,
|
||||
"op": "addrange",
|
||||
"valuelist": "10"
|
||||
},
|
||||
{
|
||||
"key": 4,
|
||||
"length": 1,
|
||||
"op": "removerange"
|
||||
}
|
||||
],
|
||||
"key": 0,
|
||||
"op": "patch"
|
||||
}
|
||||
],
|
||||
"key": "version",
|
||||
"op": "patch"
|
||||
}
|
||||
],
|
||||
"key": "language_info",
|
||||
"op": "patch"
|
||||
}
|
||||
],
|
||||
"remote_diff": [
|
||||
{
|
||||
"diff": [
|
||||
{
|
||||
"diff": [
|
||||
{
|
||||
"key": 0,
|
||||
"length": 1,
|
||||
"op": "removerange"
|
||||
}
|
||||
],
|
||||
"key": "version",
|
||||
"op": "patch"
|
||||
}
|
||||
],
|
||||
"key": "language_info",
|
||||
"op": "patch"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
@ -39,6 +39,57 @@
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.6.10"
|
||||
},
|
||||
"nbdime-conflicts": {
|
||||
"local_diff": [
|
||||
{
|
||||
"diff": [
|
||||
{
|
||||
"diff": [
|
||||
{
|
||||
"diff": [
|
||||
{
|
||||
"key": 4,
|
||||
"op": "addrange",
|
||||
"valuelist": "10"
|
||||
},
|
||||
{
|
||||
"key": 4,
|
||||
"length": 1,
|
||||
"op": "removerange"
|
||||
}
|
||||
],
|
||||
"key": 0,
|
||||
"op": "patch"
|
||||
}
|
||||
],
|
||||
"key": "version",
|
||||
"op": "patch"
|
||||
}
|
||||
],
|
||||
"key": "language_info",
|
||||
"op": "patch"
|
||||
}
|
||||
],
|
||||
"remote_diff": [
|
||||
{
|
||||
"diff": [
|
||||
{
|
||||
"diff": [
|
||||
{
|
||||
"key": 0,
|
||||
"length": 1,
|
||||
"op": "removerange"
|
||||
}
|
||||
],
|
||||
"key": "version",
|
||||
"op": "patch"
|
||||
}
|
||||
],
|
||||
"key": "language_info",
|
||||
"op": "patch"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
@ -125,7 +125,7 @@ If you do not have pip, you may follow the instructions here: https://pip.pypa.i
|
||||
All of the filters used in this book as well as others not in this book are implemented in my Python library FilterPy, available [here](https://github.com/rlabbe/filterpy). You do not need to download or install this to read the book, but you will likely want to use this library to write your own filters. It includes Kalman filters, Fading Memory filters, H infinity filters, Extended and Unscented filters, least square filters, and many more. It also includes helper routines that simplify the designing the matrices used by some of the filters, and other code such as Kalman based smoothers.
|
||||
|
||||
|
||||
FilterPy is hosted github at (https://github.com/rlabbe/filterpy). If you want the bleading edge release you will want to grab a copy from github, and follow your Python installation's instructions for adding it to the Python search path. This might expose you to some instability since you might not get a tested release, but as a benefit you will also get all of the test scripts used to test the library. You can examine these scripts to see many examples of writing and running filters while not in the Jupyter Notebook environment.
|
||||
FilterPy is hosted on github at (https://github.com/rlabbe/filterpy). If you want the bleeding edge release you will want to grab a copy from github, and follow your Python installation's instructions for adding it to the Python search path. This might expose you to some instability since you might not get a tested release, but as a benefit you will also get all of the test scripts used to test the library. You can examine these scripts to see many examples of writing and running filters while not in the Jupyter Notebook environment.
|
||||
|
||||
Alternative Way of Running the Book in Conda environment
|
||||
----
|
||||
@ -135,11 +135,11 @@ If you have conda or miniconda installed, you can create environment by
|
||||
|
||||
and use
|
||||
|
||||
source activate kf_bf
|
||||
conda activate kf_bf
|
||||
|
||||
and
|
||||
|
||||
source deactivate kf_bf
|
||||
conda deactivate kf_bf
|
||||
|
||||
to activate and deactivate the environment.
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -3,277 +3,23 @@
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<style>\n",
|
||||
"@import url('http://fonts.googleapis.com/css?family=Source+Code+Pro');\n",
|
||||
"@import url('http://fonts.googleapis.com/css?family=Lora');\n",
|
||||
"\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Open+Sans');\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Vollkorn');\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Karla');\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Poppins');\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Arimo');\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Roboto');\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Lato');\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Domine');\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Chivo');\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Cardo');\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Arvo');\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Crimson+Text');\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Ubuntu');\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Fontin');\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Raleway');\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Merriweather');\n",
|
||||
"\n",
|
||||
"\n",
|
||||
".CodeMirror pre {\n",
|
||||
" font-family: 'Source Code Pro', Consolas, monocco, monospace;\n",
|
||||
"}\n",
|
||||
" div.cell{\n",
|
||||
" width: 850px;\n",
|
||||
" margin-left: 0% !important;\n",
|
||||
" margin-right: auto;\n",
|
||||
" }\n",
|
||||
" div.text_cell_render{\n",
|
||||
" font-family: 'Lora';\n",
|
||||
" //font-family: 'Open Sans';\n",
|
||||
" //font-family: 'Karla',verdana,arial,sans-serif;\n",
|
||||
" //font-family: 'Roboto',verdana,arial,sans-serif;\n",
|
||||
" //font-family: 'Lato',verdana,arial,sans-serif;\n",
|
||||
" //font-family: 'Domine',verdana,arial,sans-serif;\n",
|
||||
" //font-family: 'Chivo',verdana,arial,sans-serif;\n",
|
||||
" //font-family: 'Cardo',verdana,arial,sans-serif;\n",
|
||||
" //font-family: 'Arvo',verdana,arial,sans-serif;\n",
|
||||
" //font-family: 'Poppins',verdana,arial,sans-serif; \n",
|
||||
" //font-family: 'Ubuntu',verdana,arial,sans-serif;\n",
|
||||
" //font-family: 'Fontin',verdana,arial,sans-serif;\n",
|
||||
" //font-family: 'Raleway',verdana,arial,sans-serif;\n",
|
||||
" //font-family: 'Merriweather',verdana,arial,sans-serif;\n",
|
||||
" //font-family: 'Crimson Text', verdana,arial,sans-serif;\n",
|
||||
" //font-family: verdana,arial,sans-serif;\n",
|
||||
" //font-family: arial,sans-serif;\n",
|
||||
" line-height: 125%;\n",
|
||||
" font-size: 130%;\n",
|
||||
" text-align: justify;\n",
|
||||
" text-justify:inter-word;\n",
|
||||
" }\n",
|
||||
" div.text_cell code {\n",
|
||||
" background: transparent;\n",
|
||||
" color: #000000;\n",
|
||||
" font-weight: 400;\n",
|
||||
" font-size: 12pt;\n",
|
||||
" //font-style: bold;\n",
|
||||
" font-family: 'Source Code Pro', Consolas, monocco, monospace;\n",
|
||||
" }\n",
|
||||
" h1 {\n",
|
||||
" font-family: 'Open sans',verdana,arial,sans-serif;\n",
|
||||
"\t}\n",
|
||||
"\t\n",
|
||||
" div.input_area {\n",
|
||||
" background: #F6F6F9;\n",
|
||||
" border: 1px solid #586e75; \n",
|
||||
" }\n",
|
||||
"\n",
|
||||
" .text_cell_render h1 {\n",
|
||||
" font-weight: 200;\n",
|
||||
" font-size: 30pt;\n",
|
||||
" line-height: 100%;\n",
|
||||
" color:#c76c0c;\n",
|
||||
" margin-bottom: 0.5em;\n",
|
||||
" margin-top: 1em;\n",
|
||||
" display: block;\n",
|
||||
" white-space: wrap;\n",
|
||||
" text-align: left;\n",
|
||||
" } \n",
|
||||
" h2 {\n",
|
||||
" font-family: 'Open sans',verdana,arial,sans-serif;\n",
|
||||
" text-align: left;\n",
|
||||
" }\n",
|
||||
" .text_cell_render h2 {\n",
|
||||
" font-weight: 200;\n",
|
||||
" font-size: 16pt;\n",
|
||||
" font-style: italic;\n",
|
||||
" line-height: 100%;\n",
|
||||
" color:#c76c0c;\n",
|
||||
" margin-bottom: 0.5em;\n",
|
||||
" margin-top: 1.5em;\n",
|
||||
" display: block;\n",
|
||||
" white-space: wrap;\n",
|
||||
" text-align: left;\n",
|
||||
" } \n",
|
||||
" h3 {\n",
|
||||
" font-family: 'Open sans',verdana,arial,sans-serif;\n",
|
||||
" }\n",
|
||||
" .text_cell_render h3 {\n",
|
||||
" font-weight: 200;\n",
|
||||
" font-size: 14pt;\n",
|
||||
" line-height: 100%;\n",
|
||||
" color:#d77c0c;\n",
|
||||
" margin-bottom: 0.5em;\n",
|
||||
" margin-top: 2em;\n",
|
||||
" display: block;\n",
|
||||
" white-space: wrap;\n",
|
||||
" text-align: left;\n",
|
||||
" }\n",
|
||||
" h4 {\n",
|
||||
" font-family: 'Open sans',verdana,arial,sans-serif;\n",
|
||||
" }\n",
|
||||
" .text_cell_render h4 {\n",
|
||||
" font-weight: 100;\n",
|
||||
" font-size: 14pt;\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",
|
||||
"\n",
|
||||
" .text_cell_render h5 {\n",
|
||||
" font-weight: 200;\n",
|
||||
" font-style: normal;\n",
|
||||
" color: #1d3b84;\n",
|
||||
" font-size: 16pt;\n",
|
||||
" margin-bottom: 0em;\n",
|
||||
" margin-top: 0.5em;\n",
|
||||
" display: block;\n",
|
||||
" white-space: nowrap;\n",
|
||||
" }\n",
|
||||
" div.output_subarea.output_text.output_pyout {\n",
|
||||
" overflow-x: auto;\n",
|
||||
" overflow-y: scroll;\n",
|
||||
" max-height: 50000px;\n",
|
||||
" }\n",
|
||||
" div.output_subarea.output_stream.output_stdout.output_text {\n",
|
||||
" overflow-x: auto;\n",
|
||||
" overflow-y: scroll;\n",
|
||||
" max-height: 50000px;\n",
|
||||
" }\n",
|
||||
" div.output_wrapper{\n",
|
||||
" margin-top:0.2em;\n",
|
||||
" margin-bottom:0.2em;\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
" code{\n",
|
||||
" font-size: 6pt;\n",
|
||||
"\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",
|
||||
" equationNumbers: { autoNumber: \"AMS\", useLabelIds: true}\n",
|
||||
" },\n",
|
||||
" tex2jax: {\n",
|
||||
" inlineMath: [ ['$','$'], [\"\\\\(\",\"\\\\)\"] ],\n",
|
||||
" displayMath: [ ['$$','$$'], [\"\\\\[\",\"\\\\]\"] ]\n",
|
||||
" },\n",
|
||||
" displayAlign: 'center', // Change this to 'center' to center equations.\n",
|
||||
" \"HTML-CSS\": {\n",
|
||||
" scale:95,\n",
|
||||
" availableFonts: [],\n",
|
||||
" preferredFont:null,\n",
|
||||
" webFont: \"TeX\",\n",
|
||||
" styles: {'.MathJax_Display': {\"margin\": 4}}\n",
|
||||
" }\n",
|
||||
" });\n",
|
||||
"</script>\n"
|
||||
" <style>\n",
|
||||
" .output_wrapper, .output {\n",
|
||||
" height:auto !important;\n",
|
||||
" max-height:100000px; \n",
|
||||
" }\n",
|
||||
" .output_scroll {\n",
|
||||
" box-shadow:none !important;\n",
|
||||
" webkit-box-shadow:none !important;\n",
|
||||
" }\n",
|
||||
" </style>\n",
|
||||
" "
|
||||
],
|
||||
"text/plain": [
|
||||
"<IPython.core.display.HTML object>"
|
||||
@ -286,10 +32,12 @@
|
||||
],
|
||||
"source": [
|
||||
"#format the book\n",
|
||||
"%matplotlib inline\n",
|
||||
"from __future__ import division, print_function\n",
|
||||
"import sys;sys.path.insert(0,'..')\n",
|
||||
"from book_format import load_style;load_style('..')"
|
||||
"%matplotlib inline\n",
|
||||
"import sys\n",
|
||||
"sys.path.insert(0, '..')\n",
|
||||
"import book_format\n",
|
||||
"book_format.set_style()"
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -428,9 +176,9 @@
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.5.1"
|
||||
"version": "3.7.1"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
"nbformat_minor": 1
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -2,294 +2,42 @@
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"execution_count": 3,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<style>\n",
|
||||
"@import url('http://fonts.googleapis.com/css?family=Source+Code+Pro');\n",
|
||||
"@import url('http://fonts.googleapis.com/css?family=Lora');\n",
|
||||
"\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Open+Sans');\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Vollkorn');\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Karla');\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Poppins');\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Arimo');\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Roboto');\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Lato');\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Domine');\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Chivo');\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Cardo');\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Arvo');\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Crimson+Text');\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Ubuntu');\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Fontin');\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Raleway');\n",
|
||||
"//@import url('http://fonts.googleapis.com/css?family=Merriweather');\n",
|
||||
"\n",
|
||||
"\n",
|
||||
".CodeMirror pre {\n",
|
||||
" font-family: 'Source Code Pro', Consolas, monocco, monospace;\n",
|
||||
"}\n",
|
||||
" div.cell{\n",
|
||||
" width: 850px;\n",
|
||||
" margin-left: 0% !important;\n",
|
||||
" margin-right: auto;\n",
|
||||
" }\n",
|
||||
" div.text_cell_render{\n",
|
||||
" font-family: 'Lora';\n",
|
||||
" //font-family: 'Open Sans';\n",
|
||||
" //font-family: 'Karla',verdana,arial,sans-serif;\n",
|
||||
" //font-family: 'Roboto',verdana,arial,sans-serif;\n",
|
||||
" //font-family: 'Lato',verdana,arial,sans-serif;\n",
|
||||
" //font-family: 'Domine',verdana,arial,sans-serif;\n",
|
||||
" //font-family: 'Chivo',verdana,arial,sans-serif;\n",
|
||||
" //font-family: 'Cardo',verdana,arial,sans-serif;\n",
|
||||
" //font-family: 'Arvo',verdana,arial,sans-serif;\n",
|
||||
" //font-family: 'Poppins',verdana,arial,sans-serif; \n",
|
||||
" //font-family: 'Ubuntu',verdana,arial,sans-serif;\n",
|
||||
" //font-family: 'Fontin',verdana,arial,sans-serif;\n",
|
||||
" //font-family: 'Raleway',verdana,arial,sans-serif;\n",
|
||||
" //font-family: 'Merriweather',verdana,arial,sans-serif;\n",
|
||||
" //font-family: 'Crimson Text', verdana,arial,sans-serif;\n",
|
||||
" //font-family: verdana,arial,sans-serif;\n",
|
||||
" //font-family: arial,sans-serif;\n",
|
||||
" line-height: 125%;\n",
|
||||
" font-size: 130%;\n",
|
||||
" text-align: justify;\n",
|
||||
" text-justify:inter-word;\n",
|
||||
" }\n",
|
||||
" div.text_cell code {\n",
|
||||
" background: transparent;\n",
|
||||
" color: #000000;\n",
|
||||
" font-weight: 400;\n",
|
||||
" font-size: 12pt;\n",
|
||||
" //font-style: bold;\n",
|
||||
" font-family: 'Source Code Pro', Consolas, monocco, monospace;\n",
|
||||
" }\n",
|
||||
" h1 {\n",
|
||||
" font-family: 'Open sans',verdana,arial,sans-serif;\n",
|
||||
"\t}\n",
|
||||
"\t\n",
|
||||
" div.input_area {\n",
|
||||
" background: #F6F6F9;\n",
|
||||
" border: 1px solid #586e75; \n",
|
||||
" }\n",
|
||||
"\n",
|
||||
" .text_cell_render h1 {\n",
|
||||
" font-weight: 200;\n",
|
||||
" font-size: 30pt;\n",
|
||||
" line-height: 100%;\n",
|
||||
" color:#c76c0c;\n",
|
||||
" margin-bottom: 0.5em;\n",
|
||||
" margin-top: 1em;\n",
|
||||
" display: block;\n",
|
||||
" white-space: wrap;\n",
|
||||
" text-align: left;\n",
|
||||
" } \n",
|
||||
" h2 {\n",
|
||||
" font-family: 'Open sans',verdana,arial,sans-serif;\n",
|
||||
" text-align: left;\n",
|
||||
" }\n",
|
||||
" .text_cell_render h2 {\n",
|
||||
" font-weight: 200;\n",
|
||||
" font-size: 16pt;\n",
|
||||
" font-style: italic;\n",
|
||||
" line-height: 100%;\n",
|
||||
" color:#c76c0c;\n",
|
||||
" margin-bottom: 0.5em;\n",
|
||||
" margin-top: 1.5em;\n",
|
||||
" display: block;\n",
|
||||
" white-space: wrap;\n",
|
||||
" text-align: left;\n",
|
||||
" } \n",
|
||||
" h3 {\n",
|
||||
" font-family: 'Open sans',verdana,arial,sans-serif;\n",
|
||||
" }\n",
|
||||
" .text_cell_render h3 {\n",
|
||||
" font-weight: 200;\n",
|
||||
" font-size: 14pt;\n",
|
||||
" line-height: 100%;\n",
|
||||
" color:#d77c0c;\n",
|
||||
" margin-bottom: 0.5em;\n",
|
||||
" margin-top: 2em;\n",
|
||||
" display: block;\n",
|
||||
" white-space: wrap;\n",
|
||||
" text-align: left;\n",
|
||||
" }\n",
|
||||
" h4 {\n",
|
||||
" font-family: 'Open sans',verdana,arial,sans-serif;\n",
|
||||
" }\n",
|
||||
" .text_cell_render h4 {\n",
|
||||
" font-weight: 100;\n",
|
||||
" font-size: 14pt;\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",
|
||||
"\n",
|
||||
" .text_cell_render h5 {\n",
|
||||
" font-weight: 200;\n",
|
||||
" font-style: normal;\n",
|
||||
" color: #1d3b84;\n",
|
||||
" font-size: 16pt;\n",
|
||||
" margin-bottom: 0em;\n",
|
||||
" margin-top: 0.5em;\n",
|
||||
" display: block;\n",
|
||||
" white-space: nowrap;\n",
|
||||
" }\n",
|
||||
" div.output_subarea.output_text.output_pyout {\n",
|
||||
" overflow-x: auto;\n",
|
||||
" overflow-y: scroll;\n",
|
||||
" max-height: 50000px;\n",
|
||||
" }\n",
|
||||
" div.output_subarea.output_stream.output_stdout.output_text {\n",
|
||||
" overflow-x: auto;\n",
|
||||
" overflow-y: scroll;\n",
|
||||
" max-height: 50000px;\n",
|
||||
" }\n",
|
||||
" div.output_wrapper{\n",
|
||||
" margin-top:0.2em;\n",
|
||||
" margin-bottom:0.2em;\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
" code{\n",
|
||||
" font-size: 6pt;\n",
|
||||
"\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",
|
||||
" equationNumbers: { autoNumber: \"AMS\", useLabelIds: true}\n",
|
||||
" },\n",
|
||||
" tex2jax: {\n",
|
||||
" inlineMath: [ ['$','$'], [\"\\\\(\",\"\\\\)\"] ],\n",
|
||||
" displayMath: [ ['$$','$$'], [\"\\\\[\",\"\\\\]\"] ]\n",
|
||||
" },\n",
|
||||
" displayAlign: 'center', // Change this to 'center' to center equations.\n",
|
||||
" \"HTML-CSS\": {\n",
|
||||
" scale:95,\n",
|
||||
" availableFonts: [],\n",
|
||||
" preferredFont:null,\n",
|
||||
" webFont: \"TeX\",\n",
|
||||
" styles: {'.MathJax_Display': {\"margin\": 4}}\n",
|
||||
" }\n",
|
||||
" });\n",
|
||||
"</script>\n"
|
||||
" <style>\n",
|
||||
" .output_wrapper, .output {\n",
|
||||
" height:auto !important;\n",
|
||||
" max-height:100000px; \n",
|
||||
" }\n",
|
||||
" .output_scroll {\n",
|
||||
" box-shadow:none !important;\n",
|
||||
" webkit-box-shadow:none !important;\n",
|
||||
" }\n",
|
||||
" </style>\n",
|
||||
" "
|
||||
],
|
||||
"text/plain": [
|
||||
"<IPython.core.display.HTML object>"
|
||||
]
|
||||
},
|
||||
"execution_count": 1,
|
||||
"execution_count": 3,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"#format the book\n",
|
||||
"%matplotlib inline\n",
|
||||
"from __future__ import division, print_function\n",
|
||||
"import sys;sys.path.insert(0,'..')\n",
|
||||
"from book_format import load_style;load_style('..')"
|
||||
"%matplotlib inline\n",
|
||||
"import sys\n",
|
||||
"sys.path.insert(0, '..')\n",
|
||||
"import book_format\n",
|
||||
"book_format.set_style()"
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -325,17 +73,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"execution_count": 4,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"estimate of sin(.3) is 0.30452025\n",
|
||||
"exact value of sin(.3) is 0.295520206661\n"
|
||||
"exact value of sin(.3) is 0.29552020666133955\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@ -374,9 +120,9 @@
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.5.1"
|
||||
"version": "3.7.1"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
"nbformat_minor": 1
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
Before Width: | Height: | Size: 206 KiB After Width: | Height: | Size: 295 KiB |
@ -1,6 +1,8 @@
|
||||
name: kf_bf
|
||||
dependencies:
|
||||
- pip
|
||||
- python
|
||||
- pip
|
||||
- ipython
|
||||
- jupyter
|
||||
- matplotlib
|
||||
|
@ -172,26 +172,25 @@ def plot_estimate_chart_3():
|
||||
plt.ylim(157, 164.5)
|
||||
|
||||
|
||||
def plot_gh_results(weights, estimates, predictions, time_step=0):
|
||||
|
||||
def plot_gh_results(weights, estimates, predictions, actual, time_step=0):
|
||||
n = len(weights)
|
||||
if time_step > 0:
|
||||
rng = range(1, n+1)
|
||||
else:
|
||||
rng = range(n, n+1)
|
||||
xs = range(n+1)
|
||||
pred, = book_plots.plot_track(xs[1:], predictions, c='r', marker='v')
|
||||
scale, = book_plots.plot_measurements(xs[1:], weights, color='k', lines=False)
|
||||
est, = book_plots.plot_filter(xs, estimates, marker='o')
|
||||
|
||||
plt.legend([scale, est, pred], ['Measurement', 'Estimates', 'Predictions'], loc=4)
|
||||
book_plots.plot_measurements(xs[1:], weights, color='k', lines=False)
|
||||
book_plots.plot_filter(xs, estimates, marker='o', label='Estimates')
|
||||
book_plots.plot_track(xs[1:], predictions, c='r', marker='v', label='Predictions')
|
||||
plt.plot([xs[0], xs[-1]], actual, c='k', lw=1, label='Actual')
|
||||
plt.legend(loc=4)
|
||||
book_plots.set_labels(x='day', y='weight (lbs)')
|
||||
plt.xlim([-1, n+1])
|
||||
plt.ylim([156.0, 173])
|
||||
|
||||
|
||||
def print_results(estimates, prediction, weight):
|
||||
print('previous: {:.2f}, prediction: {:.2f} estimate {:.2f}'.format(
|
||||
print('previous estimate: {:.2f}, prediction: {:.2f}, estimate {:.2f}'.format(
|
||||
estimates[-2], prediction, weight))
|
||||
|
||||
|
||||
|
@ -1,2 +1,5 @@
|
||||
filterpy
|
||||
seaborn
|
||||
seaborn
|
||||
jupyter
|
||||
notebook
|
||||
sympy
|
||||
|
@ -10,106 +10,106 @@
|
||||
"\n",
|
||||
"## Table of Contents\n",
|
||||
"\n",
|
||||
"[**Preface**](http://nbviewer.ipython.org/urls/raw.github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/master/00-Preface.ipynb)\n",
|
||||
"[**Preface**](./00-Preface.ipynb)\n",
|
||||
" \n",
|
||||
"Motivation behind writing the book. How to download and read the book. Requirements for IPython Notebook and Python. github links.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"[**Chapter 1: The g-h Filter**](http://nbviewer.ipython.org/urls/raw.github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/master/01-g-h-filter.ipynb)\n",
|
||||
"[**Chapter 1: The g-h Filter**](./01-g-h-filter.ipynb)\n",
|
||||
"\n",
|
||||
"Intuitive introduction to the g-h filter, also known as the $\\alpha$-$\\beta$ Filter, which is a family of filters that includes the Kalman filter. Once you understand this chapter you will understand the concepts behind the Kalman filter. \n",
|
||||
"\n",
|
||||
"\n",
|
||||
"[**Chapter 2: The Discrete Bayes Filter**](http://nbviewer.ipython.org/urls/raw.github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/master/02-Discrete-Bayes.ipynb)\n",
|
||||
"[**Chapter 2: The Discrete Bayes Filter**](./02-Discrete-Bayes.ipynb)\n",
|
||||
"\n",
|
||||
"Introduces the discrete Bayes filter. From this you will learn the probabilistic (Bayesian) reasoning that underpins the Kalman filter in an easy to digest form.\n",
|
||||
"\n",
|
||||
"[**Chapter 3: Probabilities, Gaussians, and Bayes' Theorem**](http://nbviewer.ipython.org/urls/raw.github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/master/03-Gaussians.ipynb)\n",
|
||||
"[**Chapter 3: Probabilities, Gaussians, and Bayes' Theorem**](./03-Gaussians.ipynb)\n",
|
||||
"\n",
|
||||
"Introduces using Gaussians to represent beliefs in the Bayesian sense. Gaussians allow us to implement the algorithms used in the discrete Bayes filter to work in continuous domains.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"[**Chapter 4: One Dimensional Kalman Filters**](http://nbviewer.ipython.org/urls/raw.github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/master/04-One-Dimensional-Kalman-Filters.ipynb)\n",
|
||||
"[**Chapter 4: One Dimensional Kalman Filters**](./04-One-Dimensional-Kalman-Filters.ipynb)\n",
|
||||
"\n",
|
||||
"Implements a Kalman filter by modifying the discrete Bayes filter to use Gaussians. This is a full featured Kalman filter, albeit only useful for 1D problems. \n",
|
||||
"\n",
|
||||
"\n",
|
||||
"[**Chapter 5: Multivariate Gaussians**](http://nbviewer.ipython.org/urls/raw.github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/master/05-Multivariate-Gaussians.ipynb)\n",
|
||||
"[**Chapter 5: Multivariate Gaussians**](./05-Multivariate-Gaussians.ipynb)\n",
|
||||
"\n",
|
||||
"Extends Gaussians to multiple dimensions, and demonstrates how 'triangulation' and hidden variables can vastly improve estimates.\n",
|
||||
"\n",
|
||||
"[**Chapter 6: Multivariate Kalman Filter**](http://nbviewer.ipython.org/urls/raw.github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/master/06-Multivariate-Kalman-Filters.ipynb)\n",
|
||||
"[**Chapter 6: Multivariate Kalman Filter**](./06-Multivariate-Kalman-Filters.ipynb)\n",
|
||||
"\n",
|
||||
"We extend the Kalman filter developed in the univariate chapter to the full, generalized filter for linear problems. After reading this you will understand how a Kalman filter works and how to design and implement one for a (linear) problem of your choice.\n",
|
||||
"\n",
|
||||
"[**Chapter 7: Kalman Filter Math**](http://nbviewer.ipython.org/urls/raw.github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/master/07-Kalman-Filter-Math.ipynb)\n",
|
||||
"[**Chapter 7: Kalman Filter Math**](./07-Kalman-Filter-Math.ipynb)\n",
|
||||
"\n",
|
||||
"We gotten about as far as we can without forming a strong mathematical foundation. This chapter is optional, especially the first time, but if you intend to write robust, numerically stable filters, or to read the literature, you will need to know the material in this chapter. Some sections will be required to understand the later chapters on nonlinear filtering. \n",
|
||||
"\n",
|
||||
"\n",
|
||||
"[**Chapter 8: Designing Kalman Filters**](http://nbviewer.ipython.org/urls/raw.github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/master/08-Designing-Kalman-Filters.ipynb)\n",
|
||||
"[**Chapter 8: Designing Kalman Filters**](./08-Designing-Kalman-Filters.ipynb)\n",
|
||||
"\n",
|
||||
"Building on material in Chapters 5 and 6, walks you through the design of several Kalman filters. Only by seeing several different examples can you really grasp all of the theory. Examples are chosen to be realistic, not 'toy' problems to give you a start towards implementing your own filters. Discusses, but does not solve issues like numerical stability.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"[**Chapter 9: Nonlinear Filtering**](http://nbviewer.ipython.org/urls/raw.github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/master/09-Nonlinear-Filtering.ipynb)\n",
|
||||
"[**Chapter 9: Nonlinear Filtering**](./09-Nonlinear-Filtering.ipynb)\n",
|
||||
"\n",
|
||||
"Kalman filters as covered only work for linear problems. Yet the world is nonlinear. Here I introduce the problems that nonlinear systems pose to the filter, and briefly discuss the various algorithms that we will be learning in subsequent chapters.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"[**Chapter 10: Unscented Kalman Filters**](http://nbviewer.ipython.org/urls/raw.github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/master/10-Unscented-Kalman-Filter.ipynb)\n",
|
||||
"[**Chapter 10: Unscented Kalman Filters**](./10-Unscented-Kalman-Filter.ipynb)\n",
|
||||
"\n",
|
||||
"Unscented Kalman filters (UKF) are a recent development in Kalman filter theory. They allow you to filter nonlinear problems without requiring a closed form solution like the Extended Kalman filter requires.\n",
|
||||
"\n",
|
||||
"This topic is typically either not mentioned, or glossed over in existing texts, with Extended Kalman filters receiving the bulk of discussion. I put it first because the UKF is much simpler to understand, implement, and the filtering performance is usually as good as or better then the Extended Kalman filter. I always try to implement the UKF first for real world problems, and you should also.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"[**Chapter 11: Extended Kalman Filters**](http://nbviewer.ipython.org/urls/raw.github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/master/11-Extended-Kalman-Filters.ipynb)\n",
|
||||
"[**Chapter 11: Extended Kalman Filters**](./11-Extended-Kalman-Filters.ipynb)\n",
|
||||
"\n",
|
||||
"Extended Kalman filters (EKF) are the most common approach to linearizing non-linear problems. A majority of real world Kalman filters are EKFs, so will need to understand this material to understand existing code, papers, talks, etc. \n",
|
||||
"\n",
|
||||
"\n",
|
||||
"[**Chapter 12: Particle Filters**](http://nbviewer.ipython.org/urls/raw.github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/master/12-Particle-Filters.ipynb)\n",
|
||||
"[**Chapter 12: Particle Filters**](./12-Particle-Filters.ipynb)\n",
|
||||
"\n",
|
||||
"Particle filters uses Monte Carlo techniques to filter data. They easily handle highly nonlinear and non-Gaussian systems, as well as multimodal distributions (tracking multiple objects simultaneously) at the cost of high computational requirements.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"[**Chapter 13: Smoothing**](http://nbviewer.ipython.org/urls/raw.github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/master/13-Smoothing.ipynb)\n",
|
||||
"[**Chapter 13: Smoothing**](./13-Smoothing.ipynb)\n",
|
||||
"\n",
|
||||
"Kalman filters are recursive, and thus very suitable for real time filtering. However, they work extremely well for post-processing data. After all, Kalman filters are predictor-correctors, and it is easier to predict the past than the future! We discuss some common approaches.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"[**Chapter 14: Adaptive Filtering**](http://nbviewer.ipython.org/urls/raw.github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/master/14-Adaptive-Filtering.ipynb)\n",
|
||||
"[**Chapter 14: Adaptive Filtering**](./14-Adaptive-Filtering.ipynb)\n",
|
||||
" \n",
|
||||
"Kalman filters assume a single process model, but manuevering targets typically need to be described by several different process models. Adaptive filtering uses several techniques to allow the Kalman filter to adapt to the changing behavior of the target.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"[**Appendix A: Installation, Python, NumPy, and FilterPy**](http://nbviewer.ipython.org/urls/raw.github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/master/Appendix-A-Installation.ipynb)\n",
|
||||
"[**Appendix A: Installation, Python, NumPy, and FilterPy**](./Appendix-A-Installation.ipynb)\n",
|
||||
"\n",
|
||||
"Brief introduction of Python and how it is used in this book. Description of the companion\n",
|
||||
"library FilterPy. \n",
|
||||
" \n",
|
||||
"\n",
|
||||
"[**Appendix B: Symbols and Notations**](http://nbviewer.ipython.org/urls/raw.github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/master/Appendix-B-Symbols-and-Notations.ipynb)\n",
|
||||
"[**Appendix B: Symbols and Notations**](./Appendix-B-Symbols-and-Notations.ipynb)\n",
|
||||
"\n",
|
||||
"Most books opt to use different notations and variable names for identical concepts. This is a large barrier to understanding when you are starting out. I have collected the symbols and notations used in this book, and built tables showing what notation and names are used by the major books in the field.\n",
|
||||
"\n",
|
||||
"*Still just a collection of notes at this point.*\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"[**Appendix D: H-Infinity Filters**](http://nbviewer.ipython.org/urls/raw.github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/master/Appendix-D-HInfinity-Filters.ipynb)\n",
|
||||
"[**Appendix D: H-Infinity Filters**](./Appendix-D-HInfinity-Filters.ipynb)\n",
|
||||
" \n",
|
||||
"Describes the $H_\\infty$ filter. \n",
|
||||
"\n",
|
||||
"*I have code that implements the filter, but no supporting text yet.*\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"[**Appendix E: Ensemble Kalman Filters**](http://nbviewer.ipython.org/urls/raw.github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/master/Appendix-E-Ensemble-Kalman-Filters.ipynb)\n",
|
||||
"[**Appendix E: Ensemble Kalman Filters**](./Appendix-E-Ensemble-Kalman-Filters.ipynb)\n",
|
||||
"\n",
|
||||
"Discusses the ensemble Kalman Filter, which uses a Monte Carlo approach to deal with very large Kalman filter states in nonlinear systems.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"[**Appendix F: FilterPy Source Code**](http://nbviewer.ipython.org/urls/raw.github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/master/Appendix-F-Filterpy-Code.ipynb)\n",
|
||||
"[**Appendix F: FilterPy Source Code**](./Appendix-F-Filterpy-Code.ipynb)\n",
|
||||
"\n",
|
||||
"Listings of important classes from FilterPy that are used in this book.\n",
|
||||
"\n",
|
||||
@ -119,25 +119,25 @@
|
||||
"These notebooks are not a primary part of the book, but contain information that might be interested to a subest of readers.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"[**Computing and plotting PDFs**](http://nbviewer.ipython.org/urls/raw.github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/master/Supporting_Notebooks/Computing_and_plotting_PDFs.ipynb)\n",
|
||||
"[**Computing and plotting PDFs**](./Supporting_Notebooks/Computing_and_plotting_PDFs.ipynb)\n",
|
||||
"\n",
|
||||
"Describes how I implemented the plotting of various pdfs in the book.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"[**Interactions**](http://nbviewer.ipython.org/urls/raw.github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/master/Supporting_Notebooks/Interactions.ipynb)\n",
|
||||
"[**Interactions**](./Supporting_Notebooks/Interactions.ipynb)\n",
|
||||
"\n",
|
||||
"Interactive simulations of various algorithms. Use sliders to change the output in real time.\n",
|
||||
"\n",
|
||||
"[**Converting the Multivariate Equations to the Univariate Case**](http://nbviewer.ipython.org/urls/raw.github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/master/Supporting_Notebooks/Converting-Multivariate-Equations-to-Univariate.ipynb)\n",
|
||||
"[**Converting the Multivariate Equations to the Univariate Case**](./Supporting_Notebooks/Converting-Multivariate-Equations-to-Univariate.ipynb)\n",
|
||||
"\n",
|
||||
"Demonstrates that the Multivariate equations are identical to the univariate Kalman filter equations by setting the dimension of all vectors and matrices to one.\n",
|
||||
"\n",
|
||||
"[**Iterative Least Squares for Sensor Fusion**](http://nbviewer.ipython.org/urls/raw.github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/master/Supporting_Notebooks/Iterative-Least-Squares-for-Sensor-Fusion.ipynb)\n",
|
||||
"[**Iterative Least Squares for Sensor Fusion**](./Supporting_Notebooks/Iterative-Least-Squares-for-Sensor-Fusion.ipynb)\n",
|
||||
"\n",
|
||||
"Deep dive into using an iterative least squares technique to solve the nonlinear problem of finding position from multiple GPS pseudorange measurements.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"[**Taylor Series**](http://nbviewer.ipython.org/urls/raw.github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/master/Supporting_Notebooks/Taylor-Series.ipynb)\n",
|
||||
"[**Taylor Series**](./Supporting_Notebooks/Taylor-Series.ipynb)\n",
|
||||
"\n",
|
||||
"A very brief introduction to Taylor series.\n",
|
||||
"\n",
|
||||
|
Loading…
Reference in New Issue
Block a user