FIX: ValueError LQMarkov convergence failed, Closes #508#550
FIX: ValueError LQMarkov convergence failed, Closes #508#550mmcky merged 5 commits intoQuantEcon:masterfrom
LQMarkov convergence failed, Closes #508#550Conversation
|
@bktaha can you update the QuantEcon.py/quantecon/lqcontrol.py Line 66 in 9d0fb5b |
|
Sure @oyamad. Thanks @bktaha, this is going to be a very meaningful improvement of the code. One minor point is that I agree with you that a test for this is not needed. |
|
Thanks @shizejin for the kind comments, and for reviewing this PR. As you suggested, I've moved the |
|
Thanks @bktaha for your quick response. The PR looks great to me except that I think the following way of breaking a line might be favorable: Ps = solve_discrete_riccati_system(Π, As, Bs, Cs, Qs, Rs, Ns, beta,
max_iter=max_iter)The difference between this and the previous version of your code is that one space before |
|
@mmcky I've made the suggested style fix. |
LQMarkov convergence failedLQMarkov convergence failed, Closes #508
Hi!
For #508 I noticed the solver method matrix_eqn.solve_discrete_riccati_system() allowed for setting an upper bound on the number of iterations, but the stationary_values() method of LQMarkov didn't make use of this arg so it threw an error if it failed to converge within the preset number of iterations, 1000.
I've added an optional arg to the LQMarkov init method to increase the upper bound on the number of iterations, and it was able to converge for the betas mentioned in #508 ( converged for 0.973 in 1001 iterations, for 0.974 in 1050 and for 0.99 in 2700 ).
I didn't add a test for this since this was a small enough change, but I can add it if needed.