Skip to content

Commit 1057111

Browse files
committed
ROBUSTLQ: In the method robust_rule_simple, the if statement failed if you passed in an initial guess at P because it can't check 'if not [array]'. Changed to if P_init is None which does work.
1 parent c151a21 commit 1057111

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

quantecon/robustlq.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def robust_rule_simple(self, P_init=None, max_iter=80, tol=1e-8):
233233
A, B, C, Q, R = self.A, self.B, self.C, self.Q, self.R
234234
beta, theta = self.beta, self.theta
235235
# == Set up loop == #
236-
P = np.zeros((self.n, self.n)) if not P_init else P_init
236+
P = np.zeros((self.n, self.n)) if P_init is None else P_init
237237
iterate, e = 0, tol + 1
238238
while iterate < max_iter and e > tol:
239239
F, new_P = self.b_operator(self.d_operator(P))

0 commit comments

Comments
 (0)