Skip to content
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

Error resulting from DiscreteDP? #481

Closed
natashawatkins opened this issue Apr 11, 2019 · 4 comments · Fixed by #482
Closed

Error resulting from DiscreteDP? #481

natashawatkins opened this issue Apr 11, 2019 · 4 comments · Fixed by #482
Assignees
Labels

Comments

@natashawatkins
Copy link
Member

I get the following error in this notebook: https://lectures.quantecon.org/py/discrete_dp.html

image

@natashawatkins
Copy link
Member Author

natashawatkins commented Apr 11, 2019

@jstac
Copy link
Contributor

jstac commented Apr 11, 2019

Confirmed. I get the same error running locally with Anaconda 3.7 and SciPy version 1.1.0.

@oyamad Have you seen this?

CC @QBatista

@oyamad
Copy link
Member

oyamad commented Apr 12, 2019

It seems that this bug realizes as a real bug thanks to e265b25.

Compare

>>> import scipy.sparse
>>> scipy.sparse.linalg
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'scipy.sparse' has no attribute 'linalg'

and

>>> import scipy.sparse
>>> import scipy.signal
>>> scipy.sparse.linalg
<module 'scipy.sparse.linalg' from '/Applications/anaconda/lib/python3.7/site-packages/scipy/sparse/linalg/__init__.py'>

@oyamad oyamad self-assigned this Apr 12, 2019
oyamad added a commit that referenced this issue Apr 12, 2019
@oyamad
Copy link
Member

oyamad commented Apr 20, 2019

This should work now with master.

daniel-schaefer added a commit to daniel-schaefer/QuantEcon.py that referenced this issue Oct 16, 2019
* Added basic inequality mesasures: lorenz curve and gini

Tests added, passed nosetests

* Add jitted newton methods for root finding

Based on Scipy's newton methods, we add two variants of newton root
finding - Newton Raphson and secant method. All methods are jitted
through Numba with nopython mode. Relevant information (apart from the
root) is also returned in the result as python namedtuple since Numba
supports it.

* Add test cases for newton methods

* Add newton halley method and modify returning

The third and last newton method for root finding is now added with its
test cases. Each newton method is modified to include only a single
return statement.

* EHN: Add `qhull_options` to `game_theory.vertex_enumeration`

* Add bisection and brent's method for root finding

I added two jitted robust root finding methods: Bisection and Brentq
which are based on Scipy's version which is written in C. They both
follow the previous jitted root finding procedures by returning a
namedtuple with relevant information.

I also added a basic test for each method.

* Fix import to list items

* Add default args in docstring and Format code

I have included optional default arguments in the docstring of all
functions.

All trailing whitespaces are now fixed conforming to PEP8. The check is
done via pycodestyle and http://pep8online.com/.

* initial commit of dle code from Sebastian Graves

* adjustments for package

* update to new rtd requirements spec

* add reference to environment spec

* test use of pip requirements file instead of conda

* remove old yml config for rtd-environment, consolidate on pip-requirements for now

* DOC: Add doc entry for root_finding

* increment version to 0.4.0

* updating auto-generated CHANGELOG

* add v0.4.0 summary to README

* fix badge link for RTD

* update code with docstrings

* remove pylab imports

* move from pylab Matrix to np.matrix

* update to use nullspace from quantecon

* correct algebra for use of quantecon nullspace method

* Add LGTM.com code quality badges

* add test for transformation of problem to LQ type problem using known solutions verified by matlab programs

* reduce line lengths in docstrings

* revert use of quantecon nullspace as representations are not exactly the same ... need to investigate

* migrate to using quantecon nullspace method

* fix test for steadystate

* add atol for comparing small values

* add test for canonical

* add dle to documentation

* DOC: Fix the doc of `root_finding.py` to display nicely

* Release of version 0.4.1

* Add AS algorithm.

* FIX: Force tuple elements to have the same dtype

Fix QuantEcon#434

* Remove `from future import ...`

*  Add method option in robustlq.py

* Modify variable names.

* Modify `intersection` and `find_C`.

* Incorporate with `RepeatedGame` class.

* Compare vertex values in the test.

* Changed gini from class to function to simplify the use of numba

* fix docstring of x_hat in Kalman class

* Add docstrings.

* Fix issue#367

* revise 'Fix issue#367'

* Revise 'Fix QuantEcon#367' again

* Revise 'Fix issue#367' again

* Change docs to reflect changes from object to function

* fix brent_max docstring

* FEAT: Add Nelder-Mead algorithm

- Jitting is commented out for generating coverage report

* Uncomment `@njit`

* FIX: Disallow 0 actions

* FIX: is_dominated: Return False if num_actions == 1

* Add Player.delete_action

* Add NormalFormGame.delete_action

* FIX: solve the bug of cached keyword `u`.

* Minor fixes

* Modify docstrings.

* FIX: change keyword 'u' to 'u_init' in test.

* FIX: minor modifications.

* Use `equilibrium_payoffs` interface.

* FIX: minor modification of docstrings.

* Minor modifications of docstrings.

* Modification of `_best_dev_gains`.

* Release version 0.4.2

* update CHANGELOG for 0.4.2 release

* FIX: test `method` keyword of `RepeatedGame.equilibrium_payoffs()`.

* Add Shorrock inequality index

* add mobility to description

* add docs

* Travis: Add macOS to the build matrix

* Travis: Add miniconda cache

* TestTicTacToc: Skip test_loop and test_timer for darwin

* Add error for invalid inputs

* Fix warning in test_pure_nash

* README: Update coveralls badge to use svg

* update documentation

* update RST in nelder mead docstring

* tests/util: Remove old merge resolution

* fix docstring in inequality

* update to use inline math

* fix typo

* restore to initial displaymath

* Travis: Move dependency installs with wheels available to pip

* Travis: Remove miniconda cache

* Travis: Move statsmodels to pip

* Travis: Move pytables to pip since it requires numpy

* discrete_rv: Remove unused import

* Isolate rtd-specific requirements to doc-requirements.txt

* fix inequality docs

* add raw flag

* quad: Import sympy only when necessary

* util.notebooks: Import requests only when necessary

* pip-requirements: Remove unused statsmodels import

* Travis: Disable performance tests

They should be run only from time to time, e.g. between releases, or
when the commit specifically states the perf modification of the
relevant code.

* random.utilities: Cache guvectorize

* quantecon.arma: Import scipy.signal functions only when necessary

* fix for lorenz documentation

* add matplotlib import

* remove matplotlib

* Release for version 0.4.3

* Update generated CHANGELOG for 0.4.3

* quantecon/tests: Fix F401 unused imports

* quantecon/util: Fix F401 unused imports

* quantecon/markov: Fix F401 unused imports

* quantecon.arma: Fix F401 unused imports

* quantecon/optimize: Fix F401 unused imports

* quantecon/game_theory: Fix F401 unused imports

* Disable flake8 on __init__.py files

* Travis: Do F401 check before running the tests

* TEST: Fix the names of tests for `brent_max`

* DOC: Update example for `nelder_mead`

* Apply `autopep8 -ir --select E501 quantecon/util`

* Fix all E231 errors

* Travis: Add E231 check

* Apply `autopep8 -ir --select E501 quantecon`

* Fix all F405 error and check on Travis

* Fix some of F841 errors

* lss: Fix formatting of a ValueError

* add matplotlib to environment

* specify matplotlib lts release

* fix syntax

* Delete the unnecessary assignment in quantecon/estepec.py

* Delete the unnecessary assignment in quantecon/compute_fp.py

* Delete the unnecessary assignment in quantecon/repeated_game.py

* FIX: Raise correct error when `A` is not square in `LinearStateSpace`

* Add random_pure_actions and random_mixed_actions and related tests.

* Fix `sample_without_replacement` using guvectorize

* FIX: Import scipy.sparse.linalg

Fix QuantEcon#481

* Add drift term keyword to `markov.tauchen`.

* Release of version 0.4.4

* FIX: DOC: Remove `matplotlib.sphinxext.only_directives`

* FIX: DOC: Fix Examples section in `brent_max`

* TRAVIS: Set coverage branch.

* increase `tol` in `rouwenhorst` test.

* Add LQMarkov.

* update version number

* update major changes in README

* add newline for PEP8

* Release of version 0.4.5

* update travis to python=3.7

* update distribution to xenial

* FIX: bug of computing state values in the last period of `LQMarkov` model

* FIX: avoid solving stationary values for multiple times

* FIX: random.draw: Replace `random_sample` with `random`

Fix QuantEcon#502

* FIX: Player.is_dominated: Fix warnings

Fix QuantEcon#501

* EHN: Player.is_dominated: Add `'revised simplex'` method

For SciPy >= 1.3.0

* FIX: Fix RuntimeWarning in lq_control.py

* FIX: Fix RuntimeWarning in ivp.py

* FIX: Fix Pandas related FutureWarnings in test_quad.py.

* Raise value error if C != 0 and beta >= 1.

* Tweak assignment of beta in test_robustlq.py to prevent test failiures.

* Fix PEP8 Indent Error.

* Edit assignment of beta in test_robustlq.py.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants