## 3 Methodology
### Identification of Cell Sequences  
The result of the previous step is a cell sequence ordered by time for each GPS trace. These cell sequences need to be translated into cell sequences that can be handled by the forecasting model. There are several different ways to translate the cell sequences, which are more or less time independent and/or a valid representation of the behavior of the individuals. Underneath three distinct methods are detailed, namely a consecutive hit method, the first hit method and the longest stay method.  
Using the consecutive hit method, these the raw cell sequences are filtered to only contain dissimilar consecutive cells. Basically, this sequencing method determines only the sequence of cells that has been touched by the GPS trace (hereafter named _'Consec'_). Because GPS points within a GPS trace are not temporally equally divided, the cell sequences are time independent (see method 1 in Figure 3 and Algorithm 2). That is, the cell sequence identifies where pedestrians went, but it is not clear how long they stayed in each cell.  
Figure 3: Methods to filter the raw cell sequences, where dashed open cells are all points in the GPS trace, the closed cells are the cells selected according to each method, and the resulting raw cell sequences are identified as [x,x,x,x].  
Figure 2: Number of hits per cell distributed over the area, where the grey lines identify the network of the Mysteryland festival area in 2017. Darker coloring of the cells represents a higher number of hits.  
However, temporal information is essential to create a forecast of their movements at an event. Therefore also two methods are adopted that incorporate a temporal dimension in the cell sequences. The first method divides time in equal time periods of 5 min. Accordingly, for each time interval the cells are selected that are closest to the beginning of a time period (hereafter named '_First_' - see Method 2 in Figure 3 and Algorithm 3). In general, the last cell visited during the previous time period is identified as the current cell. In cases where pedestrians are standing still in one cell the previous cell is similar to the future cell, so no differences are found. However, in cases where a pedestrian is moving, historic location information is favored over future location information.  
```
Input: Raw sequences of cells \(S_{p}^{raw}\) Output: Filtered sequences of cells \(S_{p}^{filt}\) Output: Filtered sequences of cells \(S_{p}^{filt}\)
1. For each cell sequence \(S_{p}^{raw}\)
2. For each \(k\) in \(K\)
3. Identify the cell \(s_{p}(t)\) nearest to timestep \(k\)
4. Set \(s_{p}(k)=s_{p}(t)\)
5. Add \(s_{p}(k)\) to \(S_{p}^{filt}\)

Where \(S_{p}^{raw}\), \(S_{p}^{filt}\) are the raw and filtered cell sequences and of pedestrian \(p\), consisting of records \(s_{p}(t)\), \(K\) is a set of equally spaced timesteps \(k\) that indicate the beginning of a new time period
```  
**Algorithm 2** Description of the consecutive hit algorithm, which translates the raw cell sequence to a cell sequence of  
The second method selects the cell whose visit duration has been longest within each 5 min interval (hereafter named '_Longest_' - see Method 3 in Figure 3 and Algorithm 4).  
Here, the time interval is the time between the last time a GPS trace was detected in another cell and the first moment in time that the GPS trace was detected in the current cell. If these moments in time are earlier and/or later than the 5 min interval, the boundaries of the interval are taken as the start and/or end of the time period. Consequently, the stay duration can never be larger than 5 min for each time interval.  
To compare the model types only Method 1 is used, which is similar to the cell sequence identification method applied by [15]. Methods 2 and 3 are accordingly adopted to determine whether the best method is also capable of performing real-time predictions.