Skip to content

Add optional Kalman filter gain to dlqe - #1253

Closed
dongxuelian2 wants to merge 1 commit into
python-control:mainfrom
dongxuelian2:fix-dlqe-filter-form
Closed

dongxuelian2 wants to merge 1 commit into
python-control:mainfrom
dongxuelian2:fix-dlqe-filter-form

Conversation

@dongxuelian2

Copy link
Copy Markdown

dlqe currently returns the predictor gain, which cannot directly perform the current measurement update. Add return_filter_form=True to return the measurement-update gain while preserving the existing default and return tuple. This follows the option proposed in the discussion of #1173.

For the prior covariance P, the filter gain is M = P C.T (C P C.T + RN)^-1 and the predictor gain is L = A M. Compute M with a linear solve instead of recovering it by inverting A, so singular dynamics are supported. Both forms retain the prior covariance and the estimator poles of A (I - M C).

Forward the option and symmetry tolerances through lqe for discrete-time systems. Document the estimate timing, both gain forms, the discrete Riccati equation, and prior versus posterior covariance. Tests cover analytical scalar cases, singular and nonsingular MIMO dynamics, an independent Joseph-form covariance iteration, both solver backends, and the matrix/StateSpace APIs.

Validation:

  • Relevant estimator, Riccati, state-feedback, keyword, and docstring suites with SciPy and Slycot: 288 passed, 5 skipped, 2 xfailed.
  • Full non-slow test suite: 4371 passed, 51 skipped, 5 xfailed, 1 existing xpassed.
  • Relevant Sphinx doctests: 17 passed; HTML documentation built.
  • Ruff and git diff --check passed.

The complete slow suite was stopped during unrelated optimization tests after more than ten minutes; the relevant slow estimator tests passed.

AI assistance: OpenAI Codex generated the implementation, tests, documentation, and this PR description, and ran the checks.

Fixes #1173

@slivingston

Copy link
Copy Markdown
Member

Automated PR violates AI Policy

@slivingston slivingston closed this Oct 7, 2026
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.

dlqe should return Kalman filter gain rather than Kalman predictor gain

2 participants