-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Op
corresponding to scipy.linalg.solve_discrete_are
#417
Add Op
corresponding to scipy.linalg.solve_discrete_are
#417
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #417 +/- ##
==========================================
- Coverage 80.78% 80.77% -0.01%
==========================================
Files 156 156
Lines 45483 45571 +88
Branches 11139 11152 +13
==========================================
+ Hits 36742 36812 +70
- Misses 6532 6552 +20
+ Partials 2209 2207 -2
|
Change output type hint back to
Does the |
No. I guess it was left accidentally when the parametrized helper was implemented |
…tX Change output type hint back to
Motivation for these changes
Move
solve_discrete_are
frompymc_experimental/statespace/pytensor_scipy.py
to here.I also did a few cleanups in
tensor.slinalg.py
:is_complex_obj
solvetriangular
instance ofSolveTriangular
(theSolveTriangular
Op
is instead accessed through thesolve_triangular
wrapper function)Op
wrapper functions fromTensorVariable
toVariable
to appease the lintersolve_discrete_lyapunov
,solve_cotinuous_lyapunov
,solve_discrete_are
, andsolve_triangular
to__all__
, so there are no more "hidden functions" innlinalg
Implementation details
Op
is just a wrapper aroundscipy.linalg.solve_discrete_are
, with gradients taken from Kao and Hennequin (2020), https://arxiv.org/pdf/2011.11430.pdfThe use-case is solving matrix quadratic equations. It pops up in state space models (the steady state covariance matrix comes from the solution to such an equation). It can also be used to compute the policy function for Bellman equations with linear-quadratic loss function (also relevant to state space modeling).
Checklist
Major / Breaking Changes
New features
Bugfixes
Documentation
Maintenance