From 3ce1de7213a93ecf5e87d19757e506093a43c758 Mon Sep 17 00:00:00 2001 From: rummanwaqar Date: Sun, 16 Dec 2018 15:20:24 -0700 Subject: [PATCH 1/2] Bug fix: definition of expected value Closes #268 --- 03-Gaussians.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/03-Gaussians.ipynb b/03-Gaussians.ipynb index 75ca3ab6..35b7d2e7 100644 --- a/03-Gaussians.ipynb +++ b/03-Gaussians.ipynb @@ -313,7 +313,7 @@ "\n", "If $x$ is continuous we substitute the sum for an integral, like so\n", "\n", - "$$\\mathbb E[X] = \\int_{a}^b\\, f(x) \\,dx$$\n", + "$$\\mathbb E[X] = \\int_{a}^b\\, xf(x) \\,dx$$\n", "\n", "where $f(x)$ is the probability distribution function of $x$. We won't be using this equation yet, but we will be using it in the next chapter.\n", "\n", @@ -826,7 +826,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "This curve is a [*probability density function*](https://en.wikipedia.org/wiki/Probability_density_function) or *pdf* for short. It shows the relative likelihood for the random variable to take on a value. We can tell from the chart student is somewhat more likely to have a height near 1.8 m than 1.7 m, and far more likely to have a height of 1.9 m vs 1.4 m. Put another way, many students will have a height near 1.8 m, and very few students will have a height of 1.4 m or 1.9 meaters. Finally, notice that the curve is centered over the mean of 1.8 m.\n", + "This curve is a [*probability density function*](https://en.wikipedia.org/wiki/Probability_density_function) or *pdf* for short. It shows the relative likelihood for the random variable to take on a value. We can tell from the chart student is somewhat more likely to have a height near 1.8 m than 1.7 m, and far more likely to have a height of 1.9 m vs 1.4 m. Put another way, many students will have a height near 1.8 m, and very few students will have a height of 1.4 m or 2.2 meters. Finally, notice that the curve is centered over the mean of 1.8 m.\n", "\n", "> I explain how to plot Gaussians, and much more, in the Notebook *Computing_and_Plotting_PDFs* in the \n", "Supporting_Notebooks folder. You can read it online [here](https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/blob/master/Supporting_Notebooks/Computing_and_plotting_PDFs.ipynb) [1].\n", From 423c82e3fcda0719438c81ecaba3070fa6b94538 Mon Sep 17 00:00:00 2001 From: rummanwaqar Date: Tue, 18 Dec 2018 00:10:54 -0700 Subject: [PATCH 2/2] Bug fix: Incorrect equation for product of Gaussian Closes #234 --- 04-One-Dimensional-Kalman-Filters.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/04-One-Dimensional-Kalman-Filters.ipynb b/04-One-Dimensional-Kalman-Filters.ipynb index 462d4f7d..440901e0 100644 --- a/04-One-Dimensional-Kalman-Filters.ipynb +++ b/04-One-Dimensional-Kalman-Filters.ipynb @@ -460,7 +460,7 @@ "\n", "$$\\begin{aligned}\n", "\\mathcal N(\\mu, \\sigma^2) &= \\| prior \\cdot likelihood \\|\\\\\n", - "&=\\mathcal{N}(\\bar\\mu, \\bar\\sigma^2)\\cdot \\mathcal{N}(\\mu_z, \\sigma_z^2) \\\\\n", + "&= \\| \\mathcal{N}(\\bar\\mu, \\bar\\sigma^2)\\cdot \\mathcal{N}(\\mu_z, \\sigma_z^2) \\|\\\\\n", "&= \\mathcal N(\\frac{\\bar\\sigma^2 \\mu_z + \\sigma_z^2 \\bar\\mu}{\\bar\\sigma^2 + \\sigma_z^2},\\frac{\\bar\\sigma^2\\sigma_z^2}{\\bar\\sigma^2 + \\sigma_z^2})\n", "\\end{aligned}$$\n", "\n",