Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dead code from kalman_filter.py #393

Merged
merged 5 commits into from
Nov 27, 2024

Conversation

jessegrabowski
Copy link
Member

My original vision for kalman_filter.py was quite bad. Following statsmodels, I made a bunch of classes that instantiate various types of kalman filters, with minor differences between them. The idea was to let the user pick what would work best in his given situation.

Looking at it now, this should all be accomplished via rewrites. Some of it already is. For example, the only difference between the StandardFilter and the SingleTimeSeriesFilter was that I replaced a matrix inverse with a division. This is done automatically in rewrites, so there's no need for it.

I removed the SteadyStateFilter because that never made sense. Instead, all of the filters should be checking for convergence to the steady state -- that will be an upcoming PR.

CholeskyFilter has been renamed to SquareRootFilter, and it actually is a square root filter. I let the user pick it for now, but my plan is to rewrite to this when we see that the user has provided a lower triangular P0. I haven't benchmarked it, but it should be faster in that case (since solves are replaced with solve_triangular everywhere)

Copy link
Contributor

@AlexAndorra AlexAndorra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much simpler indeed, thanks @jessegrabowski !
I'm guessing we need to update some examples after this is merged? Shall I merge BTW?

@jessegrabowski
Copy link
Member Author

Yeah some examples mention these other filter options, but none actually use them. It will be good to go through and delete all of that.

@jessegrabowski jessegrabowski merged commit 12e21de into pymc-devs:main Nov 27, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants