A mathematical decoding of urban traffic

Footpaths should be fixed and made widely available, continuous, and uninterrupted. Maybe then those who create traffic jams might try to walk and reduce the jams?

Pandemic or no pandemic, when it comes to urban mobility especially in cities like Bengaluru, the reality is that the private vehicle is here to stay, whether powered by petrol or electricity, and along with it, traffic jams.

But even if public transport buses and Metros were running normally, is it possible to determine the factors that affect an individual’s choice of a particular mode of transport? If such factors are identified, they could then be included in public decision-making.

For example, if it is determined that distance to a transit station is the key factor in people using cars, then investments can be made in expanding the transit network. On the other hand, if distance to a transit station is not a key factor, i.e., despite an extensive transit network, people still prefer cars, then one may investigate the reasons  why the transit network is unused: is public transport expensive? Are the stations unclean?

The ‘why’ of commuter choice

We wanted to get some insight into the transportation habits of people and answer questions like: Why do people bicycle? Why do they not? Why do they drive large cars over narrow roads? Etc.

The World Resources Institute (WRI) is an environmental think tank that researches problems at the intersection of environment and development. The WRI conducted a survey in two cities (Bengaluru and Indore) that gathered information about the preferred means of transport of about 3000 residents, and the factors that possibly determine them (e.g., age, income etc.). 

I am a Grade-11 student of Inventure Academy, and the WRI was kind enough to give me raw survey data to make sense of, and mentored me through the process. 

As seen in the screenshot below, the survey contains a very large number of fields of anonymised data relating to commuters: the location of their homes, their age, their daily commuting expense, time spent commuting, their household incomes, their gender, their relationship to the head-of-household, their occupation, their marital status, and their usual mode of transport. 

A screenshot of the survey

The question is: Which of these factors best predict the preferred mode of transport? Can we make statistically accurate statements like: women habitually avoid the bus, or younger people tend to drive?

It turns out that there is a mathematical technique to study such social problems (math is not just for physicists). We build what is known as a predictor (see above), a software tool that ingests a number of variables (believed to be correlated to the choice of transport), and as its output, predicts the choice of transport.

The predictions are then compared with the actual choice of transport (available through the survey). And If the predictions are by-and-large correct, we would’ve identified the key factors influencing the transport mode and possibly try to establish causality, that is cause-and-effect.

Predictability of transport-choice

There are all manner of predictors available. A linear predictor weighs-and-adds the input factors to arrive at a prediction. A neural network passes the input factors through layers of non-linearities and sums the results to arrive at a prediction.

The human brain, the original and archetypal neural network, is a consummate predictor; humans are constantly trying to find patterns even where they don’t exist. But the human brain can deal with one or two input factors (the traffic is high at 5 pm on all days save Sundays, the variables here being time and day-of-week), but not tens, hundreds, or millions of inputs.

I used the simplest type of predictor, namely the linear predictor. Of the many predictor packages available, I used Analytics Solver for Excel. The predictor gives a measure of how well the predicted choice of transport matches with the actual choice of transport. In the arcana of data analytics, this measure is known as adjusted-R2 (pronounced adjusted-R-squared). The closer the adjusted-R2 is to 100%, the better a particular input factor is correlated with the output (i.e., choice of transport).

Two other measures of predictor performance are missed detection and false alarm. As their names suggest, a missed detection is when you predict that the commuter does not take (say) a bus, but in truth she does (i.e., you didn’t detect the bus as the right mode of transport).

False alarm is the opposite of missed detection: when you predict that the user did take a bus, but in truth she didn’t (i.e., you falsely detected the presence of the bus). The terms missed detection and false alarm originate from the field of radar science. The aim is to keep both missed detection and false alarm rates low. 

With that lengthy preamble, it is now a simple matter, in principle, to feed the data into the software predictor and turn the crank (press the enter key). The results are below:

OutputAdjusted-R2Principal predictorsFraction MissedFalse-Predict Fraction
(19% of users)
46%Gender, Age, Relationship to HoH36%35%
(71% of users)
73%Relationship to HoH,
Marital Status,
(6% of users)

Table 1: A summary of the findings for Indore

Table 1 tells us that the main predictors of whether a user will take a bus or not is their gender, age, and relationship to the head-of-household. The main predictors of whether a user will take a two-wheeler (or not) is their relationship to the head-of-household, occupation, marital status, age, and gender. There is very little confidence (adjusted-R2 = 1.5%) in the prediction for auto-rickshaws.

Curiously, although the two-wheeler prediction enjoys a high adjusted-R2 of 73%, the probabilities of missed and false detections are still quite high, more than 30% each. Thus, by the measure of adjusted-R2, two-wheelers are well-predicted by user factors, but by the measure of missed detection and false alarms, they are only moderately predicted by user factors.

OutputAdjusted-R2Principal predictorsFraction MissedFalse-Predict Fraction
(25% of users)
(17% of users)
52%Age, Relationship to HoH, Marital Status, Occupation38%39%
(47% of users)
(MAYBE: if the expense is below a certain amount then it strongly predicts walking?)

Table 2: A summary of the findings for Bangalore

The most striking observation to emerge from Table 2 is that walking is highly predicted (that is, it has low probabilities of missed detection and false alarm) by just a single user factor, namely the user’s daily transportation expense. In simpler terms, you walk only when you cannot afford to take a bus (or auto-rickshaw or car).

Now, here’s a speculative explanation of causality, and possibly a public-policy gem as well: It ought to be the wealthier people who should be walking, for they are the ones contributing to traffic. Maybe the footpaths should be fixed and made widely available, continuous, and uninterrupted. Maybe then those who create traffic jams might try to walk to reduce the jams? 

Isn’t that incredible? Mathematical tools and data analytics can be used to study problems in the social sciences. And feed into public policy, if somebody is listening.

[Acknowledgement: I gratefully thank Mr. Pawan Mulukutla of the World Resources Institute for giving me this project, mentoring me through its execution, and giving me access to WRI’s survey data. 
Reference: The report in its entirety, i.e., with full technical discussion, is available here.]


  1. Divya Balagopal says:

    Wow!! Congratulations Vishal! The article is so well written – for someone like me who runs away from numbers and complicated formulas – for the first time I found myself reading with interest and understanding!!! Learnt a lot! Thank you Vishal!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Similar Story

Alternative to Bengaluru’s tunnel roads: Improve public transport, enhance mobility, complete projects

Instead of expensive tunnel roads, Bengaluru needs better mobility, metro, suburban rail and buses. Sustainable mobility is the way forward.

Part 1 of this series looked at the cost, risks and challenges of tunnel roads. Part 2 will focus on the alternatives to tunnel roads, and how they can be implemented.  Improve traffic flow: BMTC, Namma Metro and Suburban Rail Metro to Airport:  Namma Metro is extending its Blue Line to Kempegowda International Airport (KIAL) as part of Phase-2B. This metro line, connecting Kasturinagar to KIAL, is expected to be operational by June 2026. Once completed, it will significantly reduce traffic on the road to the airport. Namma Metro Blue Line to Kempegowda International Airport (KIAL). Graphic: Rajkumar Dugar Suburban…

Similar Story

Tunnel roads will not fix Bengaluru’s traffic problem: Here’s why

The tunnel road planned between Hebbal Flyover and Mekhri Circle will cause disruptions and encourage the use of private vehicles.

In October 2023, Deputy Chief Minister/Bengaluru Development Minister, DK Shivakumar, had announced a 190 kilometre-tunnel road as a solution to ease Bengaluru traffic. In May 2024, the Bruhat Bengaluru Mahanagara Palike (BBMP) announced its initial phase plan to construct an 18 kilometre-tunnel road connecting Hebbal and Central Silk Board. This road will include five entry and exit points for vehicles. A tunnel road is an underground passageway for vehicles to travel through. It provides a direct route through an obstacle, such as a mountain or body of water, which would be otherwise impractical or impossible to traverse through by vehicle.…