diff --git a/04-One-Dimensional-Kalman-Filters.ipynb b/04-One-Dimensional-Kalman-Filters.ipynb index 35a75c5..4086be2 100644 --- a/04-One-Dimensional-Kalman-Filters.ipynb +++ b/04-One-Dimensional-Kalman-Filters.ipynb @@ -454,7 +454,7 @@ { "data": { "text/plain": [ - "𝒩(μ=10.377, 𝜎²=0.037)" + "𝒩(μ=10.800, 𝜎²=0.008)" ] }, "execution_count": 10, @@ -472,7 +472,11 @@ " posterior = gaussian_multiply(likelihood, prior)\n", " return posterior\n", "\n", - "update(pos, move)" + "# test the update function\n", + "predicted_pos = gaussian(10., .2**2)\n", + "measured_pos = gaussian(11., .1**2)\n", + "estimated_pos = update(predicted_pos, measured_pos)\n", + "estimated_pos" ] }, { @@ -722,7 +726,7 @@ "x = gaussian(0., 20.**2) # dog's position, N(0, 20**2)\n", "velocity = 1\n", "dt = 1. # time step in seconds\n", - "process_model = gaussian(velocity, process_var) \n", + "process_model = gaussian(velocity*dt, process_var) # displacement to add to x\n", " \n", "# simulate dog and get measurements\n", "dog = DogSimulation(\n", @@ -934,7 +938,7 @@ "\n", "```python\n", "prior = predict(x, process_model)\n", - "likelihood = likelihood(z, sensor_var)\n", + "likelihood = gaussian(z, sensor_var)\n", "x = update(prior, likelihood)\n", "```\n", "\n", @@ -1286,7 +1290,7 @@ } ], "source": [ - "book_plots.plot_errorbars([(160, 8, 'A'), (170, 8, 'B')], xlims=(150, 180))" + "book_plots.plot_errorbars([(160, 3, 'A'), (170, 9, 'B')], xlims=(150, 180))" ] }, {