I have a question related to change detection. Application domain is robotics/planning.
There is a sensor detecting distance from obstacle (ultrasonic / sonar sensor) at a specific position
(x, y, theta) in the environment.
It returns some reading at regular time intervals. Lets say the reading is
R and over a period of time it records
+/- means variation due to sensor inaccuracies).
I introduce an additional object between the sensor and the obstacle at a distance
D < R) so that at the next instance
D is detected and returned
I remove the original obstacle and now the next obstacle is
D' > R) and at the next instance
D' is returned.
Is there a way to exactly (or with high probability) say that a changed occurred NOW (when I add or remove an obstacle)?
Most change analysis algorithms consider a run length before change point and some data after change point and indicate the position change occurred.
But none I have read so far say change happened NOW; even the "online" algorithms seem to need some burn in data.
I want to implement a method that takes the data vector and return if the latest data point was a change point.
A possible Solution/hack
Since my work involves streaming data, this is the approach I am currently taking.
- Read a window of data (for now, my window size is 20 values) from the end of the stream.
- Run bcp (from R) on this window.
- Check for the posterior probability of the change at location 18. (for all the runs i just had, the last value is NA, hence ignore that, and the data is zero indexed, (calling R from Python using rpy2), hence, the position turns out 18 for window size of 20.
- Set a threshold of 70% for the posterior probability (for now in my experimental setting this works fine, I may have to work on getting a proper threshold later)
- If the posterior probability at location 18 > 70%, I return TRUE indicating the recent data point has a different mean, or "change detected", else return FALSE.
This may not be the most efficient way of doing it, but it is doing its job for now. I am using this approach to carry my work forward.
I will update the thread if I find a better approach.
Thanks you all for the help!