Kalman-and-Bayesian-Filters.../mkf_internal.py
Roger Labbe 8305200ff0 A lot of changes. I think a lot of changes to the notebooks are just
due to running them. In the process of adding a bunch of new .py
scripts to support the book. Most important is the DiscreteBayes1D.py
class, which implements a Discrete Bayesian filter in a generalized way.
2014-05-02 21:49:35 -05:00

27 lines
950 B
Python

# -*- coding: utf-8 -*-
"""
Created on Thu May 1 16:56:49 2014
@author: rlabbe
"""
def show_residual_chart():
xlim([0.9,2.5]);ylim([0.5,2.5])
scatter ([1,2,2],[1,2,1.3])
scatter ([2],[1.8],marker='o')
ax = plt.axes()
ax.annotate('', xy=(2,2), xytext=(1,1),
arrowprops=dict(arrowstyle='->', ec='b',shrinkA=3, shrinkB=4))
ax.annotate('prediction', xy=(1.7,2), color='b')
ax.annotate('measurement', xy=(2.05, 1.28))
ax.annotate('prior measurement', xy=(1, 0.9))
ax.annotate('residual', xy=(2.04,1.6), color='r')
ax.annotate('new estimate', xy=(2,1.8),xytext=(2.15,1.9),
arrowprops=dict(arrowstyle='->', shrinkA=3, shrinkB=4))
ax.annotate('', xy=(2,2), xytext=(2,1.3),
arrowprops=dict(arrowstyle="<->",
ec="r",
shrinkA=5, shrinkB=5))
title("Kalman Filter Prediction Update Step")
show()