diff --git a/01-g-h-filter.ipynb b/01-g-h-filter.ipynb index 466ff7d..84a8b45 100644 --- a/01-g-h-filter.ipynb +++ b/01-g-h-filter.ipynb @@ -1437,7 +1437,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "That is pretty good! There is a lot of data here, so let's talk about how to interpret it. The thick blue line shows the estimate from the filter. It starts at day 0 with the initial guess of 160 lbs. The red line shows the prediction that is made from the previous day's weight. So, on day one the previous weight was 160 lbs, the weight gain is 1 lb, and so the first prediction is 161 lbs. The estimate on day one is then part way between the prediction and measurement at 159.8 lbs. Above the chart is a print out of the previous weight, predicted weight, and new estimate for each day. Finally, the thin black line shows the actual weight gain of the person being weighed. \n", + "That is pretty good! There is a lot of data here, so let's talk about how to interpret it. The thick blue line shows the estimate from the filter. It starts at day 0 with the initial guess of 160 lbs. The red line shows the prediction that is made from the previous day's weight. So, on day one the previous weight was 160 lbs, the weight gain is 1 lb, and so the first prediction is 161 lbs. The estimate on day one is then part way between the prediction and measurement at 159.8 lbs. Below the chart is a print out of the previous weight, predicted weight, and new estimate for each day. Finally, the thin black line shows the actual weight gain of the person being weighed. \n", "\n", "The estimates are not a straight line, but they are straighter than the measurements and somewhat close to the trend line we created. Also, it seems to get better over time. \n", "\n", @@ -3048,7 +3048,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Back to filtering. The results of the filter may strike you as quite silly; of course the data will look good if we assume the conclusion, that our weight gain is around 1 lb/day! Let's see what the filter does if our initial guess is bad. Let's predict that there is a weight loss of 1 lb a day" + "Back to filtering. The results of the filter may strike you as quite silly; of course the data will look good if we assume the conclusion, that our weight gain is around 1 lb/day! Let's see what the filter does if our initial guess is bad. Let's predict that there is a weight loss of 1 lb a day:" ] }, { @@ -4785,7 +4785,7 @@ "\n", "I use NumPy's array data structure throughout the book, so let's learn about them now. I will teach you enough to get started; refer to NumPy's documentation if you want to become an expert.\n", "\n", - "`numpy.array` implements a one or more dimensional array. Its type is `numpy.ndarray`, and we will refer to this as an ndarray for short. You can construct it with any list like object. The following constructs a 1-D array from a list:" + "`numpy.array` implements a one or more dimensional array. Its type is `numpy.ndarray`, and we will refer to this as an ndarray for short. You can construct it with any list-like object. The following constructs a 1-D array from a list:" ] }, { diff --git a/code/book_plots.py b/code/book_plots.py index ddc2a02..edceeb0 100644 --- a/code/book_plots.py +++ b/code/book_plots.py @@ -236,7 +236,7 @@ def plot_estimate_chart_3(): arrowprops=dict(arrowstyle='-', ec='k', lw=3, shrinkA=8, shrinkB=8)) - est_y = ((164.2-158)*.8 + 158) + est_y = (158 + .4*(164.2-158)) plt.scatter ([0,1], [158.0,est_y], c='k',s=128) plt.scatter ([1], [164.2], c='b',s=128) plt.scatter ([1], [159], c='r', s=128) diff --git a/figs/gh_estimate3.png b/figs/gh_estimate3.png index 83b36b8..677a531 100644 Binary files a/figs/gh_estimate3.png and b/figs/gh_estimate3.png differ