# Bike-Sharing Travel Demand Forecasting via Travel Environment-Based Modeling
## 5 Methodology  
### Development of the GWR-Based Model  
The GWR model, as a locally based spatial model, addresses the following spatial issues: spatial autocorrelation and spatial heterogeneity. This is accomplished by setting various spatial weights in each local area and incorporating varying estimated parameters in each location. The construction of the GWR model essentially originated from the following relation:  
\[y_{i}=\beta_{i0}+\sum_{k=1}^{m}\beta_{k}(u_{i},v_{i})x_{ik}+\varepsilon_{i}y_{i} =\beta_{i0}+\sum_{k=1}^{m}\beta_{k}(u_{i},v_{i})x_{ik}+\varepsilon_{i}\,i=1,2, \ldots,n \tag{1}\]  
where \(y_{i}\) denotes the riding demand at the \(i\)-th region, \(\beta_{i0}\) represents the regression intercept of the \(i\)-th region, \(x_{ik}\) is the \(k\)-th riding demand influence factor in the \(i\)-th region, \(\beta_{k}()\) signifies the regression coefficient of the \(k\)-th riding demand influence factor in the \(i\)-th region, and \(\varepsilon_{i}\) is the random error term of riding demand at the \(i\)-th region. In matrix form, the local coefficient of the \(i\)-th region, \(\beta_{k}(u_{i},v_{i})\), is estimated by:  
\[\overset{\wedge}{\beta_{k}}(u_{i},v_{i})=\Big{[}X^{T}\text{W}(u_{i},v_{i})X \Big{]}^{-1}X^{T}\text{W}(u_{i},v_{i})y\overset{\wedge}{\beta_{k}}(u_{i},v_{i })=\Big{[}X^{T}\text{W}(u_{i},v_{i})X\Big{]}^{-1}X^{T}\text{W}(u_{i},v_{i})y \tag{2}\]  
where X denotes the \(n\times k\) matrix of riding demand influencing factors, \(\text{W}(u_{i},v_{i})=diag[w_{i,1},\cdots,w_{i,n}]\) denotes the weight matrix of \(n\times n\), which weights the riding demand influencing factors on each observation region based on the centroid distance between each observation region and regression in the \(i\)-th region, is the coefficient vector of \(k\times 1\), and \(\mathbf{y}\) represents the vector of riding demand quantity observations of \(k\times 1\). The kernel function was utilized to calculate the weight of the distance between the observed region and the calibration region. The commonly used kernel functions include Gaussian, exponential, and quadratic functions. As the Gaussian function is relatively smoother and closer to reality, we used a Gaussian kernel function for distance weight calculation, as given by Equation (3):  
\[w_{ij}=exp(-\frac{1}{2}(\frac{d_{ij}}{b})^{2}) \tag{3}\] \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Factors** & **Variable Name** & **Variable Symbols** & **Description** \\ \hline Dependent variable & Departure volume & Y & Unit regional departure volume \\ \hline Traveling environment & Roadway facilities & X1 & Comprehensive evaluation \\  & Intersection facilities & X2 & Comprehensive evaluation \\  & Quantity of intersections & X3 & Quantity of unit area intersections \\  & Adjacent road distance & X4 & Distance from nearest road (m) \\ \hline  & Company & X5 & \\  & Bus and subway station & X6 & \\  & Residential area & X7 & \\  & Research and education & X8 & \\  & Tourist attractions & X9 & \\  & Commercial areas & X10 & \\ Land use & Leisure sports & X11 & Quantity in the unit area \\  & Health care & X12 & \\  & Public restrooms & X13 & \\  & Government & X14 & \\  & Life services & X15 & \\  & Financial sector & X16 & \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Summary of various variables. where \(d_{ij}\) denotes the centroid distance between the \(j\)-th observation region and the \(i\)-th regression region, the so-called kernel bandwidth, and \(w_{ij}\) represents the weight that makes up the weight matrix \(\mathrm{W}(u_{i},v_{i})\). The kernel bandwidth is the key control parameter of GWR-based regression, and the bandwidth with the smallest AICc was chosen as the optimal kernel bandwidth by the cross-validation method in this paper.