GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add dlqe filter-form gain option by marko1olo · Pull Request #1220 · python-control/python-control

Conversation

@marko1olo

@marko1olo marko1olo commented Jun 6, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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.

All reactions
slivingston
slivingston requested changes Jun 17, 2026
View reviewed changes
Comment thread control/stochsys.py Outdated
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

@slivingston slivingston Jun 17, 2026

Copy link
Copy Markdown
Member

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.

All reactions

@marko1olo marko1olo Jul 29, 2026

Copy link
Copy Markdown
Author

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.

All reactions
@marko1olo

marko1olo commented Jul 29, 2026

Copy link
Copy Markdown
Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coveralls

coveralls commented Jul 29, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Coverage Status

coverage: 94.759% (+0.002%) from 94.757% — marko1olo:dlqe-filter-form-gain into python-control:main

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@marko1olo

marko1olo commented Aug 1, 2026

Copy link
Copy Markdown
Author

Updated:

  1. 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.
  2. 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@marko1olo

marko1olo commented Aug 1, 2026

Copy link
Copy Markdown
Author

Removed the ilter_type change as requested, keeping only the ilter_form gain option. Tested locally and all tests pass.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@marko1olo

marko1olo commented Aug 1, 2026

Copy link
Copy Markdown
Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@murrayrm

murrayrm commented Aug 9, 2026

Copy link
Copy Markdown
Member

CI failures have been address in #1243. Once that has been merged into main, you should be able to rebase and clear the errors.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@marko1olo
Add dlqe filter-form gain option
51b5298
@marko1olo

marko1olo commented Aug 14, 2026

Copy link
Copy Markdown
Author

Rebased onto main. Ready for review once the new test matrix finishes running. Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Петушков А. and others added 3 commits August 16, 2026 16:17
@marko1olo
test(dlqe): add atol=1e-12 to eigenvalue comparison for zero-eigenval…
6f14b6f
…ue tolerance
@marko1olo
test(dlqe): add atol=1e-12 to E_filter eigenvalue assertion for numer…
1c0262b
…ical zero tolerance
@marko1olo
docs(dlqe): revert overlapping intro-paragraph edit (already in pytho…
5a6a19c
…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.
@slivingston slivingston closed this Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@slivingston slivingston slivingston requested changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

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.

4 participants

@marko1olo @coveralls @murrayrm @slivingston
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.