Closed karussell closed 7 years ago
See the proposed simple fix. But maybe we should throw an error at this point and avoid passing 0 to this method?
These are logarithms of probabilities. Returning 0 means "for sure". Returning minus infinity is less wrong than returning 0, because the probability of being at two different places with time difference 0 is 0.
the probability of being at two different places with time difference 0 is 0
so we should check if they are actually at the same place too. If they are - very high transition probability. If they aren't, then low.
Alternatively:
Maybe filter them out if they are the same location, and otherwise handle them like any other broken chain, possibly with a helpful comment: "you have identical timestamps on different points" added by the API/web layer? But to be continuous with the normal case, the library function should maybe just report it as a broken chain.
Or.. yes, we could also just require timestamps to be strictly increasing (by the API/web layer) and that's all.
@michaz would you mind to open a new issue for this? Maybe we should be strict in the core and for the web stuff we just attach artificial timestamps with a speed of ~20km/h (at least per default)?
Now here I stumbled over a problem that the time difference is 0 which leads to an infinite transitionLogProbability. Probably we have to handle those cases separately?
Related #13