Open ehofm opened 5 years ago
Sorry for the late reply. I think we are talking about this line of code. Note that the app calls predict()
followed by update()
at each time step.
track.covariance
contains the posterior covariance P_{k - 1}
.predict()
, track.covariance
contains the predicted covariance P_{k|k-1}
.update()
, track.covariance
contains the posterior covariance P_k
.If you carefully trace the code, you'll find that the Kalman filter update does indeed work as your equation suggests. I hope this helps.
In the code, covariance (P_{k-1}) is being used to calculate newcovariance (P{k}) rather than projectedcovariance (P{k|k-1}). However, in the formulation for the Kalman Filter as shown below, projected_covariance is used to calculate new_covariance:
The same is found in the calculation of Kalman gain. Can you shed light as to why this is?