I am developing a semi-supervised method for identifying anomalies in a time series with multiple states. Let's consider this example time series in which there are two states e.g. state 1 and 2 with mean power 0 and 100, respectively.
As we can see, whenever the system enters into a particular state, it stays there for a fixed amount of time (with some variance) before transitioning into another state during the normal operation. e.g. 20 seconds in state 1, and 40 seconds in state 2, approximately. I am looking for an semi-supervised method to detect the anomalous state in which system enters into that state but stays there for a long/short period of time than the usual duration, as marked in read in the above figure.
So there are two obvious questions to ask here:
- Identifying the number of states from the give time series. I use a clustering method (such as k-means) to find it.
- Learning the state properties such as power-level and state duration.
I am able to detect the states and their corresponding power level (or fitting to a distribution) using a HMM from the given normal time series. But how to learn the state duration? After learning these parameters, I am planning to use a finite state machine to model the states and their properties to detect the anomalies in an online manner. Any suggestions??