Estimating left behind patterns in congested metro systems: a Bayesian model

Purpose – During rush hours, many passengers ﬁ nd it dif ﬁ cult to board the ﬁ rst train due to the insuf ﬁ cient capacity of metro vehicles, namely, left behind phenomenon. In this paper, a data-driven approach is presented to estimate left-behind patterns using automatic fare collection (AFC) data and train timetable data. Design/methodology/approach – First, a data preprocessing method is introduced to obtain the waiting time of passengers at the target station. Second, a hierarchical Bayesian (HB) model is proposed to describe the left behind phenomenon, in which the waiting time is expressed as a Gaussian mixture model. Then a sampling algorithm based on Markov Chain Monte Carlo (MCMC) is developed to estimate the parameters in the model. Third, a case of Beijing metro system is taken as an application of the proposed method. Findings – The comparison result shows that the proposed method performs better in estimating left behindpatternsthan theexisting Maximum LikelihoodEstimation. Finally, threemain reasons forleft behind phenomenonaresummarizedto make relevantstrategiesfor metromanagers. Originality/value – First, an HB model is constructed to describe the left behind phenomenon in a target station and in the target direction on the basis of AFC data and train timetable data. Second, a MCMC-based sampling method Metropolis – Hasting algorithm is proposed to estimate the model parameters and obtain the quantitative results of left behind patterns. Third, a case of Beijing metro is presented as an application to test theapplicabilityandaccuracy of theproposedmethod.


Introduction
In recent years, metro has been favored by more and more urban residents due to its advantages of fast speed, large volume, punctuality and low fares (Silva et al., 2015;Noursalehi et al., 2018). Taking several big cities in China as examples, in 2018, the average daily passenger volume of Beijing, Shanghai and Guangzhou metro has reached 10.172, 10.544 and 8.354 million, respectively. As a result, the construction speed of metro system is difficult to keep up with the growth of passengers' travel demand, which leads to many metro service problems (Xu et al., 2016(Xu et al., , 2018b. The most common issue is the phenomenon known as left behind, where passengers cannot get on the first train because of insufficient train capacity, especially during rush hours (Zhu et al., 2018(Zhu et al., , 2017. Nowadays, the left behind phenomenon has attracted the attention of many metro operators because of its negative effects, such as potential safety risks due to crowded platforms, and an inaccurate estimate of the loading rate of trains (Sun and Xu, 2012;Delgado et al., 2012;Mueller and Sgouridis, 2011). Therefore, it is of substantial importance in studying and quantifying this phenomenon.
Many researchers have investigated this phenomenon using ideal models. For example, Hamdouch et al. (2011) and Papola et al. (2009) described the boarding process of metro passengers using the First-Come-First-Serve (FCFS) principle. When the train vehicle reaches the maximum capacity, passengers who cannot get on the train are automatically identified as passengers left behind. However, the reality may differ from the above description, for instance, passengers may not strictly follow the FCFS principle when boarding the train and the maximum capacity of the train may be exceeded in rush hours (Xu et al., 2018a).
Recently, automatic fare collection (AFC) that records a large amount of passengers' information provides a possibility for researchers to quantify the left behind phenomenon using data-driven methods. There are two main thoughts for AFC data to analyze the behavior characteristics: Frequentist and Bayesians. In view of Frequentist, a parameter in the model is regarded as an unknown but fixed value. For example, using AFC data, Zhao et al. (2017) proposed a method based on maximum likelihood estimation (MLE)to study the left behind patterns of Shenzhen metro system, in which the left behind patterns are seen as a vector of several fixed values. But for Bayesians, a parameter in the model follows a particular probability distribution, which is related to the prior information of this parameter and observed data. Bayesian inference framework has been got more and more attention by scholars in the field of passenger behavioral. Zhu et al. (2018) proposed both Bayesian inference methods and MLE method to learn the probabilistic mass function of the left behind phenomenon and showed that the Bayesian method makes better use of the advantages of observed data and prior information to obtain more accurate calculation results. Barry et al. (2007) presented a Bayesian model to estimate the distribution of origin-destination stations in New York City by using MetroCard information. Fu (2014) developed a Gaussian mixture model (GMM) combined with naive Bayesian framework to calculate the route choice patterns using the AFC data of London Underground. Sun et al. (2015) proposed an integrated Bayesian approach to study the passenger flow assignment in the metro network, and the case of Singapore metro proved the validity of proposed method. Li et al. (2018) proposed a Bayesian network model to capture the characteristics of departure time choice, whereas factors such as travel time saving, crowding, fare and departure time change are considered.
To take full use of the advantages of Bayesian inference framework, a more complex hierarchical Bayesian (HB) model is further presented to analyze the behavior characteristics of passengers. Lee and Sohn (2015) developed a HB model that incorporate several route-use patterns as unknown parameters into a Bayesian framework to research SRT route choice behaviour and illustrated the superiority of the method through Bayesian information criterion (BIC). Rahbar et al. (2019) presented a three-level HB model to estimate attributes of travel time components and to calibrate a transit assignment model. However, the HB model is so complex that it is difficult for traditional optimization methods to calculate the maximum likelihood function in the model (Robert, 2013). As a result, scholars calibrate the parameters of these models using computational methods, including the most widely used method MCMC (Pereyra et al., 2016). Xu et al. (2018c) and Sun et al. (2015) applied Metropolis-Hasting (MH) sampling algorithm to calibrate the parameters based on Bayesian inference framework and examined that this method has great performance even if there are multi-dimensional parameters,. However, the above model and related estimating algorithm have been not applied in the field of left behind patterns. Thus, we will construct a HB model to describe the left behind phenomenon and determine the values of parameters of each layer model using MCMC method based on AFC data.
The main object of this paper is to study left behind patterns in metro system using a large number of passengers' travel records. First, we construct an HB model to describe the left behind phenomenon in a target station and in the target direction on the basis of AFC data and train timetable data. Second, we propose a MCMC-based sampling method MH algorithm to estimate the model parameters and obtain the quantitative results of left behind patterns. Third, a case of Beijing metro is presented as an application to test the applicability and accuracy of the proposed method. Finally, three main causes of left behind are summarized to deeply understand the mechanism of the above phenomenon and to make relevant passenger flow control strategies.

Methodology
In this section, a Bayesian inference framework is introduced to estimate left behind patterns in metro system and the processing flowchart is shown in Figure 1, more details are provided below.  Estimating left behind patterns

Data preprocessing and notations
We define the metro network as (N, A), where N is the set of nodes, representing metro stations and A is the set of arcs, representing the links between two adjacent stations (Rahbar et al., 2019). For a given OD pair (o, d), o, d [ N, there might be several routes in its feasible route set X o,d , which can be obtained by K-shortest algorithm. In this paper, only the AFC records on OD pair with jX o,d j=1 and no transfer process are used, so as to obtain the accurate waiting time of passengers at the origin station (Zhao et al., 2017). Note that, for each OD pair, the boxplot method is proposed to mine the AFC data. The data with too long or too short travel time is considered as invalid data and will be removed. The notations and definitions used in this paper are listed in Table 1.
2.2 Extracting waiting time distribution from automatic fare collection data According to the research by (Chakirov and Erath, 2011), the passengers, who have the shortest travel time and have a waiting time of zero (i.e. wt z o;d ¼ 0), can be seen as the benchmark to calculate the waiting time of the other passengers given an OD pair. As there is no transfer process in the feasible route of OD pairs used in this paper, the difference of travel time between the target passenger and the benchmark passenger can be seen as his/her waiting time as follows:

SRT
The waiting time of a single passenger can be calculated by the above method, which can to be generalized to the all passengers whose origin station is the target station in direction dl o,d , so as to analyze the left behind patterns of the station in this direction.

Modelling passengers' waiting time using Bayesian theorem
In this section, a hierarchical Bayesian model is proposed to describe characteristics of left behind phenomenon in the target station using passengers' waiting time. Specifically, the waiting time distribution is represented as a GMM model. The details are shown as follows. We use an illustrative example to show the modelling process (as shown in Figure 2). In a given line direction, trains arrive at the target station periodically according to the predefined train timetable [ Figure 2 where hw o,d can be calculated by train timetable, that is, the total length of the target period divided by the total number of trains in direction dl o,d within the period; k o,d can be determined by the passengers with maximum waiting time. Therefore, the waiting time of passenger z can be calculated by fusion k o,d one-dimensional Gaussian functions as follow:  (Lee and Sohn, 2015). The corresponding hyper-prior distributions are listed as equations (4) Refer to the time-space relationship between passengers waiting time and trains in Figure 2, Each unknown parameter is treated as a random variable sampled from a certain distribution, so they are independent of each other, which means the prior distribution can be formulated combined with equations (4)-(6) as follows:  (10). Next, we will propose an MCMC method MH algorithm to estimate unknown parameters in the next subsection.

Estimating parameters using Markov Chain Monte Carlo
It is difficult to calculate the maximum likelihood by traditional optimization methods due to the complex formulation of parameters and the high-dimensional characteristics of parameter space. Therefore, researchers attempt to use the prior information of parameters and update the value of parameters through iteration until the value of likelihood function is Estimating left behind patterns the maximum to address this problem, namely, MCMC method. Many kinds of MCMC algorithms have been developed and the most used algorithm (i.e. MH algorithm) is applied to estimate the posterior distribution of target parameters in this paper. All the 3k o,d unknown parameters are synthesized into a vector w ¼ c 1 ; c 2 ; c 3 ; . . . ; c 3k o;d À Á , and the estimation process using MH algorithm is as follows: Step 1: Set iterative parameter t = 1, and set maximum number of iterations T, and set Burn-in value B, which is a fixed number to remove unstable sampling values of parameters.
Step 3.1: Generate a candidate state c i * from the presented probability distribution , and the candidate state vector is Step 3.2: Calculate the acceptance probability a according to MH criterion: Step 3.3: Generate a random number u from a uniform distribution (0, 1).
Step 3.4: Determines whether the original state is updated to the candidate state: if a > u, Step 3.5: Determines whether all unknown parameters have been calculated: if i < 3k o,d , set i = i þ1 and return to Step 3.1; otherwise, record the current state vector W (t) .
Step 4: Determine whether to stop sampling: if t < T, set t = t þ 1 and return to Step 3; otherwise, stop sampling and estimate each parameter as follows:

Case study
In this section, a suburban metro line case of Beijing metro system is introduced to verify the performance of the proposed method in estimating the left behind phenomenon. The AFC data and train timetable from September 1, 2018 to October 1, 2018 are collected from Beijing Metro Network Control Center and about 176 million records are collected. All cases are implemented using Python 3.7.1 and Oracle databases in this section.
3.1 Case description and parameters settings 3.1.1 Introduction to Changping Line. The left behind patterns of stations in Changping Line is mainly studied. As shown in Figure 3, the Changping Line is a suburban line located northwest of Beijing metro system and consists of 12 stations. Around each station, there are large numbers of commuters who tend to take the metro to work in the urban central area during the morning rush hours (7 a.m.-9 a.m.). Therefore, the left behind patterns of SRT each station in the direction of "suburban-urban center area" during 7 a.m.-9 a.m. in workdays are studied in this section, which is of great significance to be aware of the experience of these metro passengers.
3.1.2 Parameter settings in the model. First, according to the train timetable, the average headway in Changping Line and in target direction can be obtained, that is hw = 268. And the maximum number of trains passengers have to wait for (k) can be calculated by using passengers' trip records and the headway according to equation (2). And then, we can determine the value of hyper-parameters in equations (4)-(6)based on the hw and k. In this case, we set d i = (i À 0.5) 268, i = 10, k i = 0, g i = 268, and v i = 1/k, i = 1,2,. . .,k. Finally, the parameters in MH algorithm [see equation (11)] is given as T = 15000 and B = 9000.

Estimation results and analysis
The estimation results are shown in Figure 4, where each picture represents the estimation results of the left behind patterns of corresponding station, in which the horizontal coordinate represents the waiting time of passengers and the vertical coordinate represents the frequency. And the estimated results of each parameter (m , s , v ) are listed at the bottom of each picture. To verify the accuracy of the results obtained by the proposed method, an MLE based method (see reference (Zhao et al., 2017)) is also used to calculate the left behind patterns of target stations. And the comparison of results of MLE-based method and proposed method is shown in Table 2. The comparison results show that the results obtained by the two methods are similar, indicating that the proposed method performs well in estimating left behind patterns (Zhu et al., 2018). However, the MLE-based method can only give the proportion of passengers boarding different trains, while the proposed method (HB þ MCMC) can give more details, such as the average waiting time and standard deviation of passengers boarding different trains, which has a better explanatory characteristic.
Furthermore, according to the maximum number of trains passengers have to wait for (reflecting the severity of the left behind phenomenon), stations are divided into three grades: light congestion station, normal congestion) station and heavy congestion station,   which are marked in yellow, orange and red, respectively, in Table 2. To explain the causes of different degrees of left behind phenomenon, we introduce two new kind of data: the average number of tap-in passengers during rush hours and the average train loading data during rush hours (provided by Beijing Metro Network Control Center). Figure 5 shows the relationship between the above three types of data in each station, through which we can summarize the three main reasons for the left behind phenomenon: (1) The limited train capacity. For example, the loading rate of trains running in the section "Zhuxinzhuang -Life Science Park" has reached the upper limit (more than 100%), so when the train reaches Life Science Park, more than 80% of passengers waiting on the platform tend to have difficulty getting on the first train.
(2) A large influx of passengers in a short period. Take Shahe as an example, during the morning rush hours, an average of about 133 people entered the station every minute. As a result, the loading rate of trains soars from 69.96% to 107.81% after passing through the station, forcing passengers to wait for the next train.
(3) Passengers' seat preference. We observe that at Changping Xishankou and Ming Tombs, the loading rate of trains and number of passengers are small, but some passengers do not board the first train. This indicates that some passengers deliberately choose to wait for the next train under the condition of no crowding, and the most likely motivation for this behavior is to get a seat, which has also been found in cities such as Paris and Singapore (Kroes et al., 2014) (Tirachini et al., 2016).

Conclusions and discussions
This paper makes a quantitative analysis of the left behind phenomenon in the metro network based on a large number of passengers' travel records. The main contributions of this paper can be summarized as follows: After exploring the relationship between passengers' waiting time distribution and train timetable, a two-level HB model is proposed to describe the left behind patterns based on AFC data and train timetable data. Specifically, the waiting time of passengers is regarded as a GMM model, and each parameter of the GMM model are regarded as following Gaussian distribution, Uniform distribution and Dirichlet distribution, respectively. The HM algorithm is applied to estimate parameters in the proposed model. During the process of parameter estimation, we leverage the priori information of hyper-parameters  Estimating left behind patterns based on train timetable data, which make full use of observed data to obtain more accurate results. A suburban metro line case of Beijing metro system is given as an application of proposed method and the estimating results illustrate that the method performs well in estimating left behind patterns. Three main reasons for the left behind phenomenon are summarized as follows: the limited train capacity, a large influx of passengers in a short period and passengers' seat preference. The above cause analysis can provide basis for metro operators to formulate relevant strategies, such as setting different headways in different sections in a metro line to meet the demand of passengers or adopting passenger flow control strategies in specific stations to avoid potential risks.
Future research will be carried out in the following two aspects: (1) exploring more efficient iteration rules to improve the sampling efficiency to replace the traditional random walk process in MCMC methods; and (2) reasoning the mechanism of mutual influence of left behind phenomenon between different stations.