-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Fixes for examples and solutions notebook #183
Conversation
@cc7768 Any ideas why Traceback (most recent call last):
File "robust_monopolist.py", line 130, in <module>
Po, Fo, do = optimal_lq.stationary_values()
File "/home/matthewmckay/anaconda/lib/python2.7/site-packages/quantecon/lqcontrol.py", line 209, in stationary_values
P = solve_discrete_riccati(A0, B0, R, Q, N)
File "/home/matthewmckay/anaconda/lib/python2.7/site-packages/quantecon/matrix_eqn.py", line 197, in solve_discrete_riccati
raise ValueError(fail_msg.format(i))
ValueError: Convergence failed after 501 iterations. |
@mmcky I looked around, but nothing changed within that file should break it -- At some point we may have changed the order of arguments for Notice:
This may have been on purpose; I don't remember whether Q and R are the same in |
@cc7768 That is a little odd. I had a quick look into this and tried swapping them but then you get a Traceback (most recent call last):
File "examples/robust_monopolist.py", line 130, in <module>
Po, Fo, do = optimal_lq.stationary_values()
File "/home/matthewmckay/anaconda/lib/python2.7/site-packages/quantecon/lqcontrol.py", line 209, in stationary_values
P = solve_discrete_riccati(A0, B0, Q, R, N)
File "/home/matthewmckay/anaconda/lib/python2.7/site-packages/quantecon/matrix_eqn.py", line 166, in solve_discrete_riccati
Q_tilde = - Q + dot(N.T, solve(Z, N + gamma * BTA)) + gamma * I
File "/home/matthewmckay/anaconda/lib/python2.7/site-packages/numpy/linalg/linalg.py", line 381, in solve
r = gufunc(a, b, signature=signature, extobj=extobj)
File "/home/matthewmckay/anaconda/lib/python2.7/site-packages/numpy/linalg/linalg.py", line 90, in _raise_linalgerror_singular
raise LinAlgError("Singular matrix")
numpy.linalg.linalg.LinAlgError: Singular matrix |
Introduced dimension checking on input for |
With only one example left to fix |
@mmcky Many thanks. |
Fixes for examples and solutions notebook
This branch is applying fixes for broken
examples
andsolutions
notebooks.Broken
examples/paths_and_hist.py
examples/robust_monopolist.oy
examples/lakemodel_example.py
solutions/lakemodel_solutions.ipynb
Fixed
examples/lakemodel_example.py
=> Addedlakemodel.py
to quantecon library for use by this example and the related solutions notebook.solutions/lakemodel_solutions.ipynb
=> Same as above.In addition this PR improves the reporting on the command line.