# Bayesian Analysis for Metro Passenger Flows Using Automated Data

Authors: Chunya Li; Shifeng Xiong; Xuan Sun; Yong Qin
Journal: Mathematical Problems in Engineering
 (2022)

---

## Abstract

With the fast development of metro systems in many big cities, it is important to study the characteristics of passenger flows based on metro data for the management to guarantee service quality and safety. In this article, we build statistical models for the data of passengers’ tap-in and tap-out times in both no-transfer and one-transfer cases, and propose a Bayesian approach to estimate parameters in the models. These estimators can be used to evaluate a number of measures, which describe degrees of congestion and comfort, and to quantify their uncertainties. Application of our approach to Beijing metro shows different passengers follow different patterns between different routes and between off-peak and peak hours.


---

## Body

## 1. Introduction

As urban rail transit systems become more complex, there has grown up a pressing need for the safety and operation efficiency of urban rail transit in big cities. To alleviate the problem of traffic congestion and to meet passenger travel comfort requirements, operation management departments have formulated many programs, such as adding a current-limiting fence and adjusting the train operation status. Therefore, it is very important to analyse the metro passenger flows, especially in peak hours. Such a study can provide technical support for operators to implement reasonable management and efficient guidance, which are crucial to the quality assurance of the metro service and safety.With continuous improvement of rail transit, automatic fare collection (AFC) systems can collect a wealth of passenger travel information and provide an important data support for metro operation departments to study passenger travel characteristics, formulate passenger flow control measures, and adjust driving plans. In recent years, mining behavior characteristics of passengers from AFC data has become an active branch in the field of passenger flow research (see, e.g., Paul [1]; Kusakabe et al. [2]; Sun and Xu [3]; Zhao and Yao [4]; Zhou et al. [5]; Sun and Schonfeld [6]; Chen et al. [7]; and Wu et al. [8]). For a fixed pair of origin-destination stations, studying behaviors of passengers based on only AFC data is actually a black box problem due to the lack of boarding information, which brings great challenges in accurately describing passenger flows. Probabilistic models are appropriate tools to study this problem. Fu et al. [9]; Lee and Sohn [10]; and Hörcher et al. [11] estimated the posterior probabilities of choosing different routes. Zhu et al. [12] proposed a probabilistic passenger-to-train assignment model to infer the probability of the passenger boarding each feasible train. Zhu et al. [13] inferred left-behind passengers in congested metro systems based on the probabilistic passenger-to-train assignment model. Besides AFC data, more information such as the distribution of access time is needed in these probabilistic models. Zhao et al. [14] developed a method to estimate passengers’ route choice pattern using smart card data. However, their method is based on the assumption that the time that passengers spend to walk between the platform and the origin-destinations entrance/exit is less than the departure interval between two adjacent trains. In practice, this assumption may not hold, especially during peak hours. Leurent and Xie [15] proposed a stochastic model to reposition the distances along platforms during train waiting. Their method requires both smartphone and AFC data, while smartphone data are not easy to obtain in many research studies. With only AFC data, few studies presented accurate probability distribution models. Recently, Xiong et al. [16] have proposed a new passenger-to-train assignment model. By deriving the probability distributions of AFC data, they provided maximum-likelihood estimates of unknown parameters in this model in no-transfer situations.This article presents a Bayesian analysis of the statistical models of AFC data in both no-transfer and one-transfer situations. Our work extends Xiong et al. [16] in the following two directions. First, Xiong et al. [16] provided only point estimation for the parameters that lacks uncertainty quantification. Instead, we propose a Bayesian inferential method to quantify the uncertainty of parameter estimation. Interval estimation for the parameters and related passengers’ indices can be derived. Second, we show that Xiong et al. [16]’s estimation method cannot be straightforwardly extended to one-transfer situations due to an identifiability problem. With some prior information, our Bayesian method avoids this problem and yields reasonable estimators. Examples including real data applications and simulation results show the effectiveness of the proposed method.The article is organized as follows. Section2 presents the Bayesian inferential method for no-transfer situations. Section 3 describes our method for one-transfer situations. Section 4 gives applications of Bayesian estimators in deriving passengers’ characteristic indices. Section 5 conducts simulation studies. Section 6 provides real data examples in the Beijing metro system. Section 7 draws conclusions.


## 2. Bayesian Inference for No-Transfer Situations

In this section, we focus on a typical metro route, in which the passenger begins to tap in at the origin station and ends in tapping out at the destination station by taking only a train; that is, there is no any transfer station. We make the Bayesian inference for the metro passenger flow including estimating the probabilities of taking trains and the probability density functions of egress time, where egress time is the time it takes to walk to the tap-out fare gate after alighting from the train.Since millions of people take metro trains everyday in big cities like Beijing, it is not difficult to collect sufficient data from passengers whose tap-in times are almost the same in large stations [16]. Suppose we get the AFC data of n passengers whose tap-in times are t0. Let T=ti,i=1,…,n denote the set of their tap-out times. In addition, we assume that the egress times of the n passengers are independently and identically distributed from the log-normal distribution LNμ,σ2 with unknown parameters μ,σ′, where −∞<μ<∞ and 0<σ<∞. A random variable X is distributed from LNμ,σ2 if logX is distributed from the normal distribution Nμ,σ2 with mean μ and variance σ2. The log-normal distribution is commonly used to describe passengers’ walking times at metro stations [17]. Define(1)DTj: departure time of train j from the origin station,ATj: arrival time of train j at the destination station,mi: the number of feasible itineraries for passenger i, i.e.,mi=#j:DTj…t0,ATj…ti,πj: the probability that the wholepassengers take the jth train.Here,DTj and ATj can be obtained from the automatic vehicle location (AVL) system. Let ϕ=π′,θ′′, θ=μ,σ′ and π=π1,…,πm′. We need to estimate the unknown parameters ϕ. Based on the joint distribution of T, the likelihood function can be given by(2)PT|ϕ=∏i=1n∑j=1miπjfti−ATj|θ.And the posterior distribution is(3)Pϕ|T∝PT|ϕPππPθθ,where the prior distributions of π and θ denoted by Pπ· and Pθ·, respectively, are independent.Here, we choose the prior distribution ofθ as the noninformative prior Pθθ≡1/σ2 [18]. For the probability parameters π, the Dirichlet distribution [19] is a natural prior. With hyperparameter vector α=α1,…,αm′, let π=π1,…,πm′∼Dirichletα, that is,(4)Pππ=1Bα∏j=1mπjαj−1,where Bα=∏j=1mΓαj/Γ∑j=1mαj and Γt=∫0∞xt−1e−xdt. In our problem, it seems not very reasonable to use α1=…=αm=1, which gives uniform priors for π1,…,πm. We adopt to use a data-driven method to specify the hyperparameters. Let π^=π^1,…,π^m′ be the maximum-likelihood estimators of π (see Xiong et al. [16]). We use α=π^ in (4). It should be pointed out that the selection of α does not heavily influence the posterior when the sample size is sufficiently large.We apply the Metropolis—Hastings [20, 21] algorithm to draw random samples from the posterior in (3), and the corresponding Bayesian point and interval estimation for the parameters can be given.


## 3. Bayesian Inference for One-Transfer Situations

This section discusses one-transfer situations. We first show that the parameters in the likelihood function are not identifiable based on only automated data. Then, we give the Bayesian estimation method with some data-driven priors.A one-transfer metro trip with two segments can be described by the following four steps: (1) tapping in and walking to the platform at the origin station, (2) waiting on the platform for a train until boarding a wanted train, (3) transiting between platforms and waiting until taking another train, and (4) getting off the train and tapping out at the exit gate (see Figure1).Figure 1
Flowchart of a one-transfer route.Similar to the previous section, suppose the tap-in times of then passengers are t0. Let T=ti,i=1,…,n denote the set of their tap-out times, and assume that the egress times of the n passengers are independently and identically distributed from LNμ,σ2. Define(5)DTj1:departure time of trainjfrom the origin station of segment1,ATj1:arrival time of trainjat the transfer station of segment1DTk2:departure time of trainkfrom the transfer station of segment2,ATk2:arrival time of trainkat the destination station of segment2,mi:the number of feasible itineraries for passengeri,i.e.,mi=#Si,whereSi=j,k:DTj1⩾t0,ATk2⩽ti,ATj1<DTk2,Ki:the number of feasible itineraries on segment2for passengeri,i.e.,Ki=#k:there existsjs.t.j,k∈Si,mik:the number of feasible itineraries on segment1for passengeriwho takes thekth itineraryin segment2, i.e.,mik=#j:j,k∈Si,k=1,…,Ki.Without loss of generality, let the smallest values ofj,k in all Si be 1; that is, j and k both begin with j=1 and k=1. We have ∑k=1Kimik=mi and 1⩽mi1⩽…⩽miKi. For example, if Si=1,1,2,1,1,2,2,2,3,2, then mi=5,Ki=2,mi1=2, and mi2=3. Let K=max1⩽i⩽nKi, mk=max1⩽i⩽nmik, and m=max1⩽i⩽nmi.Letρjk denote the probability that the passenger takes the jth feasible itinerary on segment 1 and the kth feasible itinerary on segment 2 for j=1,…,mk, k=1,…,K. We have ∑k=1K∑j=1mkρjk=1. Given the observations T=ti,i=1,…,n, the likelihood function is(6)PT|ϕ=∏i=1n∑k=1K∑j=1mkρjkfti−ATk2|θ=∏i=1n∑k=1Kfti−ATk2|θ∑j=1mkρjk,where ϕ=ρ′,θ′′,ρ=ρ11,…,ρm11,…,ρ1K,…,ρmKK′, and θ=μ,σ′. In the maximum-likelihood estimation method that maximizes (4), we can only obtain the estimators of ∑j=1mkρjk,k=1,…,K, while the individual ρjk are inestimable, j=1,…,mkmk>1,k=1,…,K. For example, let K=2 and m1=m2=2. The parameter vector ρ=ρ11,ρ21,ρ12,ρ22′ contains four components. By maximizing (4), we can estimate only two quantities, ρ11+ρ21 and ρ12+ρ22. The estimators of individual ρ11,ρ21,ρ12,ρ22 cannot be determined. Therefore, the maximum-likelihood estimation method in Xiong et al. [16] for no-transfer situations cannot be extended to the one-transfer situations.To overcome the above identifiability problem, we use prior information of the parameters and present a Bayesian inferential approach. Similar to the previous section, let the prior distributions ofθ and ρ be independent. We choose the prior distribution of θ as the noninformative prior Pθθ≡1/σ2 and assign the Dirichlet prior to ρ, that is,(7)Pρρ=1Bα∏k=1K∏j=1mkρjkαjk−1,where α=α11,…,αm11,…,α1K,…,αmKK′ are hyperparameters.Consequently, the posterior distribution ofϕ is(8)Pϕ|T∝PT|ϕPρρPθθ,where PT|ϕ is given in (6). It can be seen from (8) that the individual ρjk is not completely involved in ∑j=1mkρjk,k=1,…,K. The Metropolis–Hastings algorithm can be used to draw random samples from the posterior distribution of each component in the parameter vector ϕ.We now provide a method to specify the hyperparametersα in (7). First, we can compute the maximum-likelihood estimators τ^k of τk=∑j=1mkρjk in (6) for k=1,…,K. Next, consider the segment from the transfer station to the destination station, which is a no-transfer route. Let δjk denote the probability that the passenger, whose tap-in time is ATj1, takes his/her kth feasible itinerary in this no-transfer route for j=1,…,mK,k=1,…,K˜, where K˜ can be different from K. Based on the automated data on the segment, we can use the maximum-likelihood estimation method in Xiong et al. [16] to give estimators δ^jk of δjk. For K˜>K, we modify δ^jK as ∑k=K+1K˜δ^jk. Consequently, we select(9)αjk=τ^kδ^jk,j=1,…,mk,k=1,…,K.


## 4. Applications

This section presents some applications of the Bayesian estimators derived in the previous sections to the analysis of metro passenger flows. First of all, we should point out that the parametersπ and f·|θ can be viewed as measures that describe some aspects of characteristics of metro passenger flows. Therefore, our estimators can be used to infer these measures. Furthermore, let T1 denote the boarding time, that is, the time from tap-in to boarding a train; and let T2 denote the transfer time, that is, the time from alighting from the first train to boarding the second train. In the following, we infer T1 and T2 from both population and individual perspectives based on the estimators of π and θ.


### 4.1. Population Inference

In no-transfer situations, for a passenger whose top-in time ist0, his/her boarding time T1 is a random variable, which only takes the finite values DT1−t0,…,DTj−t0. It is not difficult to derive the probability distribution, mean, and standard deviation of boarding time T1 as(10)PT1=DTj−t0=πj,j=1,…,m,ET1=∑j=1mπjDTj−t0,sdT1=∑j=1mπjDTj−t02−∑j=1mπjDTj−t021/2,respectively. With the estimators of π in Section 2, we can estimate these quantities.For one-transfer situations, the probability distribution, mean, and standard deviation ofT1 of passengers who tap in at time t0 are(11)PT1=DTj1−t0=∑k=1Kρjk,j=1,…,mk,ET1=∑k=1K∑j=1mkρjkDTj1−t0,sdT1=∑k=1K∑j=1mkρjkDTj1−t02−∑k=1K∑j=1mkρjkDTj1−t021/2,respectively. With the estimators of ρ in Section 3, we can also give estimators of the above quantities. Similar to T1, the transfer time T2 is also a random variable that takes the finite values DTk2−ATj1,k=1,…,K,j=1,…,mk. We can derive the probability distribution, mean, and standard deviation of T2 as(12)PT2=DTk2−ATj1=ρjk,k=1,…,K,j=1,…mk,ET2=∑k=1K∑j=1mkρjkDTk2−ATj1,sdT2=∑k=1K∑j=1mkρjkDTk2−ATj12−∑k=1K∑j=1mkρjkDTk2−ATj121/2,respectively, and the estimators of ρ can also be plugged in the above equations.


### 4.2. Individual Inference

For no-transfer situations, Zhu et al. [12] presented a probabilistic passenger-to-train assignment model (PTAM), which can be used to infer the most likely train that a certain passenger took as long as the parameters in it are estimated. Xiong et al. [16] proposed a modified PTAM (MPTAM) for both no-transfer and one-transfer situations. The parameters in MPTAM are actually those in the likelihood functions (1) and (4), which can be estimated by the proposed Bayesian method.We first consider no-transfer situations. If the tap-in time and tap-out time of a passenger aret0 and ti, respectively, then the MPTAM formula gives(13)pij=Pthe passenger too kitineraryj|t0,ti=fti−ATjπjt0∑j=1mifti−ATjπjt0.With the estimators off and π in Section 2, (13) can infer the probability that the passenger took each itinerary. In addition, we can derive the posterior distribution, mean, and standard deviation of boarding time T1 of this passenger as(14)PiT1=DTj−t0=pij,i=1,…,n,j=1,…,mi,EiT1=∑j=1mipijDTj−t0,sdiT1=∑j=1mipijDTj−t02−∑j=1mipijDTj−t021/2,respectively, and the estimators of pij in (13) can be plugged in the above equations to give estimated values.For one-transfer trips, the MPTAM formula is(15)pijk=Pthe passenger took thejth feasible itinerary on segment1and thekth feasible itinerary on segment2|t0,ti=fti−ATk2ρjkt0∑k=1K∑j=1mikfti−ATk2ρjkt0.The posterior distributions, means, and standard deviations of boarding timeT1 and transfer time T2 of this passenger are(16)PiT1=DTj1−t0=∑k=1Kpijk,j=1,…,mk,EiT1=∑k=1K∑j=1mkpijkDTj1−t0,sdiT1=∑k=1K∑j=1mkpijkDTj1−t02−∑k=1K∑j=1mkpijkDTj1−t021/2,PiT2=DTk2−ATj1=pijk,k=1,…,K,j=1,…mk,EiT2=∑k=1K∑j=1mkpijkDTk2−ATj1,sdiT2=∑k=1K∑j=1mkpijkDTk2−ATj12−∑k=1K∑j=1mkpijkDTk2−ATj121/2,respectively. Estimators of the above quantities can be computed based on the estimators of ρ and f in Section 3.


## 4.1. Population Inference

In no-transfer situations, for a passenger whose top-in time ist0, his/her boarding time T1 is a random variable, which only takes the finite values DT1−t0,…,DTj−t0. It is not difficult to derive the probability distribution, mean, and standard deviation of boarding time T1 as(10)PT1=DTj−t0=πj,j=1,…,m,ET1=∑j=1mπjDTj−t0,sdT1=∑j=1mπjDTj−t02−∑j=1mπjDTj−t021/2,respectively. With the estimators of π in Section 2, we can estimate these quantities.For one-transfer situations, the probability distribution, mean, and standard deviation ofT1 of passengers who tap in at time t0 are(11)PT1=DTj1−t0=∑k=1Kρjk,j=1,…,mk,ET1=∑k=1K∑j=1mkρjkDTj1−t0,sdT1=∑k=1K∑j=1mkρjkDTj1−t02−∑k=1K∑j=1mkρjkDTj1−t021/2,respectively. With the estimators of ρ in Section 3, we can also give estimators of the above quantities. Similar to T1, the transfer time T2 is also a random variable that takes the finite values DTk2−ATj1,k=1,…,K,j=1,…,mk. We can derive the probability distribution, mean, and standard deviation of T2 as(12)PT2=DTk2−ATj1=ρjk,k=1,…,K,j=1,…mk,ET2=∑k=1K∑j=1mkρjkDTk2−ATj1,sdT2=∑k=1K∑j=1mkρjkDTk2−ATj12−∑k=1K∑j=1mkρjkDTk2−ATj121/2,respectively, and the estimators of ρ can also be plugged in the above equations.


## 4.2. Individual Inference

For no-transfer situations, Zhu et al. [12] presented a probabilistic passenger-to-train assignment model (PTAM), which can be used to infer the most likely train that a certain passenger took as long as the parameters in it are estimated. Xiong et al. [16] proposed a modified PTAM (MPTAM) for both no-transfer and one-transfer situations. The parameters in MPTAM are actually those in the likelihood functions (1) and (4), which can be estimated by the proposed Bayesian method.We first consider no-transfer situations. If the tap-in time and tap-out time of a passenger aret0 and ti, respectively, then the MPTAM formula gives(13)pij=Pthe passenger too kitineraryj|t0,ti=fti−ATjπjt0∑j=1mifti−ATjπjt0.With the estimators off and π in Section 2, (13) can infer the probability that the passenger took each itinerary. In addition, we can derive the posterior distribution, mean, and standard deviation of boarding time T1 of this passenger as(14)PiT1=DTj−t0=pij,i=1,…,n,j=1,…,mi,EiT1=∑j=1mipijDTj−t0,sdiT1=∑j=1mipijDTj−t02−∑j=1mipijDTj−t021/2,respectively, and the estimators of pij in (13) can be plugged in the above equations to give estimated values.For one-transfer trips, the MPTAM formula is(15)pijk=Pthe passenger took thejth feasible itinerary on segment1and thekth feasible itinerary on segment2|t0,ti=fti−ATk2ρjkt0∑k=1K∑j=1mikfti−ATk2ρjkt0.The posterior distributions, means, and standard deviations of boarding timeT1 and transfer time T2 of this passenger are(16)PiT1=DTj1−t0=∑k=1Kpijk,j=1,…,mk,EiT1=∑k=1K∑j=1mkpijkDTj1−t0,sdiT1=∑k=1K∑j=1mkpijkDTj1−t02−∑k=1K∑j=1mkpijkDTj1−t021/2,PiT2=DTk2−ATj1=pijk,k=1,…,K,j=1,…mk,EiT2=∑k=1K∑j=1mkpijkDTk2−ATj1,sdiT2=∑k=1K∑j=1mkpijkDTk2−ATj12−∑k=1K∑j=1mkpijkDTk2−ATj121/2,respectively. Estimators of the above quantities can be computed based on the estimators of ρ and f in Section 3.


## 5. Simulation Study

### 5.1. No-Transfer Cases

In this section, we conduct a simulation study to evaluate the proposed Bayesian method for no-transfer situations. Consider the combinations of parameters as(17)a.μ,σ=0,0.5,b.μ,σ=0.7,0.3,1°.π1,π2=0.5,0.5,2°.π1,π2=0.7,0.3,3°.π1,π2,π3=0.1,0.3,0.6,4°.π1,π2,π3=0.8,0.1,0.1.We assume that all passengers tap in at time 0, and letAT1=2,AT2=4,AT3=6,…, DT1=3,DT2=5,DT3=7,…, (unit: minute). According to each parameter combination, we generate n tap-out times t1,…,tn with n=100 and 300, and then use the proposed Bayesian method in Section 2 to estimate the parameters. The R package MCMC is adopted to implement the Bayesian inference. Root mean square errors (RMSEs) over 100 replicates are displayed in Table 1. It can be seen that our method can yield accurate estimation as n increases.Table 1
RMSEs in Section5.1 (root standard deviations in parentheses).
1°2°3°4°(a)n=1000.0760.0810.0890.0820.2140.2120.0850.072n=3000.0540.0470.0480.0500.1480.1480.0540.045(b)n=1000.0850.0870.0750.0700.1760.1640.0810.085n=3000.0390.0320.0450.0390.1180.1220.0460.040


### 5.2. One-Transfer Cases

We next conduct a simulation study for one-transfer cases. The following parameter combinations are considered:(18)a.μ,σ=0,0.5,b.μ,σ=0.7,0.3,1°.ρ11,ρ21=0.5,0.5,2°.ρ11,ρ21=0.7,0.3,3°.ρ11,ρ21,ρ12,ρ22=0.4,0.1,0.4,0.1,4°.ρ11,ρ21,ρ12,ρ22=0.4,0.3,0.2,0.1.We assume that all passengers tap in at time 0, and letAT11=2,AT11=4, DT12=5,DT22=7,DT32=9,… (unit: minute). Observations of tap-out times are generated according to each parameter combination with n=100 and 200. In the proposed Bayesian method, we use the method in the last paragraph of Section 3 to determine the hyperparameters α in (7). We first compute the estimators τ^k,k=1,…,K. Since there are no data to estimate δjk,j=1,…,mk,k=1,…,K, we randomly generate δjk in ρjk−ε,ρjk+ε with ε>0. The hyperparameters are set as αjk=τ^kδjk,j=1,…,mk,k=1,…,K. The value of ε describes the distance between δjk and ρjk. The lesser the ε, the more informative the prior.We also use theR package MCMC to implement the Bayesian inference proposed in Section 3. For ε=0.05 and ε=0.025, root mean square errors (RMSEs) of our estimators over 100 replicates are shown in Table 2. As expected, the proposed estimators perform well with small ε.Table 2
RMSEs in Section5.2 (root standard deviations in parentheses).
1°2°3°4°(a)ε=0.05n=1000.1110.1130.1340.1520.2670.1920.2050.164n=2000.0430.0270.0600.0310.1980.1550.1350.072ε=0.025n=1000.0850.0530.0650.0570.1090.0580.1410.152n=2000.0320.0170.0370.0290.0830.0590.1180.077(b)ε=0.05n=1000.1440.1370.1410.1310.1790.1130.2240.176n=2000.0640.0690.0330.0330.0600.0370.1760.075ε=0.025n=1000.0910.0810.0760.0200.0540.0470.1610.089n=2000.0340.0270.0170.0150.0260.0200.1260.055


## 5.1. No-Transfer Cases

In this section, we conduct a simulation study to evaluate the proposed Bayesian method for no-transfer situations. Consider the combinations of parameters as(17)a.μ,σ=0,0.5,b.μ,σ=0.7,0.3,1°.π1,π2=0.5,0.5,2°.π1,π2=0.7,0.3,3°.π1,π2,π3=0.1,0.3,0.6,4°.π1,π2,π3=0.8,0.1,0.1.We assume that all passengers tap in at time 0, and letAT1=2,AT2=4,AT3=6,…, DT1=3,DT2=5,DT3=7,…, (unit: minute). According to each parameter combination, we generate n tap-out times t1,…,tn with n=100 and 300, and then use the proposed Bayesian method in Section 2 to estimate the parameters. The R package MCMC is adopted to implement the Bayesian inference. Root mean square errors (RMSEs) over 100 replicates are displayed in Table 1. It can be seen that our method can yield accurate estimation as n increases.Table 1
RMSEs in Section5.1 (root standard deviations in parentheses).
1°2°3°4°(a)n=1000.0760.0810.0890.0820.2140.2120.0850.072n=3000.0540.0470.0480.0500.1480.1480.0540.045(b)n=1000.0850.0870.0750.0700.1760.1640.0810.085n=3000.0390.0320.0450.0390.1180.1220.0460.040


## 5.2. One-Transfer Cases

We next conduct a simulation study for one-transfer cases. The following parameter combinations are considered:(18)a.μ,σ=0,0.5,b.μ,σ=0.7,0.3,1°.ρ11,ρ21=0.5,0.5,2°.ρ11,ρ21=0.7,0.3,3°.ρ11,ρ21,ρ12,ρ22=0.4,0.1,0.4,0.1,4°.ρ11,ρ21,ρ12,ρ22=0.4,0.3,0.2,0.1.We assume that all passengers tap in at time 0, and letAT11=2,AT11=4, DT12=5,DT22=7,DT32=9,… (unit: minute). Observations of tap-out times are generated according to each parameter combination with n=100 and 200. In the proposed Bayesian method, we use the method in the last paragraph of Section 3 to determine the hyperparameters α in (7). We first compute the estimators τ^k,k=1,…,K. Since there are no data to estimate δjk,j=1,…,mk,k=1,…,K, we randomly generate δjk in ρjk−ε,ρjk+ε with ε>0. The hyperparameters are set as αjk=τ^kδjk,j=1,…,mk,k=1,…,K. The value of ε describes the distance between δjk and ρjk. The lesser the ε, the more informative the prior.We also use theR package MCMC to implement the Bayesian inference proposed in Section 3. For ε=0.05 and ε=0.025, root mean square errors (RMSEs) of our estimators over 100 replicates are shown in Table 2. As expected, the proposed estimators perform well with small ε.Table 2
RMSEs in Section5.2 (root standard deviations in parentheses).
1°2°3°4°(a)ε=0.05n=1000.1110.1130.1340.1520.2670.1920.2050.164n=2000.0430.0270.0600.0310.1980.1550.1350.072ε=0.025n=1000.0850.0530.0650.0570.1090.0580.1410.152n=2000.0320.0170.0370.0290.0830.0590.1180.077(b)ε=0.05n=1000.1440.1370.1410.1310.1790.1130.2240.176n=2000.0640.0690.0330.0330.0600.0370.1760.075ε=0.025n=1000.0910.0810.0760.0200.0540.0470.1610.089n=2000.0340.0270.0170.0150.0260.0200.1260.055


## 6. Case Study

### 6.1. Two No-Transfer Routes

In this section, we apply our method to analyse several datasets from Beijing metro. The Beijing metro system is complex with 311 stations and 23 lines [22]. We first consider two no-transfer routes in Line 6 of Beijing metro as follows:Route 1from Qingnianlu to Dongdaqiao (4 stops)Route 2from Huangqu to Dongdaqiao (6 stops)For Route 1, there are 25 and 649 trips collected during off-peak and peak hours, respectively. For Route 2, we have the corresponding data of sample sizes 15 and 525, respectively. All the data were extracted from weekdays in one month of 2019 at tap-in time 7:00 am (peak hour) and 1:00 pm (off-peak hour). We conduct the Bayesian inferential method in Section2 via the R package MCMC. Table 3 presents the results of estimated parameters. The point estimators (posterior means) and interval limits of 95% credible intervals are reported. From Table 3, we can see that π2 is larger than π1 in Route 1 during off-peak hours, and this is most likely because the passengers’ tap-in times are very close to the departure time of the first train. Besides, during peak hours, the values of probabilities are not highly concentrated on one, which reflects the presence of crowded stations at that time. The origin station of Route 1, Qingnianlu, lies in Route 2, and the passengers in Route 1 are more difficult to get on the train than Route 2 during peak hours, which is reflected by the fact that π3 and π4 of Route 1 are larger than those of Route 2.Table 3
Estimated parameters in Section6.1
Off-peak hourμσπ1π2π3Route 1Lower limit−0.1600.2460.0090.8550.002Point estimator−0.0100.3040.0720.8850.044Upper limit−0.0510.3600.1220.9140.128Route 2Lower limit−0.1470.4510.8200.104Point estimator−0.0460.5100.8640.136Upper limit0.0170.5450.8960.180Peak hourμσπ1π2π3π4π5Route 1Lower limit−0.1000.3110.0040.4140.2620.1450.091Point estimator−0.0720.3230.0110.4320.2810.1670.108Upper limit−0.0500.3350.0190.4570.2960.1850.126Route 2Lower limit−0.0280.3030.4730.2380.1340.0460.019Point estimator−0.0070.3210.4870.2630.1550.0620.033Upper limit0.0160.3440.5140.2830.1750.0840.048Figure2 depicts the density curves of the egress times, and Table 4 presents some characteristics including means, standard deviations (SDs), and modes of the estimated densities. These results show that there is no big difference in egress time between the peak and off-peak hours for both Route 1 and Route 2. This is because Dongdamen, the destination station of the two routes, is a relatively unpopular station in Line 6. Thus, even during peak hours, this station is not so crowded. The passengers on the crowded trains are more likely to get off at the next stations in Line 6.Figure 2
Density functions of egress times in Section6.1 (unit: minute). (a) Route 1. (b) Route 2.
(a)(b)Table 4
Characteristics of density functions in Section6.1 (unit: minute).
Peak hourOff-peak hourMeanSdModeMeanSdModeRoute 10.9800.3250.8381.0370.3230.903Route 21.0450.3440.8961.0760.5660.736Besides parameter estimation, as mentioned in Section4, we can infer boarding times of the passengers. Table 5 presents the means and limits of 95% credible interval of boarding times. We can see that the boarding times of peak and off-peak hours are close in Route 1, and this is because the headway between every two trains during off-peak hours is longer than that during peak hours. On the other hand, the boarding times in Route 1 are longer than those in Route 2, which is consistent to the fact that π1 in Route 1 is much less than that in Route 2.Table 5
Characteristics of boarding times in Section6.1 (unit: minute).
Peak hourOff-peak hourMeanSdMeanSdRoute 1Lower limit5.4602.4505.3601.501Point estimator5.5742.4505.7871.737Upper limit5.6822.6366.5361.901Route 2Lower limit4.5992.4592.8151.559Point estimator4.7352.6092.9761.747Upper limit4.9012.7883.2041.961We next present an application of our method in individual inference with MPTAM. We take Route 1 during peak hours for example and let(19)pjt=Pthe passenger took itineraryj|t0=7:00am,ti=t.for j=1,…,5. Using (13), we compute the values of pj for given t and show their curves in Figure 3. It can be seen that p1,p2,p3,p4, and p5 are very close to 1 within a certain period of time. Besides, we find that the uncertainties of them are very small since the uncertainties of the estimators of θ have little effect on f·|θ. We also compute the mean boarding times of the passenger whose tap-out time is t, Et=∑j=15pjtDTj−t0, and show its curve in Figure 4. As expected, the curve increases with a ladder-like shape as t increases.Figure 3
Curves ofp1,…,p5 in Section 6.1.Figure 4
A curve ofET1|ti=t in Section 6.1.


### 6.2. A One-Transfer Route

The AFC and AVL data used here are from a one-transfer route in Beijing metro in 15 weekdays of 2018. The first and second segments of this one-transfer route both contain six stops. We haven=359 passengers’ AFC data, and their tap-in times are all 8:00 am. Due to a confidentiality agreement with the organization that provides the data, the original data including the station and train information cannot be open.The proposed Bayesian method is used to analyse the passengers’ tap-out times,t1,…,tn. The hyperparameters are specified by the method in Section 3 based on 52 passengers’ data of the second segment. Table 6 shows the parameter estimation results. We can see that the passengers’ boarding probabilities, ρ11,…,ρ33, are dispersed. This indicates that there were many left-behind passengers during peak hours because of crowded platforms and train carriages. Table 7 gives the means and limits of 95% credible intervals of boarding times and transfer times. Compared with the train headway (about two minutes), the boarding and transfer times seem too long, and this may reflect uncomfortable travel experience of the passengers.Table 6
Results of estimated parameters for Beijing metro of one-transfer cases.
μσρ11ρ21ρ31ρ12ρ22ρ32ρ13ρ23ρ33Lower limit0.0100.5130.0000.2070.2870.0650.2130.1960.0000.0000.000Point estimator0.0150.5190.0040.2110.2890.0670.2160.2060.0010.0000.007Upper limit0.0190.5340.0160.2170.2930.0720.2180.2090.0020.0010.012Table 7
Characteristics of the boarding and transfer times in Section6.2 (unit: minute).
Boarding timeTransfer timeMeanSdMeanSdLower limit4.3951.7043.5411.909Point estimator4.4461.7093.5611.916Upper limit4.4711.7153.5811.937Similar to the no-transfer situation, we compute(20)pjkt=Pthe passenger took thejth feasible itinerary in segment1and thekth feasible itinerary in segment2|t0=0,ti=t,for j=1,2,3,k=1,2,3 based on our estimators and MPTAM (15). Figure 5 shows their trajectories. For an individual passenger, we can use his/her tap-out time to infer which combination of itineraries he/she may take via the trajectories.Figure 5
Curves ofp11,…,p23 in Section 6.2.Figure6 shows the curves of ET1|ti=t and ET2|ti=t computed by (9) and (10). They can be used to infer the mean boarding and transfer times of an individual passenger given his/her tap-out time.Figure 6
Curves ofET1|ti=t and ET2|ti=t in Section 6.2.


## 6.1. Two No-Transfer Routes

In this section, we apply our method to analyse several datasets from Beijing metro. The Beijing metro system is complex with 311 stations and 23 lines [22]. We first consider two no-transfer routes in Line 6 of Beijing metro as follows:Route 1from Qingnianlu to Dongdaqiao (4 stops)Route 2from Huangqu to Dongdaqiao (6 stops)For Route 1, there are 25 and 649 trips collected during off-peak and peak hours, respectively. For Route 2, we have the corresponding data of sample sizes 15 and 525, respectively. All the data were extracted from weekdays in one month of 2019 at tap-in time 7:00 am (peak hour) and 1:00 pm (off-peak hour). We conduct the Bayesian inferential method in Section2 via the R package MCMC. Table 3 presents the results of estimated parameters. The point estimators (posterior means) and interval limits of 95% credible intervals are reported. From Table 3, we can see that π2 is larger than π1 in Route 1 during off-peak hours, and this is most likely because the passengers’ tap-in times are very close to the departure time of the first train. Besides, during peak hours, the values of probabilities are not highly concentrated on one, which reflects the presence of crowded stations at that time. The origin station of Route 1, Qingnianlu, lies in Route 2, and the passengers in Route 1 are more difficult to get on the train than Route 2 during peak hours, which is reflected by the fact that π3 and π4 of Route 1 are larger than those of Route 2.Table 3
Estimated parameters in Section6.1
Off-peak hourμσπ1π2π3Route 1Lower limit−0.1600.2460.0090.8550.002Point estimator−0.0100.3040.0720.8850.044Upper limit−0.0510.3600.1220.9140.128Route 2Lower limit−0.1470.4510.8200.104Point estimator−0.0460.5100.8640.136Upper limit0.0170.5450.8960.180Peak hourμσπ1π2π3π4π5Route 1Lower limit−0.1000.3110.0040.4140.2620.1450.091Point estimator−0.0720.3230.0110.4320.2810.1670.108Upper limit−0.0500.3350.0190.4570.2960.1850.126Route 2Lower limit−0.0280.3030.4730.2380.1340.0460.019Point estimator−0.0070.3210.4870.2630.1550.0620.033Upper limit0.0160.3440.5140.2830.1750.0840.048Figure2 depicts the density curves of the egress times, and Table 4 presents some characteristics including means, standard deviations (SDs), and modes of the estimated densities. These results show that there is no big difference in egress time between the peak and off-peak hours for both Route 1 and Route 2. This is because Dongdamen, the destination station of the two routes, is a relatively unpopular station in Line 6. Thus, even during peak hours, this station is not so crowded. The passengers on the crowded trains are more likely to get off at the next stations in Line 6.Figure 2
Density functions of egress times in Section6.1 (unit: minute). (a) Route 1. (b) Route 2.
(a)(b)Table 4
Characteristics of density functions in Section6.1 (unit: minute).
Peak hourOff-peak hourMeanSdModeMeanSdModeRoute 10.9800.3250.8381.0370.3230.903Route 21.0450.3440.8961.0760.5660.736Besides parameter estimation, as mentioned in Section4, we can infer boarding times of the passengers. Table 5 presents the means and limits of 95% credible interval of boarding times. We can see that the boarding times of peak and off-peak hours are close in Route 1, and this is because the headway between every two trains during off-peak hours is longer than that during peak hours. On the other hand, the boarding times in Route 1 are longer than those in Route 2, which is consistent to the fact that π1 in Route 1 is much less than that in Route 2.Table 5
Characteristics of boarding times in Section6.1 (unit: minute).
Peak hourOff-peak hourMeanSdMeanSdRoute 1Lower limit5.4602.4505.3601.501Point estimator5.5742.4505.7871.737Upper limit5.6822.6366.5361.901Route 2Lower limit4.5992.4592.8151.559Point estimator4.7352.6092.9761.747Upper limit4.9012.7883.2041.961We next present an application of our method in individual inference with MPTAM. We take Route 1 during peak hours for example and let(19)pjt=Pthe passenger took itineraryj|t0=7:00am,ti=t.for j=1,…,5. Using (13), we compute the values of pj for given t and show their curves in Figure 3. It can be seen that p1,p2,p3,p4, and p5 are very close to 1 within a certain period of time. Besides, we find that the uncertainties of them are very small since the uncertainties of the estimators of θ have little effect on f·|θ. We also compute the mean boarding times of the passenger whose tap-out time is t, Et=∑j=15pjtDTj−t0, and show its curve in Figure 4. As expected, the curve increases with a ladder-like shape as t increases.Figure 3
Curves ofp1,…,p5 in Section 6.1.Figure 4
A curve ofET1|ti=t in Section 6.1.


## 6.2. A One-Transfer Route

The AFC and AVL data used here are from a one-transfer route in Beijing metro in 15 weekdays of 2018. The first and second segments of this one-transfer route both contain six stops. We haven=359 passengers’ AFC data, and their tap-in times are all 8:00 am. Due to a confidentiality agreement with the organization that provides the data, the original data including the station and train information cannot be open.The proposed Bayesian method is used to analyse the passengers’ tap-out times,t1,…,tn. The hyperparameters are specified by the method in Section 3 based on 52 passengers’ data of the second segment. Table 6 shows the parameter estimation results. We can see that the passengers’ boarding probabilities, ρ11,…,ρ33, are dispersed. This indicates that there were many left-behind passengers during peak hours because of crowded platforms and train carriages. Table 7 gives the means and limits of 95% credible intervals of boarding times and transfer times. Compared with the train headway (about two minutes), the boarding and transfer times seem too long, and this may reflect uncomfortable travel experience of the passengers.Table 6
Results of estimated parameters for Beijing metro of one-transfer cases.
μσρ11ρ21ρ31ρ12ρ22ρ32ρ13ρ23ρ33Lower limit0.0100.5130.0000.2070.2870.0650.2130.1960.0000.0000.000Point estimator0.0150.5190.0040.2110.2890.0670.2160.2060.0010.0000.007Upper limit0.0190.5340.0160.2170.2930.0720.2180.2090.0020.0010.012Table 7
Characteristics of the boarding and transfer times in Section6.2 (unit: minute).
Boarding timeTransfer timeMeanSdMeanSdLower limit4.3951.7043.5411.909Point estimator4.4461.7093.5611.916Upper limit4.4711.7153.5811.937Similar to the no-transfer situation, we compute(20)pjkt=Pthe passenger took thejth feasible itinerary in segment1and thekth feasible itinerary in segment2|t0=0,ti=t,for j=1,2,3,k=1,2,3 based on our estimators and MPTAM (15). Figure 5 shows their trajectories. For an individual passenger, we can use his/her tap-out time to infer which combination of itineraries he/she may take via the trajectories.Figure 5
Curves ofp11,…,p23 in Section 6.2.Figure6 shows the curves of ET1|ti=t and ET2|ti=t computed by (9) and (10). They can be used to infer the mean boarding and transfer times of an individual passenger given his/her tap-out time.Figure 6
Curves ofET1|ti=t and ET2|ti=t in Section 6.2.


## 7. Conclusion

In this article, we build statistical models for AFC data in both no-transfer and one-transfer cases, and then propose a Bayesian approach to estimate the parameters in the models. These estimators can be used in many measures for describing degrees of congestion and comfort in metro passenger flows. Applications to simulated and real datasets indicate that our approach is effective.Compared with the maximum-likelihood estimation, the Bayesian method possesses some appealing features including flexibility in small-sample cases, improvement in model identifiability, and quantification of uncertainty. With appropriate prior information, it is a very useful tool for analysing metro data. Based on automated data, we will extend our approach to more complex situations in metro systems such as those with more than one route choices in the future. In addition, the log-normal assumption for the egress time may be violated if the station has more than one exits [16]. A future topic is to apply Bayesian nonparametric density estimation methods to such situations.



---

*Source: 9925939-2022-03-15.xml*