From d72c8201a42fd6b1505cefae0030739e9bbf5cfd Mon Sep 17 00:00:00 2001 From: Roger Labbe Date: Sat, 8 Aug 2015 10:01:06 -0700 Subject: [PATCH] Fixed equations for derivation from Bayes. --- 04-One-Dimensional-Kalman-Filters.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/04-One-Dimensional-Kalman-Filters.ipynb b/04-One-Dimensional-Kalman-Filters.ipynb index 3a23bf8..fb73ed5 100644 --- a/04-One-Dimensional-Kalman-Filters.ipynb +++ b/04-One-Dimensional-Kalman-Filters.ipynb @@ -2652,7 +2652,7 @@ "\n", "I gave you the equations for the product of two Gaussians but did not derive them for you. They are a direct result of applying Bayes rules to Gaussians, however. You don't need to understand this section to read the rest of the book or to use Kalman filters. You may need to know this if you read the literature, much of which is written in terms of Bayes theorem. It's a bit of neat algebra, so why not read on?\n", "\n", - "We can state the problem as: let the prior be $N(\\mu_p, \\sigma_p^2)$, and measurement be $z \\propto N(\\mu_z, \\sigma_z^2)$. What is the posterior x given the measurement z?\n", + "We can state the problem as: let the prior be $N(\\mu_p, \\sigma_p^2)$, and measurement be $z \\propto N(z, \\sigma_z^2)$. What is the posterior x given the measurement z?\n", "\n", "Write the posterior as $P(x|z)$. Now we can use Bayes Theorem to state\n", "\n", @@ -2694,7 +2694,7 @@ "Now we multiply out the squared terms and group in terms of the posterior $x$.\n", "\n", "$$\\begin{aligned}\n", - "P(x|z) &\\propto \\exp \\Big[-\\frac{1}{2\\sigma_z^2\\sigma_p^2}[\\sigma_p^2(z^2 -2xz + x^2) + \\sigma_z^2(x^2 - 2x\\mu_z+\\mu_z^2)]\\Big ] \\\\\n", + "P(x|z) &\\propto \\exp \\Big[-\\frac{1}{2\\sigma_z^2\\sigma_p^2}[\\sigma_p^2(z^2 -2xz + x^2) + \\sigma_z^2(x^2 - 2x\\mu_p+\\mu_p^2)]\\Big ] \\\\\n", "&\\propto \\exp \\Big[-\\frac{1}{2\\sigma_z^2\\sigma_p^2}[x^2(\\sigma_p^2+\\sigma_z^2)-2x(\\sigma_z^2\\mu_p + \\sigma_p^2z) + (\\sigma_p^2z^2+\\sigma_z^2\\mu_p^2)]\\Big ]\n", "\\end{aligned}$$" ]