Solved – On-line detection of changing in a time series

change pointtime series

I would like to know what is the best approach to detect on-line the occurrences of a new steps or changes in a time series.

I've attached a picture of the time series I'm talking about. I would be able to detect the step indicated by the red arrow.

enter image description here

Each data point is collected every 2 seconds and I need to detect the changes in the time series as quick as possible, i.e. considering at most 5 samples ahead and avoiding if it is possible the outliers.

I'm completely stumped on how I might be able to do this – any ideas?

I have read something on Bayesian Analysis but before studying in depth I would like to know if there are other useful approach in term of detection speed, robustness to outliers and detection accuracy.

Thanks for your help.

Best Answer

Bayesian filter under the markov-chain assumption is the best tool for this kind of question. The basic idea is to use the past sampling to get your prior, then try to predict the current sample. The online detection is done by threshold on the prediction error.

Things like Kalman filter or particle filter is fairly easy to implement. Depending on what computer language you are familiar with, there are many parkage you can use out of the box.