Skip to content

Test the scalar position Kalman filter against hand calculations - #279

Merged
ShisatoYano merged 1 commit into
ShisatoYano:mainfrom
zdu881:test/1d-kalman-filter-steps
Nov 24, 2026
Merged

ShisatoYano merged 1 commit into
ShisatoYano:mainfrom
zdu881:test/1d-kalman-filter-steps

Conversation

@zdu881

@zdu881 zdu881 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #274. Part of #103.

I added five deterministic cases for the scalar position filter. A half-second prediction checks the time scaling of velocity noise. Two observation variances give gains of 0.99 and 0.01 for the same predicted variance. Two signed innovations check the corrected position and posterior variance through estimate_position.

How I checked it works

  • pytest -q test/test_kalman_filter_1d_steps.py — 5 passed.
  • . run_test_suites.sh — 135 passed on Linux with Python 3.10.12.
  • In temporary copies, I changed the variance increment from dt² to dt, used observation variance in the gain numerator, and reversed the position correction sign. The new tests failed for each change.

Images

Tests only.

Book

  • This PR doesn't change code that the book describes.

@ShisatoYano

Copy link
Copy Markdown
Owner

Thanks for picking this up so quickly, @zdu881! The CI runs of a first-time contributor need my approval, so they'll start after a quick look. I'll review the tests within a few days.

@ShisatoYano
ShisatoYano merged commit 53d14a4 into ShisatoYano:main Nov 24, 2026
4 checks passed
@ShisatoYano ShisatoYano added the announce Candidate for a project update announcement label Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

announce Candidate for a project update announcement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unit tests: each step of the 1D Kalman filter

2 participants