# Detecting Traffic Incidents Using Persistence Diagrams
## 4 Results  
In this section, we present our contribution to the ATD challenge problem through the application of our method on traffic data collected from major highways in the Sacramento area. The problem was divided into two phases-depending on whether the location information of the sensors was provided-where each phase consisted of a training and testing data set. The objective of each phase of the challenge problem was to predict the time and location of hand-selected traffic incidents in the testing data using the training data which had very few labeled incidents. The data was collected as a count of cars that passed a given sensor during each 5-min interval throughout the 2017 calendar year. An example of this can be seen in Table 1.  
The training sets included details on certain incidents reported during the year that include the nearest sensor, the timestamp, and the duration of each incident. In each data set there are a few instances in which a particular sensor was not operating so that there are no counts reported during those five-minute intervals. Table 2 contains additional information on the data sets that were provided. To apply the algorithm to the volumetric data, we considered the embedding of the data in \(\mathbb{R}^{12}\) as sequences of 12 consecutive 5-min counts from a sensor. This means each vector represents 1 hour's worth of counts. We index each vector by a 3-tuple \((p,\mathbf{t},w)\). We use \(p\) to denote the sensor ID from which the counts were collected. We let \(\mathbf{t}=(t,d)\), where \(t\) denotes the starting time of the five-minute window corresponding to the first of the 12 counts and \(d\in\{1,...,7\}\) indicates the day of the week with \(d=1\) corresponding to Sunday, \(d=2\) corresponding to Monday, etc. We let \(w\in\{1,...,52\}\) denote the week in which these counts were collected. (We note that in 2017, there were 53 Sundays, and so for \(d=1\), \(w\in\{1,...,53\}\).) The vectors were then sorted by sensor, starting time, and day of week, meaning the set of all vectors was partitioned into smaller data sets of 52 vectors. We let \(\mathbf{D}_{p,\mathbf{t}}\) denote the collection of count vectors from sensor \(p\) collected at the time (hour and day of the week) corresponding to \(\mathbf{t}\). For two different starting times from the same weekday, say \(\mathbf{t}=(t,d)\) and \(\mathbf{t}^{*}=(t^{*},d)\), it is possible that the components of vectors in \(\mathbf{D}_{p,\mathbf{t}}\) overlap with those of vectors in \(\mathbf{D}_{p,\mathbf{t}^{*}}\). For example, if \(t=8\):00 AM, and \(t^{*}=8\):05 AM, then the vectors in \(\mathbf{D}_{p,\mathbf{t}^{*}}\) are nearly the same vectors as in \(\mathbf{D}_{p,\mathbf{t}}\), but the entries are shifted left by one component and the final entry is the count from 9:00-9:05 AM. Since there are 288 five-minute intervals throughout the day and we required 12 consecutive counts to form each vector, there are 277 possible vectors of counts each day. After sorting the vectors, we applied Algorithm 1 to each collection of counts \(\mathbf{D}_{p,\mathbf{t}}\) with \(S=30\) and \(N=30\). Thus, each vector in \(\mathbf{D}_{p,\mathbf{t}}\), was assigned 30 bottleneck distances. For each time window \((p,\mathbf{t},w)\), we recorded the mean, median, and standard deviation of these bottleneck distances which we denote by \(\overline{d}_{p,\mathbf{t},w}\), \(h_{p,\mathbf{t},w}\), and \(s_{p,\mathbf{t},w}\), respectively. As in [53], we expected different periods of the day to exhibit different behavior. Therefore, after obtaining the summary statistics from Algorithm 1, our vectors were classified again according to three factors: day of week, sensor, and time of day. Time of day had 5 levels based on the time of the vector's first count. The levels were _Early Morning Morning Morning Mid Day, Evening_, and _Late Evening_, and they corresponded to one-hour windows with start times in the ranges:  
1. Early Morning 12:00 AM-4:50 AM
2. Morning 4:55 AM-7:50 AM
3. Mid Day 7:55 AM-3:50 PM
4. Evening 3:55 PM-5:50 PM
5.