Skip to content

Conversation

@mrcfon
Copy link

@mrcfon mrcfon commented May 15, 2024

This PR adds the following classes:

  • IPLFKalmanUpdater, iterated posterior linearisation filter.
  • slr_definition, statistical linear regression function.
  • GeneralLinearGaussian measurement model that consumes explicitly specified transition matrix and bias.

The Iterated Posterior Linearization FIlter (IPLF) described in [1] is obtained by iteratively linearising the measurement function using statistical linear regression (SLR) with respect to the posterior (rather than the prior), to take into account the information provided by the measurement.

A running example can be found here.

[1] Á. F. García-Fernández, L. Svensson, M. R. Morelande and S. Särkkä, "Posterior Linearization Filter: Principles and Implementation Using Sigma Points," in IEEE Transactions on Signal Processing, vol. 63, no. 20, pp. 5561-5573, Oct.15, 2015, doi: 10.1109/TSP.2015.2454485.

@mrcfon mrcfon requested a review from a team as a code owner May 15, 2024 13:35
@mrcfon mrcfon requested review from akenyon and sdhiscocks and removed request for a team May 15, 2024 13:35
Copy link
Member

@sdhiscocks sdhiscocks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good.
Doc strings need improving in places, minor formatting; but main thing is some suggestions (not tested) to avoid creating lots of new updater instances.

narykov and others added 5 commits July 1, 2024 19:41
a) inherit from LinearGaussian, rather than being its sibling class
b) be true generalisation of LinearGaussian, i.e., generating the measurement matrix either based on the 'mapping' specification or using the explicitly specified measurement matrix
a) added the docstring and updated the comments
b) included a user-specified function that may be useful to deal with issues due to angle wrapping
c) replaced np.linalg.inv with np.linalg.pinv
d) minor style corrections, e.g., around @
…ugmentedGaussianMeasurementPrediction) to preserve the info about the model used to produce a measurement prediction
a) included explicit specification of the slr_func, should an alternative definition be required
b) homogenised the iterations such that the first iteration is not performed separately as an UKF update
c) switched from the 'while' loop to the 'for' loop for improved clarity
d) removed re-definition of the measurement model in hypothesis.measurement, which then cancelled the need to save/recover the hypothesis, as no info is manipulated -- except for adding/updating a measurement prediction
e) included re-definition of the measurement prediction through a custom class (AugmentedGaussianMeasurementPrediction), such that the linearised model and its parameters could be preserved (an outlook for smoothing)
@codecov
Copy link

codecov bot commented Jul 2, 2024

Codecov Report

Attention: Patch coverage is 83.20000% with 21 lines in your changes missing coverage. Please review.

Project coverage is 93.50%. Comparing base (0089d29) to head (4fefc89).
Report is 412 commits behind head on main.

Files with missing lines Patch % Lines
stonesoup/models/measurement/linear.py 65.78% 6 Missing and 7 partials ⚠️
stonesoup/functions/__init__.py 91.42% 1 Missing and 2 partials ⚠️
stonesoup/updater/iterated.py 90.90% 0 Missing and 3 partials ⚠️
stonesoup/types/prediction.py 81.81% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1016      +/-   ##
==========================================
- Coverage   93.61%   93.50%   -0.12%     
==========================================
  Files         203      203              
  Lines       13051    13141      +90     
  Branches     2666     2684      +18     
==========================================
+ Hits        12218    12287      +69     
- Misses        588      596       +8     
- Partials      245      258      +13     
Flag Coverage Δ
integration 65.84% <45.60%> (-0.21%) ⬇️
unittests 89.14% <83.20%> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants