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

FIX: Remove 0.0 from candidates in solve_discrete_riccati #364

Merged
merged 2 commits into from
Oct 25, 2017
Merged

Conversation

oyamad
Copy link
Member

@oyamad oyamad commented Oct 25, 2017

Fix #356

@oyamad
Copy link
Member Author

oyamad commented Oct 25, 2017

test_robust_rule_vs_simple fails with a very small difference:

======================================================================
FAIL: test_robust_rule_vs_simple (quantecon.tests.test_robustlq.TestRBLQControl)
----------------------------------------------------------------------
Traceback (most recent call last):
 File "/home/travis/build/QuantEcon/QuantEcon.py/quantecon/tests/test_robustlq.py", line 82, in test_robust_rule_vs_simple
 assert_allclose(Kr_pf, Ks_pf, rtol=1e-4)
 File "/home/travis/miniconda/lib/python3.6/site-packages/numpy/testing/utils.py", line 1395, in assert_allclose
 verbose=verbose, header=header, equal_nan=equal_nan)
 File "/home/travis/miniconda/lib/python3.6/site-packages/numpy/testing/utils.py", line 778, in assert_array_compare
 raise AssertionError(msg)
AssertionError:
Not equal to tolerance rtol=0.0001, atol=0
(mismatch 66.66666666666666%)
 x: array([[ -4.332446e-25, -8.620690e+01, -3.903128e-17]])
 y: array([[ -3.704241e-25, -8.620690e+01, -3.003457e-17]])
x = np.array([[ -4.332446e-25, -8.620690e+01, -3.903128e-17]])
y = np.array([[ -3.704241e-25, -8.620690e+01, -3.003457e-17]])
x - y
array([[ -6.28205000e-26,   0.00000000e+00,  -8.99671000e-18]])

I am going to set atol to a small positive value.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 94.79% when pulling 6aea839 on fix-riccati into ea900c4 on master.

@oyamad oyamad requested a review from jstac October 25, 2017 02:59
@mmcky mmcky merged commit f7a7c69 into master Oct 25, 2017
@mmcky mmcky deleted the fix-riccati branch October 25, 2017 03:09
oyamad added a commit to QuantEcon/QuantEcon.jl that referenced this pull request Oct 25, 2017
sglyon pushed a commit to QuantEcon/QuantEcon.jl that referenced this pull request Oct 25, 2017
* FIX: Remove 0.0 from `candidates` in `solve_discrete_riccati`

QuantEcon/QuantEcon.py#364

* FIX: Replace `isfinite(cn)` with `cn * eps() < 1` in solve_discrete_riccati

QuantEcon/QuantEcon.py#361
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants