You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Doubling algorithm not working for solving discrete Lyapunov equation #568
For a specific example borrowed from RMT5 (example 3 in section 2.4), the doubling algorithm is unable to find the correct solution to the discrete Lyapunov equation while Bartels-Stewart algorithm (the scipy routine) is able to find one.
I have no knowledge about the theory, but the docstring says that "We assume in order for convergence that the eigenvalues of A have moduli bounded by unity". Your A matrix has some eigenvalues larger than one in magnitude:
It might be an implicit premise that it is the user's responsibility to switch between the methods depending on the eigenvalues of A.
Maybe rewrite the docstring to say something like, "the method "doubling" assumes that the eigenvalues of A ...", and "if this is not the case, use the method "bartels-stewart""?
Thanks @oyamad for your clear explanation. I guess the point is whether we intend to make this solve_discrete_lyapunov function only work for finding a "unique" solution, because having moduli bounded by one is not a necessary condition for the existence of the solution.
If we aim to make this general to use, then it might be burdensome to let users to check the eigenvalues each time before they call solve_discrete_lyapunov. Could we set the default method to be None and select one by checking the magnitudes of the eigenvalues inside the function?
But again, I am not sure about in what shape do we want method to be. For the purpose of economics research, having it work only with stable linear state models seems to be enough.
Activity
oyamad commentedon Jan 17, 2021
I have no knowledge about the theory, but the docstring says that "We assume in order for convergence that the eigenvalues of A have moduli bounded by unity". Your
Amatrix has some eigenvalues larger than one in magnitude:It might be an implicit premise that it is the user's responsibility to switch between the methods depending on the eigenvalues of
A.Maybe rewrite the docstring to say something like, "the method
"doubling"assumes that the eigenvalues ofA...", and "if this is not the case, use the method"bartels-stewart""?shizejin commentedon Jan 17, 2021
Thanks @oyamad for your clear explanation. I guess the point is whether we intend to make this
solve_discrete_lyapunovfunction only work for finding a "unique" solution, because having moduli bounded by one is not a necessary condition for the existence of the solution.If we aim to make this general to use, then it might be burdensome to let users to check the eigenvalues each time before they call
solve_discrete_lyapunov. Could we set the defaultmethodto beNoneand select one by checking the magnitudes of the eigenvalues inside the function?But again, I am not sure about in what shape do we want method to be. For the purpose of economics research, having it work only with stable linear state models seems to be enough.
rht commentedon Jan 18, 2021
Alternatively, if the method selected is
doubling, there could be an assertion on the eigenvalues condition before the solving algorithm starts.