{
 "metadata": {
  "name": "",
  "signature": "sha256:96b8d49070c26012f68e9c586fe5de841f9bf752ab9ecd8bd8c787afa0086ad3"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "[Table of Contents](http://nbviewer.ipython.org/github/rlabbe/Kalman-and-Bayesian-Filters-in-Python/blob/master/table_of_contents.ipynb)"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#format the book\n",
      "%matplotlib inline\n",
      "from __future__ import division, print_function\n",
      "import matplotlib.pyplot as plt\n",
      "import sys\n",
      "sys.path.insert(0,'../') # allow us to format the book\n",
      "import book_format\n",
      "book_format.load_style()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<style>\n",
        "@import url('http://fonts.googleapis.com/css?family=Source+Code+Pro');\n",
        "\n",
        "    div.cell{\n",
        "        width: 850px;\n",
        "        margin-left: 0% !important;\n",
        "        margin-right: auto;\n",
        "    }\n",
        "    div.text_cell code {\n",
        "        background: transparent;\n",
        "        color: #000000;\n",
        "        font-weight: 600;\n",
        "        font-size: 11pt;\n",
        "        font-style: bold;\n",
        "        font-family:  'Source Code Pro', Consolas, monocco, monospace;\n",
        "   }\n",
        "    h1 {\n",
        "        font-family: 'Open sans',verdana,arial,sans-serif;\n",
        "\t}\n",
        "\t\n",
        "    div.input_area {\n",
        "        background: #F6F6F9;\n",
        "        border: 1px solid #586e75;\n",
        "    }\n",
        "\n",
        "    .text_cell_render h1 {\n",
        "        font-weight: 200;\n",
        "        font-size: 30pt;\n",
        "        line-height: 100%;\n",
        "        color:#c76c0c;\n",
        "        margin-bottom: 0.5em;\n",
        "        margin-top: 1em;\n",
        "        display: block;\n",
        "        white-space: wrap;\n",
        "    } \n",
        "    h2 {\n",
        "        font-family: 'Open sans',verdana,arial,sans-serif;\n",
        "    }\n",
        "    .text_cell_render h2 {\n",
        "        font-weight: 200;\n",
        "        font-size: 20pt;\n",
        "        font-style: italic;\n",
        "        line-height: 100%;\n",
        "        color:#c76c0c;\n",
        "        margin-bottom: 0.5em;\n",
        "        margin-top: 1.5em;\n",
        "        display: block;\n",
        "        white-space: nowrap;\n",
        "    } \n",
        "    h3 {\n",
        "        font-family: 'Open sans',verdana,arial,sans-serif;\n",
        "    }\n",
        "    .text_cell_render h3 {\n",
        "        font-weight: 300;\n",
        "        font-size: 18pt;\n",
        "        line-height: 100%;\n",
        "        color:#d77c0c;\n",
        "        margin-bottom: 0.5em;\n",
        "        margin-top: 2em;\n",
        "        display: block;\n",
        "        white-space: nowrap;\n",
        "    }\n",
        "    h4 {\n",
        "        font-family: 'Open sans',verdana,arial,sans-serif;\n",
        "    }\n",
        "    .text_cell_render h4 {\n",
        "        font-weight: 300;\n",
        "        font-size: 16pt;\n",
        "        color:#d77c0c;\n",
        "        margin-bottom: 0.5em;\n",
        "        margin-top: 0.5em;\n",
        "        display: block;\n",
        "        white-space: nowrap;\n",
        "    }\n",
        "    h5 {\n",
        "        font-family: 'Open sans',verdana,arial,sans-serif;\n",
        "    }\n",
        "    .text_cell_render h5 {\n",
        "        font-weight: 300;\n",
        "        font-style: normal;\n",
        "        color: #1d3b84;\n",
        "        font-size: 16pt;\n",
        "        margin-bottom: 0em;\n",
        "        margin-top: 1.5em;\n",
        "        display: block;\n",
        "        white-space: nowrap;\n",
        "    }\n",
        "    div.text_cell_render{\n",
        "        font-family: 'Open sans',verdana,arial,sans-serif;\n",
        "        line-height: 135%;\n",
        "        font-size: 110%;\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 0x7fa10405ba20>"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Appendix I : Symbology"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "This is just notes at this point. \n",
      "\n",
      "### State\n",
      "\n",
      "$x$ (Brookner, Zarchan, Brown)\n",
      "\n",
      "$\\underline{x}$ Gelb)\n",
      "\n",
      "### State at step n\n",
      "\n",
      "$x_n$ (Brookner)\n",
      "\n",
      "$x_k$ (Brown, Zarchan)\n",
      "\n",
      "$\\underline{x}_k$ (Gelb)\n",
      "\n",
      "\n",
      "\n",
      "### Prediction\n",
      "\n",
      "$x^-$\n",
      "\n",
      "$x_{n,n-1}$  (Brookner) \n",
      "\n",
      "$x_{k+1,k}$\n",
      "\n",
      "\n",
      "## measurement\n",
      "\n",
      "\n",
      "$x^*$\n",
      "\n",
      "\n",
      "\n",
      "Y_n (Brookner)\n",
      "\n",
      "##control transition Matrix\n",
      "\n",
      "$G$ (Zarchan)\n",
      "\n",
      "\n",
      "Not used (Brookner)"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "#Nomenclature\n",
      "\n",
      "\n",
      "## Equations\n",
      "### Brookner\n",
      "\n",
      "$$\n",
      "\\begin{aligned}\n",
      "X^*_{n+1,n} &= \\Phi X^*_{n,n} \\\\\n",
      "X^*_{n,n}  &= X^*_{n,n-1} +H_n(Y_n - MX^*_{n,n-1}) \\\\\n",
      "H_n &= S^*_{n,n-1}M^T[R_n + MS^*_{n,n-1}M^T]^{-1} \\\\\n",
      "S^*_{n,n-1} &= \\Phi S^*_{n-1,n-1}\\Phi^T + Q_n \\\\\n",
      "S^*_{n-1,n-1} &= (I-H_{n-1}M)S^*_{n-1,n-2}\n",
      "\\end{aligned}$$\n",
      "\n",
      "### Gelb\n",
      "\n",
      "$$\n",
      "\\begin{aligned}\n",
      "\\underline{\\hat{x}}_k(-) &= \\Phi_{k-1} \\underline{\\hat{x}}_{k-1}(+) \\\\\n",
      "\\underline{\\hat{x}}_k(+)  &= \\underline{\\hat{x}}_k(-) +K_k[Z_k - H_k\\underline{\\hat{x}}_k(-)] \\\\\n",
      "K_k &= P_k(-)H_k^T[H_kP_k(-)H_k^T + R_k]^{-1}\\\\\n",
      "P_k(+) &=  \\Phi_{k-1} P_{k-1}(+)\\Phi_{k-1}^T + Q_{k-1} \\\\\n",
      "P_k(-) &= (I-K_kH_k)P_k(-)\n",
      "\\end{aligned}$$\n",
      "\n",
      "\n",
      "### Brown\n",
      "\n",
      "$$\n",
      "\\begin{aligned}\n",
      "\\hat{\\textbf{x}}^-_{k+1} &= \\mathbf{\\phi}_{k}\\hat{\\textbf{x}}_{k} \\\\\n",
      "\\hat{\\textbf{x}}_k  &= \\hat{\\textbf{x}}^-_k +\\textbf{K}_k[\\textbf{z}_k - \\textbf{H}_k\\hat{\\textbf{}x}^-_k] \\\\\n",
      "\\textbf{K}_k &= \\textbf{P}^-_k\\textbf{H}_k^T[\\textbf{H}_k\\textbf{P}^-_k\\textbf{H}_k^T + \\textbf{R}_k]^{-1}\\\\\n",
      "\\textbf{P}^-_{k+1} &=  \\mathbf{\\phi}_k \\textbf{P}_k\\mathbf{\\phi}_k^T + \\textbf{Q}_{k} \\\\\n",
      "\\mathbf{P}_k &= (\\mathbf{I}-\\mathbf{K}_k\\mathbf{H}_k)\\mathbf{P}^-_k\n",
      "\\end{aligned}$$\n",
      "## \n",
      "\n",
      "### Zarchan\n",
      "\n",
      "$$\n",
      "\\begin{aligned}\n",
      "\\hat{x}_{k} &= \\Phi_{k}\\hat{x}_{k-1} + G_ku_{k-1} + K_k[z_k - H\\Phi_{k}\\hat{x}_{k-1} - HG_ku_{k-1} ] \\\\\n",
      "M_{k} &=  \\Phi_k P_{k-1}\\phi_k^T + Q_{k} \\\\\n",
      "K_k &= M_kH^T[HM_kH^T + R_k]^{-1}\\\\\n",
      "P_k &= (I-K_kH)M_k\n",
      "\\end{aligned}$$"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "### Wikipedia\n",
      "$$\n",
      "\\begin{aligned}\n",
      "\\hat{\\textbf{x}}_{k\\mid k-1} &= \\textbf{F}_{k}\\hat{\\textbf{x}}_{k-1\\mid k-1} + \\textbf{B}_{k} \\textbf{u}_{k} \\\\\n",
      "\\textbf{P}_{k\\mid k-1} &=  \\textbf{F}_{k} \\textbf{P}_{k-1\\mid k-1} \\textbf{F}_{k}^{\\text{T}} + \\textbf{Q}_{k}\\\\\n",
      "\\tilde{\\textbf{y}}_k &= \\textbf{z}_k - \\textbf{H}_k\\hat{\\textbf{x}}_{k\\mid k-1} \\\\\n",
      "\\textbf{S}_k &= \\textbf{H}_k \\textbf{P}_{k\\mid k-1} \\textbf{H}_k^\\text{T} + \\textbf{R}_k \\\\\n",
      "\\textbf{K}_k &= \\textbf{P}_{k\\mid k-1}\\textbf{H}_k^\\text{T}\\textbf{S}_k^{-1} \\\\\n",
      "\\hat{\\textbf{x}}_{k\\mid k} &= \\hat{\\textbf{x}}_{k\\mid k-1} + \\textbf{K}_k\\tilde{\\textbf{y}}_k \\\\\n",
      "\\textbf{P}_{k|k} &= (I - \\textbf{K}_k \\textbf{H}_k) \\textbf{P}_{k|k-1}\n",
      "\\end{aligned}$$"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "### Labbe\n",
      "\n",
      "$$\n",
      "\\begin{aligned}\n",
      "\\hat{\\textbf{x}}^-_{k+1} &= \\mathbf{F}_{k}\\hat{\\textbf{x}}_{k} + \\mathbf{B}_k\\mathbf{u}_k \\\\\n",
      "\\textbf{P}^-_{k+1} &=  \\mathbf{F}_k \\textbf{P}_k\\mathbf{F}_k^T + \\textbf{Q}_{k} \\\\\n",
      "\\textbf{y}_k &= \\textbf{z}_k - \\textbf{H}_k\\hat{\\textbf{}x}^-_k \\\\\n",
      "\\mathbf{S}_k &= \\textbf{H}_k\\textbf{P}^-_k\\textbf{H}_k^T + \\textbf{R}_k \\\\\n",
      "\\textbf{K}_k &= \\textbf{P}^-_k\\textbf{H}_k^T\\mathbf{S}_k^{-1} \\\\\n",
      "\\hat{\\textbf{x}}_k  &= \\hat{\\textbf{x}}^-_k +\\textbf{K}_k\\textbf{y} \\\\\n",
      "\\mathbf{P}_k &= (\\mathbf{I}-\\mathbf{K}_k\\mathbf{H}_k)\\mathbf{P}^-_k\n",
      "\\end{aligned}$$\n",
      "## \n",
      "\n"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": []
    }
   ],
   "metadata": {}
  }
 ]
}