News for hackers. Stuff that matters.
Re:Kalman Filter Tutorial: Kalman Filter from the Ground Up by dmillar on Saturday October 14, 2023 @11:52AM (#37881444)
PSA: If/when using these tools, know the difference between Kalman filter and Kalman smoother. And be especially careful when using to make forecasts, forward estimates, predictions, etc.

Beyond the scope of this comment and post, but mind two-sided filters (as the Kalman smoother/HP filter uses) as you could be incorporating future/unknown data into your model.

Re:Kalman Filter Tutorial: Kalman Filter from the Ground Up by sorenjan on Saturday October 14, 2023 @01:12PM (#37882285)
I've actually been looking for a good description of the Kalman smoother, to process recorded data without phase shift, but I haven't found any. I have text books on the subject from school, but I can't really translate it to real code in this case. I understand using and updating the filter sequentially, but how do I use information from both previous and future data for each point?
Re:Kalman Filter Tutorial: Kalman Filter from the Ground Up by bp0017 on Saturday October 14, 2023 @03:07PM (#37883278)
This is my question as well, I've read multiple sources that imply the Kalman smoother would work for my problem, but not exactly _how_ in a way that I could make sense of programmatically.
Re:Kalman Filter Tutorial: Kalman Filter from the Ground Up by NwtnsMthd on Saturday October 14, 2023 @03:24PM (#37883433)
A Kalman filter will give you the "best guess" for some state (x) at the current timestep (k). This estimate often has some lag in it, likely because you have some incomplete information that you couldn't model. Sometimes we care about the previous states (e.g., x_k-1). But if we just save these states and refer to them, we're not getting the most out of our data.

The Kalman Smoother can be used to go back and update these past values with all the samples up to the current time. To update your previous measurements, you need to save the state of your filter at every timestep (x_k) and its associated covariance matrix (P_k). You can then apply Kalman Smoothing to reprocess previous data and update it with all current information. This will often remove the phase delay that you would otherwise observe in your estimate.

Re:Kalman Filter Tutorial: Kalman Filter from the Ground Up by joeyo on Saturday October 14, 2023 @08:31PM (#37885642)
Max Welling's Kalman Filter tutorial [1] derives the smoother equations using pretty clear and easy to follow notation (and is a great resource generally).

Briefly: you first run the filter equations "forwards", processing each datapoint sequentially from start to end. Then you run the smoother "backwards" in time on the same data going from end to start.

1. http://www.stat.columbia.edu/~liam/teaching/neurostat-spr12/...

Re:Kalman Filter Tutorial: Kalman Filter from the Ground Up by sorenjan on Sunday October 15, 2023 @10:13AM (#37889896)
Thank you, I'll have a look at it when I can find the time and frame of mind.