The visitor
“The route exists. But can I rely on the next bus?”
A service that is difficult to interpret is difficult to recommend and revisit.
You follow the timetable to know when the bus should arrive. What you actually experience is the difference between that scheduled arrival and the moment the bus finally appears.
When service has no dependable rhythm, regular riders adapt through local knowledge. Visitors, occasional passengers and people returning after time away cannot.
Watch the spacing collapseOnce buses enter the road, different travel times and stopping times reshape the intervals between them. A bus can lose time while the one behind finds a clearer road.
The operational problem is not only lateness. It is whether the service still has a usable rhythm.
A headway is the time between consecutive buses. Headway deviation compares that observed gap with the planned gap. A negative signed deviation means buses are drawing closer than planned; a positive deviation means the service gap is widening.
A route can exist on a map and still feel absent. Fleet presence is not the same as even service coverage.
“The route exists. But can I rely on the next bus?”
A service that is difficult to interpret is difficult to recommend and revisit.
“I can tolerate ten minutes. I cannot plan around an unknown gap.”
Irregular spacing makes a low-frequency service feel less available.
“The buses are on the road. Why does the service still feel absent?”
The missing view is the service pattern between vehicles.
Reliability is part of whether a city feels navigable.
Drivers see the road immediately around them. Geospatial analytics connects each vehicle to the wider route, the bus ahead, the bus behind and the service pattern passengers experience.
GPS becomes operational evidence when positions are sequenced by vehicle, direction, stop and road segment.
GPS observations are filtered by trip completeness and direction, then clustered into local route segments. Within-cluster dispersion, silhouette score, Calinski-Harabasz score and Davies-Bouldin score help compare candidate segmentations.
For each two-dimensional cluster, the ratio of the smaller covariance eigenvalue to the larger one indicates departure from a nearly straight path. Bearing distributions add directional evidence for straight roads, curves and junctions.
Distance and velocity produce a travel-time estimate for each small segment. These local contributions are accumulated between stops, letting the analysis identify where spacing changes rather than assigning the whole effect to the route.
Outlier GPS points, sparse trajectories, trips covering too little of the route and observations with uncertain stop matching must be filtered or flagged. Segmentation quality is a prerequisite for reliable headway decomposition.
Preserve the sign of each contribution. Travel and dwell effects can reinforce or cancel one another, so diagnosis must precede intervention.
The following bus is two minutes closer than planned.
δHm = δL1 + Σ δTr + Σ δDk
Initial lateness, route-segment travel differences and stop dwell differences are accumulated as signed quantities. Take the absolute value only when reporting the final deviation magnitude. Taking separate absolute values first would erase cancellation and can overstate the result.
The dispatch point supplies the starting condition. Separating it from later route effects prevents origin delay from being confused with road or stop behaviour.
Each route segment contributes the difference between the front and following bus travel times. Position, distance, velocity and direction locate that contribution geographically.
Arrival and departure evidence estimates how long each bus serves a stop. Differences accumulate and may either widen the gap or allow the following bus to catch up.
A positive road contribution can offset a negative dwell contribution. The signs must remain intact until the cumulative deviation has been calculated.
A daily average can hide repeated spacing collapse near one junction, stop or slow segment. Read the route in smaller spatial units.
Route segmentation assigns travel-time differences to smaller geographic units. Position, bearing, speed and stop dwell can then be interpreted in road context rather than collapsed into a single route-wide value.
The advocated forecasting model is a bidirectional long short-term memory network with multi-head attention. It learns sequential travel and dwell patterns across the route, while the geospatial features tell the model where each change occurred.
Ordered position, route segment, stop sequence, speed, bearing, travel time, dwell time, current headway, scheduled headway, direction and time features. Weather or event variables can be added when reliable data exists.
It models non-linear sequential dependence without requiring a separate linear model for every stop. Forward and backward context can be used inside a fixed observed sequence during model training and reconstruction.
Multiple attention heads learn which earlier stops, road segments and timing conditions are most informative for the current prediction. Attention weights support investigation, but they are not proof of causality.
K-nearest-neighbour imputation with inverse-distance weighting offers a fast local estimate for sparse GPS sequences. MICE is a heavier alternative when compute and richer covariates are available.
Use walk-forward validation, route and direction specific splits, dropout, early stopping and versioned preprocessing. Positional normalisation can help the network model progression through the route while respecting ordered arrivals.
Compare MAE and RMSE with a historical median, timetable and persistence baseline. Evaluate by route, direction, demand period and forecast horizon, then monitor drift after deployment.
Important limitation: a BiLSTM recommendation is only as reliable as its GPS coverage, stop matching and operating data. It supports dispatch judgement. It does not establish operational certainty.
Dispatch is a control decision, not merely a bus count.
Without intervention, a local loss of spacing becomes a passenger-facing gap.
Diagnose first. Dispatch second.
Reduce headway deviation without ignoring passenger waiting, fleet limits and the cost of intervention.
Keep observed gaps close to the target gap.
Reduce prolonged unserved intervals, not only average lateness.
Respect vehicle availability, turnaround and dispatch limits.
Compare additional cost with the expected service benefit.
minπ wHJH(π) + wWJW(π) + wBJB(π) + wCJC(π)
This is a proposed decision-support framing, not a validated optimiser from the project. The terms represent headway deviation, passenger waiting, severe bunching and intervention cost. A deployable policy requires measured demand, fleet availability, turnaround rules and calibrated weights.
A policy specifies whether to hold, release or add a bus, and when that action occurs. Candidate policies are evaluated over a forecast horizon rather than chosen from the current gap alone.
Fleet availability, driver availability, minimum and maximum headway, terminal capacity, turnaround time and service obligations define the feasible set.
Sensitivity analysis should vary model errors, demand, travel time and intervention cost. A robust recommendation remains useful across a credible range of inputs.
The selected intervention should improve severe gaps without creating new bunching elsewhere. Operators receive the expected benefit, required resources and conditions that could invalidate the result.
This instructional simulator uses transparent example values. It does not claim to reproduce measured operations or issue an automatic command.
The current gap is wider than the target and one pair is already close together.
No driver availability, terminal congestion, temporary road recovery or inaccurate passenger-demand estimates.
The recommendation is a scenario result, not an automatic command.
A usable recommendation remains conditional on information that may be late, incomplete or unavailable.
Statistics narrows the decision. Operations authorises it.
Geospatial analytics makes the service visible as a system. It shows where buses are, how the spacing changes and where an intervention may restore a usable rhythm.
Measure the gap. Understand the cause. Test the dispatch.