Merge pull request #248 from off99555/master

Several errors:

1. Update called with a move control input, which makes no sense.
2. velocity needed to be multiplied by dt, I was just lucky that dt = 1
3. Typo in code calling nonexistent function likelihood()
4. Fixed length of error bars to match subsequent text and code.
This commit is contained in:
Roger Labbe 2018-09-16 09:49:26 -07:00 committed by GitHub
commit fd03b1ddd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 5 deletions

View File

@ -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))"
]
},
{