BUS TRAVEL TIME PREDICTION USING SUPPORT VECTOR MACHINES FOR HIGH VARIANCE CONDITIONS

. Real-time bus travel time prediction has been an interesting problem since past decade, especially in India. Popular methods for travel time prediction include time series analysis, regression methods, Kalman filter method and Artificial Neural Network (ANN) method. Reported studies using these methods did not consider the high variance situations arising from the varying traffic and weather conditions, which is very common under heterogeneous and lane-less traffic conditions such as the one in India. The aim of the present study is to analyse the variance in bus travel time and predict the travel time accurately under such conditions. Literature shows that Support Vector Machines (SVM) technique is capable of performing well under such conditions and hence is used in this study. In the present study, nu-Support Vector Regression (SVR) using linear kernel function was selected. Two models were developed, namely spatial SVM and temporal SVM, to predict bus travel time. It was observed that in high mean and variance sections, temporal models are performing better than spatial. An algorithm to dynamically choose between the spatial and temporal SVM models, based on the current travel time, was also developed. The unique features of the present study are the traffic system under consideration having high variability and the variables used as input for prediction being obtained from Global Positioning System (GPS) units alone. The adopted scheme was implemented using data collected from GPS fitted public transport buses in Chennai (India). The performance of the proposed method was compared with available methods that were reported under similar traffic conditions and the results showed a clear improvement.


Introduction
One of the key elements in ATIS and APTS is to predict vehicle travel time or arrival time with reasonable accuracy. This would have been an easy task if the deviations in travel times were minimal or having less uncertainty. However, these deviations are mainly due to traffic signals, congestion, and weather condition, where the uncertainty is high. The variability and uncertainty in travel time is much higher in a heterogeneous and lane-less traffic condition such as the one existing in India. Manually operated signals and presence of pedestrians and animal drawn carts in the traffic stream adds to these complexities. Developing a model that can take into account all these factors is a challenging task. Existing literature mainly focused on three types of models for travel time prediction: time series (Rajbhandari 2005;Suwardo et al., 2010;Kumar, Vanajakshi 2012), ANN (Jeong, Rilett 2004;Ramakrishna et al. 2006;Kumar et al. 2014b;Fan, Gurmu 2015;Chen et al. 2007;Vanajakshi, Rilett 2004;Mazloumi et al. 2011), and KFTs (Liu et al. 2014;Nanthawichit et al. 2003;Shalaby, Farhan 2004;Vanajakshi et al. 2009;Padmanaban et al. 2010;Chu et al. 2005;Kumar et al. 2014a). There were only a few studies that paid special attention to high variability issue (Mazloumi et al. 2011) using ANN. None of the studies paid special attention to address the high variability issue under heterogeneous and lane-less traffic conditions that are leading to higher prediction errors on certain sections and trips. This may be because the model equations used in those studies were developed based on simple equations for characterizing the evolution of travel time. SVM has been reported as a forecasting tool that can perform well with uncertainty in several areas in recent years (Yu et al. 2006(Yu et al. , 2010aWu et al. 2003;Vanajakshi, Rilett 2004. SVM is a specific type of learning algorithm characterized by the use of kernel functions. SVM theory mainly depends on SRM principle to estimate a function by minimizing an upper bound of the generalization error. SVM is shown to be very resistant to over fitting problem (Vapnik 1999). Another important property of the SVM is that training SVM is equivalent to solving a linearly constrained quadratic programming problem so that the solution of SVM is always unique and globally optimal, unlike other network training that requires nonlinear optimization, which may lead to local minima. Table 1 presents a summary of the studies that used SVM to predict bus travel time along with the corresponding traffic conditions and variables considered.
In the present study, a reliable system for real-time bus travel time prediction paying special attention to the high variability condition was developed using nu-SVR. The optimum amount of data required to predict the next trip was identified by ApEn technique and performance of the proposed method was compared with a model based approach (Vanajakshi et al. 2009) that was reported to be performing well under Indian traffic conditions. The validation was done for a selected bus route in Chennai (India), which are equipped with GPS.

Literature review
Various techniques have been reported in literature for the prediction of travel time. These include approaches such as historical and real-time averaging, statistical analyses (Yu et al. 2017;Bian et al. 2015;Xu, Ying 2017), dynamical systems approach and machine-learning techniques. Each of these techniques has its own advantages and disadvantages in terms of data requirement, variables involved and complexity of analysis. Historical and real-time averaging methods are sufficient under expected traffic conditions without much variation. However, under unexpected traffic conditions where the variability is high, their accuracy will be greatly reduced (Jeong, Rilett 2004;Shalaby, Farhan 2004;Vanajakshi, Rilett 2007). Regression methods will predict the dependent variable (travel time) using a set of independent variables that can affect travel time (Abdelfattah, Khan 1998;Patnaik et al. 2004;Kwon et al. 2000;Ramakrishna et al. 2006;Yu et al. 2010b). However, it is difficult to identify and collect information on the exhaustive set of affecting variables (Cheng et al. 2010). Dynamical systems approaches develop models that can capture the dynamics of the system by establishing mathematical relationships between appropriate variables (Wall, Dailey 1999;Dailey et al. 2001;Cathey, Dailey 2003;Shalaby, Farhan 2004;Vanajakshi et al. 2009;Padmanaban et al. 2010;Kumar, Vanajakshi 2012Hans et al. 2015;Zhou et al. 2017;Kumar et al. 2017). However, it may not be always possible to develop explicit equations that can capture the system dynamics very efficiently. Machine learning techniques such as ANN (Chen et al. 2004;Ramakrishna et al. 2006;Jeong, Rilett 2004;Mazloumi et al. 2011) and SVM (Yu et al. 2006(Yu et al. , 2016Wu et al. 2003;Yang et al. 2016) are commonly used to predict travel time because of their ability to solve complex non-linear relation- ships. Out of these, SVM has proved to be one of the most effective tools for pattern recognition across different areas and hence is used in this study. A review of reported studies that used SVM for the prediction of traffic parameters are discussed below. Wu et al. (2003) and Vanajakshi, Rilett (2007) used SVM for travel time prediction and showed SVM giving better results compared to historic and real-time methods. Vanajakshi and Rilett (2004) used ANN and SVM to predict the traffic stream speed. The study reported SVM as a viable alternative to ANN for short term prediction of traffic parameters, especially when less data is available for training or when the training data has more variations. Yu et al. (2006) predicted the bus arrival time based on the travel time of current segment and the latest travel time of the next segment using SVM. Separate models were built according to the time-of-day and weather conditions. The developed models were tested using off-line data of a transit route and exhibited advantages over an ANN-based model. Yu et al. (2010b) developed SVM based models to predict bus arrival time based on speed data. Yu et al. (2010a) developed a hybrid model based on SVM and KFT and predicted the baseline travel times based on time-of-day, weather conditions, route segment, travel times on the current segment, and latest travel times on the predicted segment. Yu et al. (2011) proposed models to predict bus arrival times based on running times of multiple routes. They developed SVM, ANN, k-nearest neighbours algorithm and linear regression models to predict bus arrival time. Yu et al. (2016) proposed a model to predict bus travel time using SVM. The arrival time of bus was predicted by taking the time, weather and speed data as input. Yang et al. (2016) developed a model to predict bus arrival times using SVM with genetic algorithm. In the study, the characteristics of the time period, the length of road, weather, and bus speed were used as input vectors and genetic algorithm was used to identify the best parameters. From the above discussion, it can be seen that researchers found SVM technique to be producing better results when compared to ANN and other standard techniques for prediction problems. However, no significant studies have been reported using SVM to predict bus travel time under Indian traffic conditions, which differ largely from the conditions in western countries and is the focus of the present study. Studies reported to predict bus travel time under heterogeneous conditions, are discussed below. Ramakrishna et al. (2006) used NNs to predict the travel time under heterogeneous traffic conditions. They used travel time data from 25 trips of buses to develop ANN and MLR models. Results showed ANN performing better compared to MLR. Vanajakshi et al. (2009) used KFT to predict travel time under heterogeneous traffic conditions. They used preceding two bus trips data collected using GPS to predict next bus travel time. Padmanaban et al. (2010) extended the above study by incorporating the delays in the model. Kumar and Vana-jakshi (2014) proposed a statistical methodology to find out patterns in the data and used them as input to predict the next bus travel time using KFT. Kumar et al. (2014aKumar et al. ( , 2014b used GPS data to predict bus travel time using ANN and the obtained results were compared with KFT. Results showed that ANN gave better results when there is a large data set for network training. However, many of these studies reported higher errors on sections with high variability such as the ones with signals and bus stops (Fatima, Kumar 2014). This problem of high variability is of bigger concern under the heterogeneous and lane-less traffic. SVM has been reported to perform better when the data is having high variability (Vanajakshi, Rilett 2004) and hence can be a better tool for travel time prediction under such traffic conditions. A few studies were reported from the homogeneous traffic conditions addressing the issue of predicting travel time variability as discussed below. Fu, Rilett (1998) and Pattanamekar et al. (2003) presented a set of analytic functions for both mean and variance of travel times. Liu et al. (2005) developed a macroscopic model for urban link travel time prediction based on measurements collected by single loop detectors. The method divided travel times into two components as link cruising times and intersection delays. They then presented a set of analytic equations to derive the mean and the variance of link travel time. Li (2006) developed fuzzy NNs to predict mean travel time and used the S-shaped relationship to predict vehicle-to-vehicle travel time variability. Mazloumi et al. (2011) developed two separate ANN models to predict average bus travel time and its variability using traffic flow data, weather conditions and schedule adherence as input variables. The current study is one of the first attempts, where SVM technique is being used for bus travel time prediction for a traffic system with very high variance such as the heterogeneous and lane-less Indian traffic. In addition, the present study is different from the past literature in terms of the variables used in the prediction method. The present study used only the travel time collected using GPS units fitted in buses as input.

Data collection and preliminary analysis
Data were collected using GPS units that were fitted in MTC buses in the city of Chennai. The bus route selected for the present study is the Metropolitan Transport Corporation route number 19B, from Saidapet (within city area) to Kelambakkam (in the suburban area). It has a route length of 30 km having 21 major bus stops. The average time headway between two consecutive buses in this route was around 15…30 min. The selected route is shown in Figure 1. This road stretch passes through several types of urban roads with various land use characteristics such as commercial (Saidapet, SIPCOT, etc.), institutional areas (Hindustan Engineering College, Women's Polytechnic College, College of Engineering Guindy, etc.) and IT hubs (Navallur IT Park, Tidel Park, etc.). Sample photographs of the route, 19B at some of the locations are shown in Figure 1b. Under such traffic conditions, a mix of motorized vehicles such as passenger cars, buses, trucks, three wheelers, and two-wheelers would be moving along with non-motorized vehicles such as bicycles and animal drawn carts. All these vehicles share the same road space without any segregation for the various vehicle types as shown in Figure 1b. This will lead to high level of uncertainties and variability in travel time, which make the present study different from the studies that were reported in literature.
The collected GPS data includes the ID of the GPS unit, time stamp, and latitude and longitude of the location at which entry was made. From the collected data, the distance between two consecutive entries was calculated using the Haversine formulae (Chamberlain 1996). The processed data consists of travel times and corresponding distance between consecutive locations of all the buses. One month's data were considered for the analysis.
To start with, the entire route length was divided into smaller subsections of 500 m length and the time taken to cover each subsection was calculated using the linear interpolation technique. These data were analysed to find the variations in travel time. Figure 2a shows the variation in travel time across various sections in the considered study route and it can be observed that a few sections are experiencing high variability in travel time. To understand the reason for these high values, a closer look of the route was carried out and was observed that each of the peaks corresponded to a bus stop or intersection. Table 2 presents those details (column titled "Characteristics") along with their corresponding descriptive statistics such as average travel time, average speed, standard deviation and COV.
Next, variations in travel time over time of the day were analysed. For this, travel times experienced by all trips in individual sections were studied. Figure 2b and Figure 2c show, sample plots, one from subsection 7, a low variance subsection from the suburban area and other from subsection 47, a high variance subsection from the urban area. From Figure 2b, it can be observed that the travel times during 8:00…10:00 AM and 4:00…6:00 PM are relatively high, indicating morning and evening peak in traffic. In addition, it can be observed that the peak hours have more variance than those in off-peak hours. On the other hand, Figure 2c shows very little variation in travel time in this subsection over different time periods of the day. The main reason for this can be that the subsection is in the suburban area, where the traffic is less and the effect of peak and off-peak is not very prominent compared to the ones in urban areas (subsection 46) as shown in Figure 2b.
A similar analysis was carried out to study the effect of rain on bus travel time. Data were collected on 7 rainy days and the travel times were compared with the travel time of sunny days. Figure 2d shows the effect of rain on bus travel time for sample subsections. It can be seen that both mean and variance of travel time are higher on rainy days compared to sunny days.
Thus, it can be seen that sections in urban areas during peak hours and the sections with intersections or other obstructions experience more travel time and variability. In addition, weather changes such as rain causes variation in travel time.

SVM
From literature review, it was observed that a few studies predicted the variability in travel time separately using ANN and the total travel time using SVM under homogeneous traffic conditions, and none of the studies under heterogeneous traffic conditions. Earlier studies (Vanajakshi, Rilett 2004) stated SVM as a viable alternative to ANN for prediction of traffic parameters, when less amount of data is available for training or when the training data has more variations. Considering the high variation in travel time, particularly with the heterogeneous and lane-less traffic conditions, SVM seems to be a suitable candidate for prediction. The present study tries to predict bus travel time especially under these conditions using SVM and the details are presented below. SVM are learning systems that use a hypothetical space of linear functions in a high dimensional feature space, trained with a learning algorithm. This learning strategy was introduced by Vapnik (1999). The main idea behind SVM is that for a given training sample, the SVM construct a hyper plane as the decision surface in such a way that the margin of separation between positive and negative examples is maximized. SVM are based on the SRM inductive principle, which seeks to minimize an upper bound of the generalization error consisting of the sum of the training error and confidence level. In SVR, the basic idea is to map the data into high dimensional feature space via non-linear mapping and do linear regression in this space. This linear regression in high dimension space corresponds to non-linear regression in the low dimension input space.
Consider a set of training data points ( ) x y , where x n is an n-dimensional input vector such as previous travel times of current segment, and y n is the desired value. Let ˆn y be the predicted value such as travel time of next segment, and n is the number of training samples. Let the output data vector be in the form: ( ) (1) SVM approximates the function in Equation (1) using the following form: where: ( ) x φ represents the high dimensional feature spaces, which is nonlinearly mapped from the input space x; the coefficients w 0 , ω, etc. are estimated by solving a constrained optimization problem, which is done using Lagrangian multiplier method. The regression problem can be solved by using nu-SVR, which was proposed by Schölkopf et al. (2006). The basic optimization equations for nu-SVR is: cost function: with constraints as: n n n y y − = ε + ξ ; n n n y y ′ − = ε + ξ ; where: w -weights vector; c -regularization constant; nlower bound on the fraction of support vectors (a scalar bounded in between 0 and 1); e -width of the tube; x n , n ′ ξ -slack variables.
In dual form, the above can be represented as: with constraints as: where: L d -Lagrangian multiplier in dual form; α, α′ -Lagrangian multipliers; "-" -represents vector; m = 1, ..., N, n = 1, ..., N -denote N-dimensional vectors. e can be imagined as a tube, equivalent to the approximation accuracy placed on the training data points. If the predicted values are within this accuracy limit, the loss associated with that point is assumed as zero, and if the predicted point is outside this accuracy limit, the loss is taken as the magnitude of the difference between the predicted value and radius e of the tube. A large e can depreciate the approximation accuracy placed on training points. C is called the regularization constant. Increasing the value of C will result in the relative importance of the empirical risk with respect to the regularization term. Both C and e are user prescribed parameters. In this study, to predict the travel time for the next instances, LIBSVM tool box in MAT-LAB (https://www.mathworks.com/products/matlab.html) was used (Chang, Lin 2011), and the kernel function used was a linear kernel of the form: where: K -linear function; g -width parameter; coefcoefficient.

Model development using SVM
In the present study, two different prediction approaches were attempted using SVM, namely temporal and spatial. The temporal approach used the travel times of previous many trips of same subsection to predict next trip in that subsection, whereas the spatial approach used travel time of the same trip on previous many sections to predict next subsection travel time. Unlike earlier studies, the present study used only the travel time data collected using GPS units fitted in buses for the prediction. The details of input selection and SVM implementation are discussed separately in the sections below.

Prediction model considering spatial variation (spatial SVM)
Here, bus travel time was predicted by considering the spatial variation in travel time, where the travel time of the same trip on previous many subsections is used to predict the travel time of the next subsection. In order to identify the optimum inputs (number of previous subsections), ApEn technique was used. ApEn is a technique used to quantify the amount of regularity and the unpredictability of fluctuations in data over time (Pincus 1991). This algorithm was implemented for the current study to find the uncertainty associated with predicted travel time and was implemented using MATLAB. ApEn obtained for the training data with respect to number of previous sections is shown in Figure 3a. It can be observed in the figure that the uncertainty in the prediction is negligible after using travel time from previous five sections as input. Hence, previous five subsections travel time was selected as the input to predict the bus travel time in the next subsection. Thus, input vector to SVR was a five-dimensional matrix with previous five subsections travel times, and output vector consisted of corresponding next subsection travel time. Models were developed for each subsection separately using these identified inputs.

Prediction model considering temporal variation (temporal SVM)
In the case of temporal SVM, bus travel time was predicted by considering the temporal variation in travel time, meaning the travel time of the next trip was predicted using the travel time of previous trips in the same subsection. In this case, also, ApEn was used to find the optimum amount of data required to predict the next trip. Figure 3b shows the ApEn obtained for the training data with respect to number of previous trips. Here, it can be observed that the uncertainty in the prediction is negligible if previous six or more trips are used as input. Hence, previous six trips was selected as the input size to predict the next bus travel time in this case. Thus, input vector to SVR was a six-dimensional matrix with previous six trips travel time, and output vector consisted of corresponding next trip travel time and was developed for each subsection separately. SVM requires a good amount of training dataset, with inputs and the corresponding outputs. One month's data were used in this study, out of which 18 days data were used for training, 7 days data for cross-validation and the remaining data to test the performance. The descriptive statistics of these data sets are presented in Table 3 for selected subsections. During cross-validation, the model is simulated with the separate dataset kept for cross-validation to check the efficiency. During testing, the predicted value obtained from simulation were compared with the actual value. The common measures used for representing forecast accuracy are scale-dependent measures (based on the absolute error or squared errors, e.g. MAE or MSE), and measures based on percentage errors (scale independent, e.g. MAPE). Out of these MAPE is reported as one of the best (Makridakis 1993), and hence was reported in the current study along with correlation coefficient r, which are calculated as: where: r -correlation coefficient x i,a -actual travel time observed from the field; x i,p -predicted travel time value; a x -average of actual travel time; p x -average of predicted travel time.
Programs were written in MATLAB to generate input vector and output vector for training, validation and testing nu-SVR with linear kernel function was used. The four important unknown parameters of the kernel function were n (lower bound on the fraction of support vectors), g (width parameter), C (cost/penalty parameter), and coef (coefficient), and were obtained by cross-validation.

Performance evaluation
The results obtained from the implementation of the prediction methods presented in previous section, which will be referred as spatial SVM and temporal SVM, will be discussed in this section. Since the proposed algorithm uses significant historic data as inputs, a comparison was made with the earlier studies that reported the use of model based approaches (named as spatial KFT and temporal KFT). In spatial KFT approach (Vanajakshi et al. 2009), the travel time of a bus in an upcoming subsection was predicted using the travel time in the previous subsection. In temporal KFT approach (Kumar et al. 2014a(Kumar et al. , 2014b the travel time of a bus in a subsection was predicted using previous many buses travel times in the same subsection. Performance evaluation of the proposed methods was carried out by comparing the predicted values with the actual values over a period of one week for various trips and subsections. Evaluations were carried out separately for peak and off-peak conditions, low and high variance sections (suburban and urban) and rainy and sunny days, based on the findings from the preliminary data analysis and are presented below.

Performance comparison of peak and off-peak conditions
In this scenario, performance comparison was carried out for each of the trips in a day averaged across all sections. Figure 4a shows the performance of the proposed methods (temporal SVM and spatial SVM) for a representative day separated into peak and off-peak. To compare the performance, results using temporal KFT and spatial KFT are also shown in the plot. From Figure 4a, it can be observed that overall, the SVM models having lesser error than the corresponding KFT. On closer look, it can be seen that the temporal SVM performs the best during peak periods (8:00…10:00 AM and 4:00…7:00 PM), and both temporal and spatial SVM performing comparable during off-peak period. Overall, it can be stressed that during peak periods, when the variability is high, temporal SVM outperforms all the other methods.
Performance comparison across multiple days was also carried out and Figure 4b shows the results in terms of MAPE for the selected one-week test period. It can be observed here also that temporal SVM outperforms all the other approaches on majority of the days.

Performance comparison over subsections
Along with the comparison of performance over trips, a comparison over subsections was also made. Figure 5 shows a comparison between predicted travel times and actual travel times that were calculated for the maximum variability subsection (47) using temporal SVM. From Figure 5, it can be observed that the predicted values obtained from the temporal SVM are having a strong correlation with the actual travel times with a correlation coefficient of r = 0.897. A similar analysis has been carried out for all the subsections facing high variability and the results are presented in Table 4. From Table 4, it can be observed that the temporal SVM is performing better than the other methods for the subsections that are having high variability in travel time. From Table 4, it can be observed that the correlation coefficient obtained from temporal SVM is ranging from 0.72 to 0.94 for the sections that were facing high variability, indicating good performance (Cohen 1988;Evans 1995;Russo 2021). In addition, from Table 4, it can be observed that the temporal SVM is performing better than other methods.
In next level, the performance of the proposed spatial and temporal SVM methods were compared with the spatial and temporal KFT across all subsections of    the route for a sample day and the results are presented in Figure 6a. From Figure 6a, it can be observed that the spatial SVM is performing well in low variance sections and temporal SVM is performing better in sections that are having high variance (subsection ID's as shown in Table 2) within a MAPE of 20%. According to Lewis' scale of interpretation of prediction accuracy (Lewis 1982), any forecast with a MAPE value <10% can be considered highly accurate, 11…20% as good, 21…50% as reasonable and >51% as inaccurate. According to this, the prediction accuracy of the proposed method can be considered as good.
Performance comparison across multiple days was also carried out and Figure 6b shows the results in terms of MAPE for all sections along the route. It can be observed that temporal SVM outperforms all the other approaches in high variance sections and spatial SVM outperforms other approaches in low variance sections too.
Since, the user feels the error in terms of actual deviations, a performance comparison was also made over different subsections of 500 m length along the considered routes. Figure 6c shows the comparison of average deviation of predicted travel time for all high variability sections along the route (worst case sections) using both spatial and temporal models using KFT and SVM. From Figure 6c, it can be observed that the deviations obtained from temporal SVM were much lesser than the other methods (spatial SVM, spatial KFT and temporal KFT).
From the above results, it can be seen that SVM is performing better than KFT based methods and hence KFT results are not included in further analysis. Among the SVM approaches, temporal SVM was able to perform best under high variability conditions and was able to make better predictions. For the sections that were having lower variability, spatial SVM has slight advantage over temporal SVM methods. In addition, the data requirements are much lesser for spatial SVM since a temporal database is not required in that case. Hence, it would be ideal to use a combination of spatial and temporal SVM, with temporal being used for high variance sections alone and spatial SVM for all the other sections. However, this required a methodology to choose between spatial and temporal SVM for each subsection. For this, the thresholds were identified based on the mean and variance of the travel times of the subsection of interest. With these thresholds, a subsection was classified as LMLV subsection or HMHV subsection. Figure  7a and Figure 7b show variation in MAPE with increasing mean and standard deviation of travel time. From Figure  7a and Figure 7b, it can be observed that spatial SVM model is performing better than temporal SVM model if a sections' mean travel time is less than 100 s and standard deviation is less than 65 s. In other words, temporal models are performing better if the mean travel time of the subsection is more than 100 s and standard deviation is more than 65 s and hence these values were chosen as the threshold values.
Using the above identified thresholds, all the sections were classified into LMLV and HMHV so that suitable models can be applied to predict bus travel time. Figure 8 shows all the sections classified to LMLV and HMHV sections using the above identified thresholds.
From Figure 8, it can be seen that most of the HMHV sections are within the city area (trip starts in a suburban area and ends in the city area). However, depending on the traffic or other environmental conditions, a subsection, which is found to be LMLV may become HMHV and vice versa. For example, sections that fall under LMLV may become HMHV during peak hours. Thus, it will be more meaningful to classify these sections into LMLV or HMHV dynamically based on real-time conditions than the offline method discussed earlier. Therefore, an automated procedure was developed to select either of spatial SVM or temporal SVM, based on current travel times and is discussed next.

Automated systems performance
The above discussed methodology to identify HMHV and LMLV was automated by dynamically classifying each section under consideration to HMHV or LMLV by comparing the latest travel time obtained from each section with the identified threshold mean. Thus, no particular section will be fixed as LMLV or HMHV and vary dynamically depending on the latest data obtained from the field. Therefore, while implementing the prediction algorithm in real-time, the same section may use temporal or spatial SVM models based on recently reported travel times from that section. The optimum number of previous trips to be used for this was chosen heuristically corresponding to minimum MAPE. From the analysis, it was observed that the least MAPE was obtained when 3 previous trips travel times were used as input. Hence, the previous 3 trips were considered for calculating the mean and standard deviation, based on which choice between spatial or temporal SVM models would be made. Thus, if the mean of the 3 previous trips exceed 100 s, the temporal SVM models are used to predict the travel time and spatial models are used otherwise.
To illustrate the performance of the dynamic selection of prediction method, a sample rainy day was selected, in which the travel time variation was found to be very high as shown in Figure 9. Figure 9 shows the change in mean and standard deviation of travel time along different sections during rainy days. On comparing Figure 9 with Figure 8, it can be observed that subsections such as 48, 50, 54, and 55 became HMHV, which were originally LMLV. A detailed analysis of one of these sections, which changed from LMLV to HMHV, was carried out and results obtained are presented in Figure 10. Figure 10 shows a sample comparison of the predicted and measured travel times for a sample HMHV subsection using both fixed and dynamic models. It can be observed that dynamic model is able to capture the variations in this subsection better than the fixed model with a MAPE reduction from 27 to 13%. Results obtained for all such sections that changed between HMHV or LMLV are shown in Figure 11.
From Figure 11, it can be observed that dynamic model is able to capture the change in travel time better than fixed model, showing the advantage of automating the process.

Summary and conclusions
The heterogeneity and lack of lane discipline makes the Indian traffic highly varying and hence most of the existing solutions that were developed for homogeneous and lane disciplined traffic conditions may not work under such conditions. The present study was an attempt for developing a real-time bus arrival prediction system paying special attention to this high variance. Analysis was carried out using the GPS data collected from buses running in route number 19B in Chennai (India). The main highlights and contributions of the present study are: »» the present study developed a real-time bus arrival prediction system that can capture the variations in the system using SVM. This is one of the first attempts to use SVM for bus arrival time prediction for a traffic system with very high variance such as the heterogeneous and lane-less Indian traffic; »» one of the unique features of the present study in terms of the traffic system under consideration and the variables used as input for prediction. It used only the travel time collected using GPS units fitted in buses as inputs. Another difference from earlier studies is in terms of input quantity selection. The optimum amount of data required to predict the next trip travel time was found using ApEn technique; »» two models were developed, namely spatial SVM and temporal SVM, to predict bus travel time. It was observed that in high mean and variance sections, temporal models are performing better than spatial. An algorithm to dynamically choose between the spatial and temporal SVM models, based on the current travel time, was also developed. Results showed that this automated switching was able to capture the variations better and produce accurate results making it feasible for real-time field implementations. Overall, the present study focused on accurate travel time prediction by focusing more on sections that are facing high variability. The results showed that the automated system performance of the proposed prediction model was able to capture the variations in traffic conditions better than existing methods and produce accurate results making it feasible for field applications.