我在使用时遇到了一个pykalman 0.9.5
问题Python 3.6.3
请参阅下面的代码,为什么结果来自kf2
和kf3
不同,而结果来自kf1
和kf3
相同?
kf2
和之间过程的区别kf3
在于我只是将迭代拆分为运行 2 次函数 for kf2
。
感谢大家调查它。
>>>pri_mean[:10]
array([ 2827.2222, 2829.6 , 2831. , 2832.1 , 2833.1 , 2835.3 , 2833.9 ,
2833.8 , 2833.6 , 2833. ])
>>>kf1 = KalmanFilter()
>>>kf1 = kf1.em(pri_mean, 10, em_vars='all')
>>>print(kf1.transition_matrices, kf1.transition_offsets, kf1.transition_covariance)
[[ 0.99741876]] [ 10.04426882] [[ 2896.92752373]]
>>>kf2 = kf1.em(pri_mean, 10, em_vars='all')
>>>print(kf2.transition_matrices, kf2.transition_offsets, kf2.transition_covariance)
[[ 0.99364606]] [ 20.02260806] [[ 2600.94151188]]
>>>kf3 = KalmanFilter()
>>>kf3 = kf3.em(pri_mean, 20, em_vars='all')
>>>print(kf3.transition_matrices, kf3.transition_offsets, kf3.transition_covariance)
[[ 0.99741876]] [ 10.04426882] [[ 2896.92752373]]