  Many studies have been performed to characterize the dynamics and stability
of the microbiome across a range of environmental contexts [Costello et al.,
2012, Faust et al., 2015]. For example, it is often of interest to identify
time intervals within which certain subsets of taxa have an interesting pattern
of behavior. Viewed abstractly, these problems often have a flavor not just of
time series modeling but also of regime detection, a problem with a rich
history across a variety of applications, including speech recognition [Fox et
al., 2011], finance [Lee, 2009], EEG analysis [Camilleri et al., 2014], and
geophysics [Weatherley and Mora, 2002]. In spite of the parallels, regime
detection methods are rarely used in microbiome analysis, most likely due to
the fact that references for these methods are scattered across several
literatures, descriptions are inaccessible outside limited research
communities, and implementations are difficult to come across.
  We distill the core ideas of different regime detection methods, provide
example applications, and share reproducible code, making these techniques more
accessible to microbiome researchers. We re-analyze data of Dethlefsen and
Relman [2011], a study of the effects of antibiotics on the microbiome, using
Classification and Regression Trees (CART) [Breiman et al., 1984], Hidden
Markov Models (HMMs) [Rabiner and Juang, 1986], Bayesian nonparametric HMMs
[Teh and Jordan, 2010, Fox et al., 2008], mixtures of Gaussian Processes (GPs)
[Rasmussen and Ghahramani, 2002], switching dynamical systems [Linderman et
al., 2016], and multiple changepoint detection [Fan and Mackey, 2015]. Along
the way, we summarize each method, their relevance to the microbiome, and
tradeoffs associated with using them. Ultimately, our goal is to describe types
of temporal or regime switching structure that can be incorporated into studies
of microbiome dynamics.
