From e12352c5206b30325611dc91b3042f9ddf9a504f Mon Sep 17 00:00:00 2001 From: Roger Labbe Date: Tue, 15 Dec 2015 15:45:26 -0800 Subject: [PATCH] Fixed equation for total probability theorem. I was using the wrong subscript (i instead of j) in the sum. --- 02-Discrete-Bayes.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/02-Discrete-Bayes.ipynb b/02-Discrete-Bayes.ipynb index acb56e1..19c1f42 100644 --- a/02-Discrete-Bayes.ipynb +++ b/02-Discrete-Bayes.ipynb @@ -1731,9 +1731,9 @@ "source": [ "## Total Probability Theorem\n", "\n", - "We know now the formal mathematics behind the `update()` function; what about the `predict()` function? `predict()` implements the *total probability theorem*. Let's recall what `predict()` computed. It computed the probability of being at any given position given the probability of all the possible movement events. Let's express that as an equation. The probability of being at any position $i$ at time $t$ can be written as $P(X_i^t)$. We computed that as the sum of the prior at time $t-1$ $P(X_i^{t-1})$ multiplied by the probability of moving from cell $x_j$ to $x_i$. That is\n", + "We know now the formal mathematics behind the `update()` function; what about the `predict()` function? `predict()` implements the *total probability theorem*. Let's recall what `predict()` computed. It computed the probability of being at any given position given the probability of all the possible movement events. Let's express that as an equation. The probability of being at any position $i$ at time $t$ can be written as $P(X_i^t)$. We computed that as the sum of the prior at time $t-1$ $P(X_j^{t-1})$ multiplied by the probability of moving from cell $x_j$ to $x_i$. That is\n", "\n", - "$$P(X_i^t) = \\sum_j P(X_i^{t-1}) P(x_i | x_j)$$\n", + "$$P(X_i^t) = \\sum_j P(X_j^{t-1}) P(x_i | x_j)$$\n", "\n", "That equation is called the *total probability theorem*. Quoting from Wikipedia [6] \"It expresses the total probability of an outcome which can be realized via several distinct events\". I could have given you that equation and implemented `predict()`, but your chances of understanding why the equation works would be slim. As a reminder, here is the code that computes this equation\n", "\n",