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 graph
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 graph 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?