probnum icon indicating copy to clipboard operation
probnum copied to clipboard

KalmanPosterior refactoring

Open pnkraemer opened this issue 5 years ago • 3 comments

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_smoothing flag 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 :)

pnkraemer avatar Jan 31 '21 09:01 pnkraemer

Related to #271

pnkraemer avatar Feb 01 '21 13:02 pnkraemer

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).

pnkraemer avatar Feb 11 '21 08:02 pnkraemer

Partially fixed in #317

pnkraemer avatar Feb 12 '21 13:02 pnkraemer