oseiskar / simdkalman

Python Kalman filters vectorized as Single Instruction, Multiple Data
https://simdkalman.readthedocs.io/
MIT License
176 stars 36 forks source link

Possible minor inconsistency in dimensions? #19

Closed microprediction closed 3 years ago

microprediction commented 3 years ago

I was in the process of writing some unit tests for the multi-dim usage and noticed a possible minor inconsistency. Both KalmanFilter.predict and KalmanFilter.update require the initial means to take a certain shape. The latter preserves this shape in the output results object. However, the .predict method transposes the last two dimensions. Thus the shape of the means going in isn't the same as going out. If this output is merely intended as reporting that doesn't matter, but as you can see from this test script there might be a slight inconsistency here. However, perhaps I misunderstand the intent or am abusing the usage somehow.

LMK if you want this test script in a notebook or PR into simdkalman.

oseiskar commented 3 years ago

Thanks! I'll take a closer look later this week (and review #18 as well)

oseiskar commented 3 years ago

This actually might be just a confusion between predict & predict_next, see https://github.com/oseiskar/simdkalman/pull/18#discussion_r683613205

oseiskar commented 3 years ago

Works as intended with predict_next, even though the terminology is indeed confusing here. See