Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

FIX: Remove 0.0 from candidates in solve_discrete_riccati #364

Merged
merged 2 commits into from
Oct 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion quantecon/matrix_eqn.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def solve_discrete_riccati(A, B, Q, R, N=None, tolerance=1e-10, max_iter=500):

# == Choose optimal value of gamma in R_hat = R + gamma B'B == #
current_min = np.inf
candidates = (0.0, 0.01, 0.1, 0.25, 0.5, 1.0, 2.0, 10.0, 100.0, 10e5)
candidates = (0.01, 0.1, 0.25, 0.5, 1.0, 2.0, 10.0, 100.0, 10e5)
BB = dot(B.T, B)
BTA = dot(B.T, A)
for gamma in candidates:
Expand Down
5 changes: 3 additions & 2 deletions quantecon/tests/test_robustlq.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@ def test_robust_rule_vs_simple(self):
assert_allclose(Kr, Ks, rtol=1e-4)
assert_allclose(Pr, Ps, rtol=1e-4)

atol = 1e-10
assert_allclose(Fr_pf, Fs_pf, rtol=1e-4)
assert_allclose(Kr_pf, Ks_pf, rtol=1e-4)
assert_allclose(Pr_pf, Ps_pf, rtol=1e-4)
assert_allclose(Kr_pf, Ks_pf, rtol=1e-4, atol=atol)
assert_allclose(Pr_pf, Ps_pf, rtol=1e-4, atol=atol)


def test_f2k_and_k2f(self):
Expand Down