A nonparametric method for gradual change problems with statistical guarantees