diff --git a/01_g-h_filter.ipynb b/01_g-h_filter.ipynb index d61ddf7..2c283e1 100644 --- a/01_g-h_filter.ipynb +++ b/01_g-h_filter.ipynb @@ -744,7 +744,7 @@ "source": [ "Now let's try a randomly chosen number to scale our estimate: $\\frac{4}{10}$. Our estimate will be four tenths the measurement and the rest will be from the prediction. In other words, we are expressing a belief here, a belief that the prediction is somewhat more likely to be correct than the measurement. We compute that as\n", "\n", - "$$ new estimate = prediction + \\frac{4}{10}(measurement - prediction)\n", + "$$ new\\_estimate = prediction + \\frac{4}{10}(measurement - prediction)\n", "$$\n", "\n", "The difference between the measurement and prediction is called the *residual*, which is depicted by the black vertical line in the plot above. This will become an important value to use later on, as it is an exact computation of the difference between measurements and the filter's output. Smaller residuals imply better performance.\n", @@ -1962,6 +1962,7 @@ "Near the beginning of the chapter I used `numpy.polyfit()` to fit a straight line to the weight measurements. It fits a n-th degree polynomial to the data using a 'least squared fit'. How does this differ from the g-h filter?\n", "\n", "Well, it depends. We will eventually learn that the Kalman filter is optimal from a least squared fit perspective under certain conditions. However, `polyfit()` fits a polynomial to the data, not an arbitrary curve, by minimizing the value of this formula:\n", + "\n", "$$E = \\sum_{j=0}^k |p(x_j) - y_j|^2$$\n", "\n", "I assumed that my weight gain was constant at 1 lb/day, and so when I tried to fit a polynomial of $n=1$, which is a line, the result very closely matched the actual weight gain. But, of course, no one consistently only gains or loses weight. We fluctuate. Using 'polyfit()' for a longer series of data would yield poor results. In contrast, the g-h filter reacts to changes in the rate - the $h$ term controls how quickly the filter reacts to these changes. If we gain weight, hold steady for awhile, then lose weight, the filter will track that change automatically. 'polyfit()' would not be able to do that unless the gain and loss could be well represented by a polynomial.\n",