There are many use cases for finding trends and anomalies, and many techniques for accomplishing these goals. This chapter has reviewed just a handful of popular approaches. We will not explore all of the various use cases with example code, but we will address two scenarios. First, recall the Google Analytics anomaly detector. It notified the user of anomalous (very high or very low) page views or visitors to a website by comparing the observed number of page views or visitors to the predicted number. The predicted number had a range (curiously, the range in the screenshot in Figure 1 is 2.13 to 35.4 page views for the day, which is not an especially precise prediction), and the observed value (43 page views) exceeded this range. Recall also that the documentation for Google Analytics, quoted in the introduction to this chapter, states that they use a 90-day window with a Bayesian state space-time series model.
We developed such a model in a previous section, called a...