[], [] for k in numpy.arange(0, N): u, P = predict(u, P, F, Q) predictions.append(u) u, P = correct(u, A, b, P, Q, R) corrections.append(u) measurements.append(b) b = numpy.array([[u[0, 0] + randn(1)[0]], [u[1, 0] + randn(1)[0]]]) print 'predicted final estimate: %f' % predictions[-1][0] print 'corrected final estimate: %f' % corrections[-1][0] print 'measured state: %f' % measurements[-1][0] predicted final estimate: -23.417806 corrected final estimate: -22.995292 measured state: -22.720059