Skip to content

Commit 5a4455d

Browse files
Stabilize H before factorization in SquareRootFilter
1 parent 4d5acb9 commit 5a4455d

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

pymc_extras/statespace/filters/kalman_filter.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -665,10 +665,7 @@ def update(self, a, P, y, d, Z, H, all_nan_flag):
665665

666666
y_hat = Z.dot(a) + d
667667
v = y - y_hat
668-
669-
H_chol = pytensor.ifelse(
670-
pt.all(pt.eq(H, 0.0)), H, pt.linalg.cholesky(H, lower=True, on_error="nan")
671-
)
668+
H_chol = pt.linalg.cholesky(stabilize(H, self.cov_jitter), lower=True)
672669

673670
# The following notation comes from https://ipnpr.jpl.nasa.gov/progress_report/42-233/42-233A.pdf
674671
# Construct upper-triangular block matrix A = [[chol(H), Z @ L_pred],

0 commit comments

Comments
 (0)