Skip to content

Commit d8123c8

Browse files
committed
FIX: Fix RuntimeWarning in lq_control.py
1 parent d9c1e8a commit d8123c8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

quantecon/lqcontrol.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,10 @@ def stationary_values(self, method='doubling'):
241241
F = solve(S1, S2)
242242

243243
# == Compute d == #
244-
d = self.beta * np.trace(dot(P, dot(C, C.T))) / (1 - self.beta)
244+
if self.beta == 1:
245+
d = 0
246+
else:
247+
d = self.beta * np.trace(dot(P, dot(C, C.T))) / (1 - self.beta)
245248

246249
# == Bind states and return values == #
247250
self.P, self.F, self.d = P, F, d

0 commit comments

Comments
 (0)