Skip to content

Commit d44cca3

Browse files
committed
Cleaned up equations for Gaussians.
Made them more readable by avoiding raised exponent for e, which made it easier to compare univariate and multivariate cases.
1 parent 0269f2e commit d44cca3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

05_Multivariate_Kalman_Filters.ipynb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,12 +369,13 @@
369369
"source": [
370370
"Now, without explanation, here is the full equation for the multivariate normal distribution in $n$ dimensions.\n",
371371
"\n",
372-
"$$\\mathcal{N}(\\mu,\\,\\Sigma) = (2\\pi)^{-\\frac{n}{2}}|\\Sigma|^{-\\frac{1}{2}}\\, e^{ -\\frac{1}{2}(\\mathbf{x}-\\mu)^\\mathsf{T}\\Sigma^{-1}(\\mathbf{x}-\\mu) }$$\n",
372+
"$$\\mathcal{N}(\\mu,\\,\\Sigma) = \\frac{1}{(2\\pi)^{\\frac{n}{2}}|\\Sigma|^{\\frac{1}{2}}}\\, \\exp \\Big [{ -\\frac{1}{2}(\\mathbf{x}-\\mu)^\\mathsf{T}\\Sigma^{-1}(\\mathbf{x}-\\mu) \\Big ]}\n",
373+
"$$\n",
373374
"\n",
374375
"I urge you to not try to remember this function. We will program it in a Python function and then call it if we need to compute a specific value. Plus, it turns out that the Kalman filter equations will compute this for us automatically; we never have to compute it ourselves. However, if you look at it briefly you will note that it looks quite similar to the univariate normal distribution except it uses matrices instead of scalar values, and the root of $\\pi$ is scaled by $n$. Here is the univariate equation for reference:\n",
375376
"\n",
376377
"$$ \n",
377-
"f(x, \\mu, \\sigma) = \\frac{1}{\\sigma\\sqrt{2\\pi}} e^{{-\\frac{1}{2}}{(x-\\mu)^2}/\\sigma^2 }\n",
378+
"f(x, \\mu, \\sigma) = \\frac{1}{\\sigma\\sqrt{2\\pi}} \\exp \\Big [{-\\frac{1}{2}}{(x-\\mu)^2}/\\sigma^2 \\Big ]\n",
378379
"$$\n",
379380
"\n",
380381
"The multivariate version merely replaces the scalars of the univariate equations with matrices. If you are reasonably well-versed in linear algebra this equation should look quite manageable; if not, don't worry! Let's just plot it and see what it looks like."
@@ -3528,7 +3529,7 @@
35283529
"name": "python",
35293530
"nbconvert_exporter": "python",
35303531
"pygments_lexer": "ipython3",
3531-
"version": "3.4.1"
3532+
"version": "3.4.3"
35323533
}
35333534
},
35343535
"nbformat": 4,

0 commit comments

Comments
 (0)