I have a single time series where you can clearly see a process change (denoted by the manually drawn lines). I am trying to detect and cluster these changes so that I can be notified when a new cluster is beginning. I have already attempted K-means clustering, agglomerative clustering and they do a decent job but do not seem to cluster based on time, only the value. I expect to have 6 clusters in the timeseries. You can see the algorithm typically ignores time.
I have googled a lot and discovered DTW however every article I read is comparing multiple time series instead of detecting changes within a single time series.
Does anyone have any references I can read up on this or have any solutions?
I am unable to provide actual data however here is some example data that you can use:
library(tidyverse)
example_data <- tibble(
date_seq = 1:300,
value = c(
rnorm(65, .1, .1),
rnorm(65, -.25, .1),
rnorm(20, 4, .25),
rnorm(80, -.25, .1),
rnorm(20, 4, .25),
rnorm(50, 0, .1)
)
)
Thank you!