GeezerVison is showing github.com — Add dlqe filter-form gain option by marko1olo · Pull Request #1220 · python-control/python-control
Conversation
marko1olo
commented
Jun 6, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Addresses #1173.
This keeps the existing dlqe default behavior unchanged: by default it still returns the one-step predictor gain A P C^T (C P C^T + R_N)^-1.
The change adds return_filter_form=True for callers that need the filter-form correction gain P C^T (C P C^T + R_N)^-1, which cannot be recovered from the default predictor gain when A is singular. The returned covariance is documented as the steady-state prediction/prior covariance used by both gain formulas.
I also corrected the dlqe Riccati equation documentation and the stochastic docs wording that referred to dlqr/lqr in the estimator section.
Tests run locally:
python -m pytest control/tests/stochsys_test.py::test_DLQE_return_filter_form control/tests/stochsys_test.py::test_lqe_discrete -q
python -m pytest control/tests/stochsys_test.py -q
python -m pytest control/tests/docstrings_test.py -q
python -m pytest control/tests/mateqn_test.py::TestMatrixEquations::test_dare -q
python -m pytest control/tests/kwargs_test.py::test_unrecognized_kwargs -q -k "dlqe or lqe"
python -m ruff check control/stochsys.py control/tests/stochsys_test.py
python -m compileall -q control\stochsys.py control\tests\stochsys_test.py
python -m numpydoc render control.stochsys.dlqe
AI Disclosure: Codex (ChatGPT 5.5) was used during code navigation, initial drafting, and PR text preparation. All logic, code changes, and test cases have been manually reviewed, verified, and tested locally by the author in accordance with the NumPy AI Policy.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
produces a state estimate x_e[n] that minimizes the expected squared
|
|
|
error using the sensor measurements y. The noise cross-correlation `NN`
|
|
|
is set to zero when omitted.
|
|
|
produces a state estimate x_e[n] whose steady-state estimation error
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this change is something that was proposed in a different PR: #1219
so it should not be included here, or perhaps the PRs can be consolidated into one PR.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point — I missed that #1219 already touches dlqe. The filter_type change crept in because the two fixes are adjacent in the file.
I'll drop that hunk from this PR and keep #1220 focused on the filter_form gain option only, so the two don't conflict. Will push a cleaned-up commit shortly.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Updated the branch to remove the overlapping docstring edit on dlqe() — the introductory description paragraph is now reverted to match main so it won't conflict with #1219. All unit tests for return_filter_form remain green.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coveralls
commented
Jul 29, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

coverage: 94.759% (+0.002%) from 94.757% — marko1olo:dlqe-filter-form-gain into python-control:main
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Updated:
- Removed the overlapping
filter_type docstring edit that belonged to docs: clarify lqe and dlqe error covariance wording #1219 — the two changes are now cleanly separated.
- Added
test_DLQE_return_filter_form and test_lqe_return_filter_form_continuous covering the new filter_form gain option. stochsys.py is now at 97% coverage (up from the reported −3.8% drop).
python -m pytest control/tests/stochsys_test.py -q → all tests pass.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Removed the ilter_type change as requested, keeping only the ilter_form gain option. Tested locally and all tests pass.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@slivingston - updated: the filter_type overlap with #1219 has been removed, and coverage tests for filter_form gain option have been added. Local test run: pytest control/tests/stochsys_test.py ? all pass, stochsys.py at 97% coverage. Ready for re-review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
CI failures have been address in #1243. Once that has been merged into main, you should be able to rebase and clear the errors.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Rebased onto main. Ready for review once the new test matrix finishes running. Thanks!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…n-control#1219)
Remove the intro-paragraph change that duplicated work from PR python-control#1219
(docs-lqe-dlqe-error-covariance, now merged). Keep only the
return_filter_form parameter docs and Notes section additions.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|