## 3 Trajectory Data
### Imputation for Missing Location Data  
As mentioned in Section 3.2, a large portion of the location data for any \(L_{k}\) is missing. Accordingly, generating features is difficult because the data length of \(L_{k}\) differs from that of ID \(k\). Thus, we must impute a location dataset \(L_{k}\) to a trajectory \(T_{k}=\{\tau_{k,1},\tau_{k,2},\ldots,\tau_{k,\tau}\}\) with aligned data length, where \(\tau_{k,t}\) is a point of ID \(k\) on the geographic coordinate system at time \(t\).  
As we mentioned in Section 2.2, although various trajectory recovery methods have been proposed, these models require large amounts of historical trajectory data linked to unique user IDs. However, because the mobile location data covered by this study do not store historical data for user anonymization, we cannot use such historical data. Thus, in this study, we use simple linear interpolation for trajectory recovery.  
Let us consider a scenario in which an ID is obtained at Site A at time \(t_{1}\). Then, later, the same ID is acquired at Site B at time \(t_{2}\), where \(t_{1}<t_{2}\) and \(t_{1},t_{2}\in\mathbb{N}\). When \(t_{2}-t_{1}>1\), we assume that the ID contains missing location data between \(t_{1}\) and \(t_{2}\). An assumption needs to be made regarding the missing data to be imputed if there is no information about the ID location. Hence, we assume that a mobile user departs from Site A at \(t_{1}\) and then arrives at Site B at \(t_{2}\). In other words, on the basis of the unit time \(t_{\text{unit}}\) and the acquisition times \(t_{1}\) and \(t_{2}\), the path can be obtained by dividing the interval between Sites A and B by \((t_{1}-t_{2})/t_{\text{unit}}\). By this assumption, we obtain trajectories \(T_{k},\forall k\in K\).  
The missing value ratio of \(T_{k}\), i.e., the ratio of imputed data for the entire \(T_{k}\), is defined by the function \(\Theta(\cdot)\mapsto[0,1)\) with location dataset \(L_{k}\), which is the source of \(T_{k}\) as an input, as follows:  
\[\Theta(\mathcal{T},L_{k})=\theta_{k}=\frac{\mathcal{T}-|L_{k}|}{\mathcal{T}}. \tag{1}\]  
Note that \(|L_{k}|>0\). Afterward, denoting the missing value ratio by \(\theta_{k}\), we use the function \(\Theta\) with \(L_{k}\) as the input. The missing value ratio \(\theta_{k}\) refers to the sparsity of trajectory \(T_{k}\) such that the closer the value of \(\theta_{k}\) is to 1, the sparser the trajectory \(T_{k}\).  
Figure 1 shows the distribution of the missing value ratios of the trajectories based on PTDP data obtained at Narashino, Chiba, from January to June 2021. Figure 1 indicates that almost all the location data are \(\theta_{k}\geq 0.95\). Notably, the data with \(\theta_{k}\geq 0.99\) comprise 63% of the data. Figure 1 thus implies that almost all the trajectories based on PTDP data are sparse. Figure 2 visualizes the imputation.  
Figure 1: Data distribution for missing value ratio \(\theta_{k},\forall k\in K\) for the PTDP data. These data were acquired from January to June 2021 in Narashino, Chiba, Japan. There are differences in the quantities of data among the missing value ratios. In particular, because the data range of 0.99-1.00 accounts for 60% of all user data, this figure shows that the user trajectories obtained from mobile devices in the area and in that period are very sparse.