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.
This commit is contained in:
Roger Labbe 2015-07-05 17:32:29 -07:00
parent 0269f2ec22
commit d44cca32ab

View File

@ -369,12 +369,13 @@
"source": [
"Now, without explanation, here is the full equation for the multivariate normal distribution in $n$ dimensions.\n",
"\n",
"$$\\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",
"$$\\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",
"$$\n",
"\n",
"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",
"\n",
"$$ \n",
"f(x, \\mu, \\sigma) = \\frac{1}{\\sigma\\sqrt{2\\pi}} e^{{-\\frac{1}{2}}{(x-\\mu)^2}/\\sigma^2 }\n",
"f(x, \\mu, \\sigma) = \\frac{1}{\\sigma\\sqrt{2\\pi}} \\exp \\Big [{-\\frac{1}{2}}{(x-\\mu)^2}/\\sigma^2 \\Big ]\n",
"$$\n",
"\n",
"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 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.4.1"
"version": "3.4.3"
}
},
"nbformat": 4,