# Predicting Human Location Using Correlated Movements
## 5 Detection of Persons with Correlated Movements
### Community Interaction Similarity-Based Method  
Recall that the encounter frequency-based (EFB) method only uses direct encounters between certain individuals to estimate their friendship. In contrast, to measure correlation scores between persons \(p\) and \(q\), CISB considers interactions between these persons and other community members as well as direct encounters between them. The CISB method is inspired by the fact that interactions and relationships with other members in the community have a great impact on a person's behaviors. The CISB method utilizes the community interaction-based similarity (CIS) tensor shown in Figure 2, which represents the spatio-temporal encounters between people. The 3D CIS tensor, \(\mathbf{S}\), consists of \(m\) layers each of which is a matrix, e.g., \(\mathbf{S}_{::,q}\) reflects the interactions between person \(q\) and the rest of the \((m-1)\) people. More specifically, the \(p^{\text{th}}\) row in the matrix, i.e., \(\mathbf{S}_{p,:,q}\), indicates the temporal encounters of persons \(p\) and \(q\). Let \(n_{\text{day}}\) and \(n_{\text{time}}\) denote the total number of days in the overlapping period and the number of time slots per day, respectively. \(n=n_{\text{day}}\times n_{\text{time}}\) indicates the total number of samples per person during the whole period. \(a_{p,t}^{q}:=\mathsf{S}_{p,t,q}\) accounts for the encounter between persons \(p\) and \(q\) in time slot \(t\). Vector \(\mathbf{S}_{p,:,q}\), representing the encounters between persons \(p\) and \(q\), is defined as follows:  
\[\mathsf{S}_{p,t,q}=\left\{ \begin{array}{ll}1,&\text{if persons $p$ and $q$ are in the same cell}\\ &\text{during time slot $t$}\\ 0,&\text{otherwise}\end{array} \right. \tag{2}\]  
Person \(p\) is not considered able to encounter himself or herself, because tensor \(\mathsf{S}\) represents the interactions between a person and the entire community, i.e., \(\forall t,p:\mathsf{S}_{p,t,p}=0\). The CIS tensor owns a symmetric property, i.e., \(\forall t:\mathsf{S}_{p,t,q}=\mathsf{S}_{g,t,p}\). \begin{table}
\begin{tabular}{c c} \hline \hline
**Feature** & **Description** \\ \hline \(\{x_{i}^{\text{loc}},1\leq i\leq m,i\
eq p\}\) & location of \((m-1)\) remaining members \\ \(x^{\text{day}}\) & index of day in a week \\ \(x^{\text{time}}\) & index of time slot in a day \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Elements of the input vector in the first phase of the model for predicting the location of person \(p\). From the CIS tensor, we reshape every 2D matrix, \(\textbf{S}_{:,q}\), to a one-dimensional vector with \((m\times n)\) elements, which is denoted by \(\textbf{s}^{(q)}\). In order to evaluate the closeness between persons \(p\) and \(q\), we consider the meet/min correlation coefficient [41] for measuring the similarity between \(\textbf{s}^{(p)}\) and \(\textbf{s}^{(q)}\), which can be used if the vectors include a lot of 1 s. Thus, score \(d_{p,q}\) between nodes \(p\) and \(q\) is calculated as follows:  
\[d_{p,q}=\frac{\textbf{s}^{(p)\top}\textbf{s}^{(q)}}{\min\left(|\textbf{s}^{(p )}|,|\textbf{s}^{(q)}|\right)} \tag{3}\]  
where \(|\textbf{s}^{(q)}|\) is the \(L^{1}\)-norm of vector \(\textbf{s}^{(q)}\). After obtaining scores between person \(p\) and \((m-1)\) others, \(r\) people with the highest scores are chosen as PCMs. Because of the characteristics of CIS, i.e., \(\forall t,p:\)\(\mathcal{S}_{p,t,p}=0\), and the dot product in the numerator of Equation (3), when measuring similarity \(d_{p,q}\), the interactions between persons \(p\) and \(q\) vanished unintentionally. For example, in calculating \(d_{1,2}\), two vectors \(\textbf{s}^{(1)}\) and \(\textbf{s}^{(2)}\) are as follows:  
\[ \begin{array}{l}\textbf{s}^{(1)}=[0\ \ \ 0\ \...\ \ \ 0\ \ a_{2,1}^{1}\ a_{2,2}^{1}\...\ a_{2,n}^{1}\...\ \ a_{m,1}^{1}\ \ a_{m,2}^{1}\...\ \ a_{m,n}^{1}]\\ \textbf{s}^{(2)}=[a_{1,1}^{2}\ a_{1,2}^{2}\...\ a_{1,n}^{2}\ 0\ \ \ 0\ \...\ \ 0\ \...\ \ \ a_{m,1}^{2}\ \ a_{m,2}^{2}\...\ \ a_{m,n}^{1}]\end{array}