Repository navigation
FIX: raise instead of returning non-finite values when the Riccati iteration overflows - #990
Open
mayuriphad wants to merge 1 commit into
Open
mayuriphad wants to merge 1 commit into
mayuriphad wants to merge 1 commit into
Conversation
…eration overflows (QuantEcon#986) Signed-off-by: mayuriphad <mayuriphad656@gmail.com>
Contributor
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
Thanks for the pull request, @mayuriphad! QuantEcon welcomes AI-assisted contributions under its Code of AI Use. Every pull request carries one
This comment is posted on every external pull request that arrives without the line, so it is not a flag on yours. Nothing is blocked; a maintainer reads the reply. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #986
solve_discrete_riccati_systemloopswhile error > tolerance. When the iterates overflow,errorbecomesnan, andnan > toleranceisFalse. The loop then exits as if it had converged and returns non-finitePs. Callers such asLQMarkov.stationary_valuesfail later with SciPy'sarray must not contain infs or NaNs, and the solver's own failure message (with thebeta >= 1stabilizability hint) is never raised. The doubling solversolve_discrete_riccati, used byLQandKalman, exits the same way.Both loops now raise the existing
fail_msgas soon as the error is not finite. The check adds no arithmetic, so runs that converge are unchanged.Tests:
test_solve_discrete_riccati_system_overflow_raisesandtest_solve_discrete_riccati_overflow_raises, both using the unstabilizable systemx' = 2x, B = 0from the issue. Both fail onmain(noValueError) and pass with this change.test_matrix_eqn,test_lqcontrol,test_ricatti,test_kalman,test_robustlqandtest_lqnash: 47 passed.Note: #984 changes the update inside the system solver's loop but not its exit condition. The new check sits just after the error sum, so any conflict between the two PRs should be trivial.