filterpy
filterpy copied to clipboard
Batch filter doesn't save initial values
Consider the typical workflow:
mu, cov, _, _ = kf.batch_filter(zs[1:], saver=saver)
rxs, Ps, Ks, pPs = kf.rts_smoother(mu, cov)
We have typically initialized the KF with the first measurement or 2 measurements (to get velocity). Hence we need to skip the first measurement. So len(mu) +1 = len(zs), and the rts smoother skips the first measurement.
You can get around this by setting zs[0] to None, and update_first=True, but then the final kf state is the prior of predicting past zs, which is not the end of the world, but not awesome either.
I'm not sure what I want here. A flag to just copy the initial x, P of the kf?