Added fixed lag section.

This commit is contained in:
Roger Labbe 2015-06-13 20:05:10 -07:00
parent d574383175
commit 1633d9cda9
2 changed files with 279 additions and 59 deletions

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,57 @@
# -*- coding: utf-8 -*-
"""
Created on Tue May 27 21:21:19 2014
@author: rlabbe
"""
from filterpy.kalman import UnscentedKalmanFilter as UKF
from filterpy.kalman import MerweScaledSigmaPoints
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse,Arrow
import math
import numpy as np
import stats
from stats import plot_covariance_ellipse
def show_fixed_lag_numberline():
fig = plt.figure()
ax = fig.add_subplot(111)
ax.set_xlim(0,10)
ax.set_ylim(0,10)
# draw lines
xmin = 1
xmax = 9
y = 5
height = 1
plt.hlines(y, xmin, xmax)
plt.vlines(xmin, y - height / 2., y + height / 2.)
plt.vlines(4.5, y - height / 2., y + height / 2.)
plt.vlines(6, y - height / 2., y + height / 2.)
plt.vlines(xmax, y - height / 2., y + height / 2.)
plt.vlines(xmax-1, y - height / 2., y + height / 2.)
# add numbers
plt.text(xmin, y-1.1, '$x_0$', fontsize=20, horizontalalignment='center')
plt.text(xmax, y-1.1, '$x_k$', fontsize=20, horizontalalignment='center')
plt.text(xmax-1, y-1.1, '$x_{k-1}$', fontsize=20, horizontalalignment='center')
plt.text(4.5, y-1.1, '$x_{k-N+1}$', fontsize=20, horizontalalignment='center')
plt.text(6, y-1.1, '$x_{k-N+2}$', fontsize=20, horizontalalignment='center')
plt.text(2.7, y-1.1, '.....', fontsize=20, horizontalalignment='center')
plt.text(7.2, y-1.1, '.....', fontsize=20, horizontalalignment='center')
plt.axis('off')
plt.show()
if __name__ == '__main__':
#show_2d_transform()
#show_sigma_selections()
show_sigma_transform(True)
#show_four_gps()
#show_sigma_transform()
#show_sigma_selections()