Skip to content

Commit 120411f

Browse files
authored
Use hermitian=True in pt.linalg.pinv in Kalman smoother (#515)
1 parent ce618a4 commit 120411f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pymc_extras/statespace/filters/kalman_smoother.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def smoother_step(self, *args):
105105
a_hat, P_hat = self.predict(a, P, T, R, Q)
106106

107107
# Use pinv, otherwise P_hat is singular when there is missing data
108-
smoother_gain = matrix_dot(pt.linalg.pinv(P_hat), T, P).T
108+
smoother_gain = matrix_dot(pt.linalg.pinv(P_hat, hermitian=True), T, P).T
109109
a_smooth_next = a + smoother_gain @ (a_smooth - a_hat)
110110

111111
P_smooth_next = P + quad_form_sym(smoother_gain, P_smooth - P_hat)

0 commit comments

Comments
 (0)