## 2 Methods
### Graph Diffusion Convolution for Spatial Dependency Modeling  
To capture the relationship between bus passenger flow observations in each bus line with a spatially structured dataset, the spatial dependency should be considered. Here, the spatial dependency is modeled by relating bus passenger flows to a diffusion process that explicitly captures the stochastic evolution of bus travel demand. By convolving the random walks (with a restart probability \(p\in[0,1]\)) over the maximum \(\tau\) nearest neighbors for each vertex, the diffusion step \(Y\) can effectively capture the spatial relationship between the observations. The graph diffusion \(\Xi\) is defined by Equation (2) while the diffusion process is demonstrated in Figure 1. At each step \(y\in\{0,\ldots,Y\}\), the model identifies the neighbors that are \(y\)-steps away from a node and calculates the transition matrices accordingly. Specifically, the graph diffusion \(\Xi\) is expressed as:  
\[\Xi=\sum_{y=0}^{\infty}p(1-p)^{y}T^{y} \tag{2}\]  
where \(y\) is the diffusion step and \(T\) denotes the transition matrix, defined by \(D^{-1}M\) with an adjacency matrix \(M\) in Graph \(G\) and a diagonal degree matrix \(D\). Matrix \(D\) is defined based on \(M\) in which each diagonal element \(d_{ii}=\sum\limits_{j}m_{ij}\). To operationalize the diffusion process, a finite \(Y\)-step truncation is often utilized in practice, with trainable weights assigned to each step.  
When training the model, probability \(\theta\)--which is a learnable parameter--is combined with transition matrices \(T=D^{-1}M\) to construct the diffusion convolutional filter. The resulting operation of diffusion convolution over a graph signal \(X\in\mathbb{R}^{N\times I}\) and a filter \(h_{\theta}\) can be defined as:  
\[X_{;i}\star_{G}h_{\theta}=\sum_{y=0}^{Y-1}\left(\theta_{y}\Big{(}D^{-1}M \Big{)}^{y}\right)X_{;i} \tag{3}\]  
where \(i\in\{0,\ldots,I\}\); \(\theta\in\mathbb{R}^{Y\times 1}\) are the parameters of the filter; \(D=diag(M1)\) in which \(1\in\mathbb{R}^{N}\) denotes an all-one vector; and \(y\) is the diffusion step.  
Figure 1: Illustration of the graph diffusion process with \(Y\) diffusion steps on a schematic graph.  
To capture the effects of upstream and downstream bus passenger flows, we need to take into account both forward and backward diffusion processes. Thus, the bidirectional diffusion convolution operation should be considered and defined as follows:  
\[X_{;i}\star_{G}h_{\theta}=\sum_{y=0}^{Y-1}\Bigl{[}\Bigl{(}\theta_{y,1}\Bigl{(}D _{out}^{-1}M\Bigr{)}^{y}\Bigr{)}X_{;i}+\Bigl{(}\theta_{y,2}\Bigl{(}D_{in}^{-1}M \Bigr{)}^{y}\Bigr{)}X_{;i}\Bigr{]} \tag{4}\]  
where \(\theta=\mathbb{R}^{Y\times 2}\) are the parameters for the filter, while \(D_{out}^{-1}M\) and \(D_{in}^{-1}M\) denote the transition matrices of the diffusion process and the reverse process, respectively. With the defined bidirectional diffusion convolution operation in Equation (4), a diffusion convolutional layer \(L_{;c}\) can be put as:  
\[L_{;c}=\alpha\left(\sum_{i=0}^{I}X_{;j}\star_{G}h_{\Theta_{i,j,c}}\right) \tag{5}\]  
where \(c\in\{i,\dots,C\}\); \(X\in\mathbb{R}^{N\times I}\) represents the input; \(L\in\mathbb{R}^{N\times C}\) represents the output; \(I\) and \(C\) denote the dimension of input features and output features, respectively; \(\left\{h_{\Theta_{i,j,c}}\right\}\) are the filters in which \(\Theta\in\mathbb{R}^{C\times I\times Y\times 2}=\left[\theta\right]_{c,i}\) is defined as a tensor of parameters where \(\Theta_{c,i,j,c}\in\mathbb{R}^{Y\times 2}\) is the parameter of the convolutional filter for the \(i\)-th input and the \(b\)-th output; and \(\alpha\) is the activation function. The diffusion convolutional layer is useful to learn the graph-structured data representations and can be trained using stochastic gradient-based methods.