I don't really know if this problem can be considered as an intervention detection/analysis problem. The data shown below is actually a sensor signal collected from an air booster. The air booster has only two states, either it is on or off. When air booster is off, it sends out signal quite stably at about 6.4 to 6.5 (guessing from the graph), but when it is on, it shows pretty big vibration around 6.1 or 6.2. The only part of the signal that I care is when air booster is on. But I need a dummy variable to tell me when the air booster is on/off. So, I considered the off state as a intervention. Plus, there is no cycle or periodic pattern about when the air booster will be turned on or off, it just did randomly. The plot of the TS is shown in the following graphenter image description here

I used the tso function from tsoutliers package with following code, but it took forever to run

outlier.signal <- tso(ts_signal, types = c("LS"))

Did I do it right?

Or, probably I could transform the problem into a clustering problem, a K-means cluster with 2 centers might work.

Or, step-wise linear regression, regression tree problem.

And, how about this second signal/time series, there you can see two different patterns, too. One part of it is quite stable, and that is when the air booster is off, while the other is pretty fluctuating, and it is when the air booster is on. Please refer to the following graphenter image description here The method I am thinking of would be something like a moving standard deviation, and then apply clustering method as part 1.

What better method should I use for both of these?

  • $\begingroup$ 'All I wanted is to analyze the effect of the interventions or segregate this time series into two parts (higher level part and lower level part).' These are two different things. Do you want to create two new series and analyse them separately, or do some kind of intervention analysis like this: stats.stackexchange.com/questions/tagged/…? $\endgroup$
    – TMrtSmith
    Jan 25, 2018 at 11:01
  • $\begingroup$ For the second question, what do you actually want to do? This should help answer the question of what method you want to use. $\endgroup$
    – TMrtSmith
    Jan 25, 2018 at 11:03
  • $\begingroup$ Thanks for the reply, I have Edited the question, but I don't know if it is clear enough $\endgroup$
    – Aaron_Geng
    Jan 25, 2018 at 19:11
  • $\begingroup$ Post your data. $\endgroup$
    – Tom Reilly
    Jan 26, 2018 at 16:06
  • $\begingroup$ Data posted as links $\endgroup$
    – Aaron_Geng
    Jan 26, 2018 at 17:26

1 Answer 1


Apply some filters to the data is certainly a good idea.

If you look into time series and change point detection literature, you will find many methods that try to model the data with segment-wise different mean.

I suggest beginning with this classic:

M. Basseville, I.V. Nikiforov, Detection of Abrupt Changes - Theory and Application. Prentice-Hall, Inc., Apr. 1993.

which can be downloaded from the authors personal page: http://people.irisa.fr/Michele.Basseville/publis.html


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.