Skip to content

Commit

Permalink
[BUGFIX] kalman: Always initialize self.Sigma and self.x_hat (#562)
Browse files Browse the repository at this point in the history
  • Loading branch information
rht committed Jan 17, 2021
1 parent 9a3f5a8 commit 0b78e30
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions quantecon/kalman.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ def __init__(self, ss, x_hat=None, Sigma=None):

def set_state(self, x_hat, Sigma):
if Sigma is None:
Sigma = np.identity(self.ss.n)
self.Sigma = np.identity(self.ss.n)
else:
self.Sigma = np.atleast_2d(Sigma)
if x_hat is None:
x_hat = np.zeros((self.ss.n, 1))
self.x_hat = np.zeros((self.ss.n, 1))
else:
self.x_hat = np.atleast_2d(x_hat)
self.x_hat.shape = self.ss.n, 1
Expand Down

0 comments on commit 0b78e30

Please sign in to comment.