本文整理汇总了Python中filterpy.kalman.KalmanFilter.test_matrix_dimensions方法的典型用法代码示例。如果您正苦于以下问题:Python KalmanFilter.test_matrix_dimensions方法的具体用法?Python KalmanFilter.test_matrix_dimensions怎么用?Python KalmanFilter.test_matrix_dimensions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类filterpy.kalman.KalmanFilter
的用法示例。
在下文中一共展示了KalmanFilter.test_matrix_dimensions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_procedural_batch_filter
# 需要导入模块: from filterpy.kalman import KalmanFilter [as 别名]
# 或者: from filterpy.kalman.KalmanFilter import test_matrix_dimensions [as 别名]
def test_procedural_batch_filter():
f = KalmanFilter (dim_x=2, dim_z=1)
f.x = np.array([2., 0])
f.F = np.array([[1.,1.],
[0.,1.]])
f.H = np.array([[1.,0.]])
f.P = np.eye(2)*1000.
f.R = np.eye(1)*5
f.Q = Q_discrete_white_noise(2, 1., 0.0001)
f.test_matrix_dimensions()
x = np.array([2., 0])
F = np.array([[1.,1.],
[0.,1.]])
H = np.array([[1., 0.]])
P = np.eye(2)*1000.
R = np.eye(1)*5
Q = Q_discrete_white_noise(2, 1., 0.0001)
zs = [13., None, 1., 2.]*10
m,c,_,_ = f.batch_filter(zs,update_first=False)
n = len(zs)
# test both list of matrices, and single matrix forms
mp, cp, _, _ = batch_filter(x, P, zs, F, Q, [H]*n, R)
for x1, x2 in zip(m, mp):
assert np.allclose(x1, x2)
for p1, p2 in zip(c, cp):
assert np.allclose(p1, p2)