categoricalCUSUM function

CUSUM detector for time-varying categorical time series