Text on Approximating Q

Discussed approximating Q by only assigning a value to the
lower rightmost term.
This commit is contained in:
Roger Labbe 2014-11-16 01:01:42 -08:00
parent d974f78d37
commit 9c0729d837

View File

@ -1,7 +1,7 @@
{
"metadata": {
"name": "",
"signature": "sha256:dc1d96fdfafdd06f5b65eb11a1bda31f0fd112f7cceaa954c22732296e2889b1"
"signature": "sha256:055b90da7ef328423abb1781625b97673afca40aad9be9012d9e79e2f3aa4c65"
},
"nbformat": 3,
"nbformat_minor": 0,
@ -952,14 +952,14 @@
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 9,
"prompt_number": 2,
"text": [
"array([[ 0.33333333, 0.5 ],\n",
" [ 0.5 , 1. ]])"
]
}
],
"prompt_number": 9
"prompt_number": 2
},
{
"cell_type": "code",
@ -1033,14 +1033,52 @@
],
"prompt_number": 7
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Simplification of Q\n",
"\n",
"Through the early parts of this book I used a much simpler form for $\\mathbf{Q}$, often only putting a noise term in the lower rightmost element. Is this justified? Well, consider the value of $\\mathbf{Q}$ for a small $\\Delta t$"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"input": [
"common.Q_continuous_white_noise(dim=3, dt=0.05, spectral_density=1)"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 10
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 3,
"text": [
"array([[ 1.56250000e-08, 7.81250000e-07, 2.08333333e-05],\n",
" [ 7.81250000e-07, 4.16666667e-05, 1.25000000e-03],\n",
" [ 2.08333333e-05, 1.25000000e-03, 5.00000000e-02]])"
]
}
],
"prompt_number": 3
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We can see that most of the terms are very small. Recall that the only Kalman filter using this matrix is\n",
"\n",
"$$ \\mathbf{P}=\\mathbf{FPF}^T + \\mathbf{Q}$$\n",
"\n",
"If the values for $\\mathbf{Q}$ are small relative to $\\mathbf{P}$\n",
"than it will be contributing almost nothing to the computation of $\\mathbf{P}$. Setting $\\mathbf{Q}$ to \n",
"\n",
"$$Q=\\begin{bmatrix}0&0&0\\\\0&0&0\\\\0&0&\\sigma^2\\end{bmatrix}$$\n",
"\n",
"while not correct, is often a useful approximation. If you do this you will have to perform quite a few studies to guarantee that your filter works in a variety of situations. Given the availability of functions to compute the correct values of $\\mathbf{Q}$ for you I would strongly recommend not using approximations. Perhaps it is justified for quick-and-dirty filters, or on embedded devices where you need to wring out every last bit of performance, and seek to minimize the number of matrix operations required. "
]
},
{
"cell_type": "heading",