## 3 Methodology
### Data-Driven Segmentation of Space  
In order to capture the movements over the network, first the raw GPS traces are translated into sequences of cells that have been visited by a pedestrian that are ordered by time. This has as advantage that each GPS trace is simplified into an array that contains only main movement features of the pedestrian. The discretized sequence of cells can be handled by an RNN. Any segmentation of space based on a purely mathematical description would be a behavioral assumption on the researchers' side, which has as a disadvantage that the cell structure does not follow the travel behavior of the traffic. By allowing the data to show us the best segmentation of the network, we ensure that the especially the most heavily travelled corridors in the network are correctly segmented. More specifically, this research adopts the data-driven space segmentation technique presented in [16], which is an adapted version of the technique originally presented by [51]. See Algorithm 1 for a summary of this technique. Essential to this method is the choice of the order in which the seed points are fed to the algorithm. When seed points are randomly drawn from the data set, the structure of the segmented space changes with each attempt. In order to create a stable and behaviorally valid segmentation of space, the set of seed points is ordered based on density before are fed to the algorithm. This ensures that the most heavily travelled corridors in the traffic network are optimally represented by the cell structure. Yet, a sensitivity analysis is necessary to ensure a stable space segmentation solution is derived, which is not depending heavily on the seed points feeding order. In this research all coordinates \(\widetilde{x}_{p}(t)\) that are part of the full set of GPS traces are used to feed the data-driven space segmentation algorithm. Given that GPS traces develop over time, this might  
Figure 1: Visualization of the research methodology, where the numbers identify the types of data that are the input of the modules. (1) GPS traces, (2) set of Voronoi cells, (3) Cell sequences, (4) result of model prediction, (5) optimal type of sequence prediction model. not be completely realistic. However, given that the focus of this paper is on the development of the forecasting method, it essential to use a static fully defined segmented network as the basis for all estimated forecasting models. In reality, when using this algorithm on the fly, the network would become more defined during the runtime of the forecasting method. The effect of dynamic changes of the network are severe, as recompiling the paths and retraining of the forecasting model are essential whenever the segmentation of the network changes. More research is needed into methods to determine at which moments in time recompiling the segmented network is most opportune. Moreover, depending on the order in which locations are visited by the crowd influences the parts of the segmented network that are best defined. The current usage of the full set of GPS traces eliminates dynamic shifts in network definition. Also with respect to this issue, more research is advised. ```
Input: Set of seed points \(X=\left\{\overrightarrow{x_{p}}(t)\right\}\), desired maximum cell radius \(\gamma\) Output: Raw sequences of cells \(S_{p}^{raw}\) with the cell identification number \(s_{p}(t)\) for each point \(\vec{x_{p}}(t)\) in every GPS trace \(X_{p}(t)\)
1. Initialize \(C=\{\}\)
2. For each seed point \(\vec{x_{p}}(t)\) 1. Find the closest cell \(c_{n}\) in C, where the distance between \(\vec{x_{p}}(t)\) and \(c_{n}\)'s centroid is less than or equal to \(\gamma\) and \(c_{n}\)'s centroid is closer to \(\vec{x_{p}}(t)\) than any other cell centroids in \(C\) 2. If such \(c\) is not found, create a new cell C and assign \(\vec{x_{p}}(t)\) to \(c_{n+1}\). Add \(c_{n+1}\) to \(C\) 3. Assign s to c and update \(c\)'s centroid as the middle point of the current collection of members of the set of seed points that is currently assigned to c
3.