probnum
probnum copied to clipboard
KalmanPosterior refactoring
The KalmanPosterior -- as useful as it is already -- needs a few updates.
- [ ] It should be assembled on the fly (see #301 )
- [x] It needs to store predicted RVs (i.e. the filter posterior) and smoothing gains, not only to make sampling and interpolation cheaper, but also to fix a nasty sampling bug. I think it makes sense to not have the
with_smoothingflag anymore, but instead populate different lists (e.g.filt_post_rvs,smoo_post_rvs, etc.) which can then be accessed accordingly. This may also simplify the preconditioning setup even more. - [x] Extrapolation beyond the time points needs no warning
- [ ] backwards extrapolation (lower than self.locations[0]) should not throw an error, but "predict backwards")
- [ ] It needs a test that asserts that the sample variance matches the marginal variance (this would have unvealed a few of the issues in the past). I tried this in #305 but it turned out that it is very expensive, so I deleted the code again. Ideas are welcome here :)
Related to #271
I suppose the easiest solution is to give the KalmanPosterior a field filter_posterior (default to None), which in the case of the smoothing posterior, can hold the filtering posterior (and all its callability, etc.) and refer to this guy when needed (e.g. for sampling).
Partially fixed in #317