[{"data":1,"prerenderedAt":142},["ShallowReactive",2],{"\u002Fblog\u002F2026-01-15-arrival-estimates-for-a-city-bus":3},{"id":4,"title":5,"archiveType":6,"body":7,"category":126,"contextDate":127,"cover":128,"coverAlt":129,"date":130,"description":131,"extension":132,"featured":133,"historicalDate":130,"historicalLabel":127,"meta":134,"navigation":135,"path":136,"publishedDate":127,"seo":137,"stem":138,"thumbnail":127,"workPeriod":139,"writtenDate":140,"__hash__":141},"blogs\u002Fblog\u002F2026-01-15-arrival-estimates-for-a-city-bus.md","Arrival estimates for a city bus: what I would measure first now","retrospective",{"type":8,"value":9,"toc":119},"minimark",[10,14,17,20,25,28,63,66,70,76,82,88,94,100,106,110,113,116],[11,12,13],"p",{},"In 2017 and 2018 I was a co-founder and director of Hexon Data. I led the technical team that delivered live bus positions and arrival estimates for the PJ City Bus app for Majlis Bandaraya Petaling Jaya, and we worked on solid-waste fleet tracking and analytics in Petaling Jaya and Penang. Our software was used by two Malaysian local governments while I was there. I moved on in 2018.",[11,15,16],{},"I came to that work from research. As a TM R&D-sponsored scholar on a Master by Research at Multimedia University, I worked on deep learning for predicting network faults. The project was delivered and published in IJET in 2018, and I left before submitting a thesis. At Hexon I ran data-science experiments alongside the delivery work, and the bus app was where that kind of work met people waiting at a stop.",[11,18,19],{},"This month I have been thinking about the problem again. What follows is not a reconstruction of what we built. It is what I would measure first if I were handed the same problem today.",[21,22,24],"h2",{"id":23},"what-an-arrival-estimate-depends-on","What an arrival estimate depends on",[11,26,27],{},"On a phone, an arrival estimate is one number: seven minutes. Behind it sit several separate guesses, and any one of them can be wrong while the others are right.",[29,30,31,39,45,51,57],"ul",{},[32,33,34,38],"li",{},[35,36,37],"strong",{},"Where the bus is."," A position arrives every so often, with some error, and it is already old by the time anyone sees it.",[32,40,41,44],{},[35,42,43],{},"Where that position falls on the route."," A point on a map has to be matched to a route and a distance along it. Where routes overlap or loop back, the match can pick the wrong stretch.",[32,46,47,50],{},[35,48,49],{},"How long the remaining stretches will take"," at this hour, on this day.",[32,52,53,56],{},[35,54,55],{},"How long the bus will wait at each stop in between",", which depends on how many people are boarding.",[32,58,59,62],{},[35,60,61],{},"Whether the bus is serving this route at all",", rather than resting at the terminal or heading back to the depot.",[11,64,65],{},"A model that predicts travel time well is no help if the position it starts from is stale, or if it is predicting for a bus that is not coming.",[21,67,69],{"id":68},"what-i-would-measure-first","What I would measure first",[11,71,72,75],{},[35,73,74],{},"The error a passenger experiences."," For every stop, record the estimate that was shown and the time the bus actually arrived. Group the errors by how far ahead the estimate was made. An estimate made two minutes out and one made twenty minutes out are different problems, and they should not share an average.",[11,77,78,81],{},[35,79,80],{},"Which way the error goes."," A bus that arrives three minutes after its estimate costs someone three minutes of waiting. A bus that arrives three minutes before it can cost them the bus. The two errors are not equal, so the measure should not treat them as equal. It can be right to lean an estimate slightly early on purpose.",[11,83,84,87],{},[35,85,86],{},"How fresh the data was."," Log the age of the last position behind every estimate shown. Good maths on stale data still gives a bad answer, and it is worth knowing how often that is the cause.",[11,89,90,93],{},[35,91,92],{},"A simple baseline."," Before any learned model, compute the remaining distance divided by the usual speed on each stretch at that hour. If a model cannot clearly beat that baseline on the passenger's measure, it is not ready to replace it.",[11,95,96,99],{},[35,97,98],{},"The tail, not the mean."," A small average error can hide a few estimates that were badly wrong. Those are the ones people remember, and the ones that make them stop trusting the screen.",[11,101,102,105],{},[35,103,104],{},"What the screen says when it does not know."," When positions stop arriving, the app should say so rather than keep counting down. \"No live position\" is more useful than a confident number.",[21,107,109],{"id":108},"a-habit-from-research","A habit from research",[11,111,112],{},"Fault prediction has a familiar trap. Faults are rare, so a model that predicts \"no fault\" almost every time can score well and be useless. The habit I would bring from that work is to choose the measure before the model, and to make it the measure of the decision a person will take with the output. For a network operator, the decision is whether to send an engineer. For a passenger, it is when to leave for the stop.",[11,114,115],{},"Operational data adds problems that a prepared research dataset hides: gaps in the feed, vehicles that are not where their schedule says, and users who judge the whole system by the one time it was wrong. A learned model is a small part of an arrival estimate. Most of the work is in getting the data to it on time, and in deciding what the screen should say when the data does not come.",[11,117,118],{},"Given the problem today, I would build the measurement first and the model second. The measurement is what tells you whether the model was worth building.",{"title":120,"searchDepth":121,"depth":121,"links":122},"",2,[123,124,125],{"id":23,"depth":121,"text":24},{"id":68,"depth":121,"text":69},{"id":108,"depth":121,"text":109},"AI",null,"\u002Fimg\u002Fblog-covers\u002F2026-01-15-arrival-estimates-for-a-city-bus.webp","A small bus on a road tile beside a bus-stop post topped with a blue clock face.","2026-01-15","In 2017 and 2018 I led the team delivering live bus positions and arrival estimates for the PJ City Bus app. Returning to the problem: what an arrival estimate depends on, and what I would measure before choosing any model.","md",false,{},true,"\u002Fblog\u002F2026-01-15-arrival-estimates-for-a-city-bus",{"title":5,"description":131},"blog\u002F2026-01-15-arrival-estimates-for-a-city-bus","2017–2018","2026-11-07","vXz4_ODjJFi5R_ohgFDXzQ-LspvI840TUwcQmN58y8g",1794838285595]