Simulating segregation

Back in the 1970s, economist Thomas Schelling proposed a model to explain why cities are segregated. Individual people choosing to live with others like themselves would have the macroscopic impact of segregating the city, he had explained.

Think of the city as being organised in terms of a grid. Each person has 8 neighbours (including the diagonals as well). If a person has fewer than 3 people who are like himself (whether that is race, religion, caste or football fandom doesn’t matter), he decides to relocate, and moves to an arbitrary empty spot where at least 3 new neighbours are like himself. Repeat this a sufficient number of times and the city will be segregated, he said.

Rediscovering this concept while reading this wonderful book on Networks, Crowds and Markets yesterday, I decided to code it up on a whim. It’s nothing that’s not been done before – all you need to do is to search around and you’ll find plenty of code with the simulations. I just decided to code it myself from first principles as a challenge.

You can find the (rather badly written) code here. Here is some sample output:

Sample output

As you can see, people belong to two types – red and blue. Initially they start out randomly distributed (white spaces show empty areas). Then people start moving based on Schelling’s rule – if there are less than 3 neighbours of the same kind, you move to a new empty place (if one is available) which is more friendly to you. Over time, you see that you get a segregated city, with large-ish patterns of reds and blues.

The interesting thing to note is that there is no “complete segregation” – there is no one large red patch and one large blue patch. Secondly, segregation seems rather slow at first, but soon picks up pace. You might also notice that the white spaces expand over time.

This is for one specific input, where there are 2500 cells (50 by 50  grid), and we start off with 900 red and 900 blue people (meaning 700 cells are empty). If you change these numbers, the pattern of segregation changes. When there are too few empty cells, for example, the city remains mixed – people unhappy with their neighbourhood have no where to go. When there are too many empty cells, you’ll see that the city contracts. And so forth.

Play around with the code (I admit I haven’t written sufficient documentation), and you can figure out some more interesting patterns by yourself!

Making bus lanes work

Bus Rapid Transport, which is mass transport based on lanes dedicated to buses, is something that has been proposed in India for a very long time but has never really worked.

Delhi abandoned its efforts a few months back under the current state government, after experimenting with it on one road for a few years. Pune has BRT and  bus lanes, but that is also ridden with problems (no pun intended). Ahmedabad supposedly has a well-functioning BRT but the share of commuters using buses in that city is far below other cities.

Source: http://www.livemint.com/Politics/tPT6767pB5DSEEdZnBYcgP/Why-Delhis-bus-service-is-more-expensive-than-that-of-Chenn.html 

There have been proposals to introduce BRT in Bangalore, and some flyovers on Outer Ring Road were designed with the express purpose of maintaining bus lanes. Nothing has come to fruition so far.

In most cases, the problem has been with selling the scheme to the people – a lane exclusively reserved for buses adversely affects people who use private transport. Even though the latter are not numerous (data from the census shows that a very small proportion of urban Indians use private cars for their daily commute), their voice and clout means that it is a hard sell.

In my opinion, the reason BRT has been a hard sell is because of the way it has been implemented and sold. One problem has been that it has been implemented on only a small number of roads, rather than enabling a dense network on which one can travel by bus quickly. The bigger problem  has been implementing it on roads with low bus density, where the demarcated bus lane mostly appears empty while other lanes are clogged, giving incentives for motorists to cheat.

Instead, bus lanes should be demarcated only after bus density on the road has reached a certain density. There are several roads in Bangalore, for example, where buses already contribute to the lion’s share of traffic congestion (Nrupatunga Road, inner ring road in BTM layout and Hosur Road between Wilson Garden and Madivala come to mind – but there needs to be a more scientific study to identify such).

If such roads, with already existing high bus density, are chosen to mark off bus lanes, the bus lanes can be sold as a method to restrict all buses to one lane so that cars can move about freely on the rest of the road. While there might still be protests (thanks to such “reservation”), the fact that the reservation will not have much of an impact will mean that it is an easier sell.

Think about it! Meanwhile, here is a picture from Barcelona, which shows that even in supposedly rule-breaking Spain, bus lanes can work.

Respect for bus lane. In gracia, Barcelona

A photo posted by Karthik Shashidhar (@skthewimp) on

On liberalism and government control

My first exposure to political ideologies took place in 2004, when I joined the now-defunct (but then brilliant) social networking site Orkut. While filling up my personal details, I was asked to pick my political beliefs from a drop-down.

It had things such as “left-liberal”, “very left-liberal”, “right-conservative”, etc. Now, while I considered myself liberal back then (I’ve moved far more liberal on personal freedom issues since then), there was no way I could describe myself as “left”, since I’ve always been a free market fundamentalist. Finally I noticed there was something called “libertarian” in the dropdown, and assumed it might stand for my beliefs and chose that. In hindsight, it turns out I was right (no pun intended).

A year or two later, I got introduced to a “libertarian cartel” (I was never a member, so don’t know who were members). Presently, I was invited to join some of them in discussions, and my love for the libertarian philosophy grew (these discussions were instrumental in me moving far more liberal on personal freedom issues). Yet, looking around the political spectrum, you had few libertarian parties (going across countries).

You had the set of parties that can be broadly classified as “Republican” which allowed you to do business the way you liked, but sought to restrict personal freedoms. And there were the parties that can be classified as “Democrat” which promoted personal freedoms, but restricted how you could do business. And you had philosophies such as communism which sought to control both. The “fourth quadrant” was (and is) largely empty.

It is not hard to understand why this fourth quadrant is empty – in exchange for responsibilities of governing, politicians desire power, and this power can only come at the cost of restricting freedoms of the constituents. Different political formations choose to exercise this power along different axes, but little differentiates them – they all seek to control. While libertarianism is appealing for the constituent, it doesn’t make sense for politicians since it doesn’t compensate sufficiently for the responsibility of  governance. Hence you don’t find libertarian political parties.

Yet, we find that slowly but surely, reforms do happen. Over time, restrictions on freedoms (both personal and economic) do get relaxed, albeit at a glacial pace, and this is true across countries, despite there being no “libertarian” politicians. Why does this happen?

The simplistic answer is that politicians in functioning democracies have to face lengthy periods of time in opposition, when they are at the mercy of the party that is then in power. Since politicians tend to be vindictive animals, you don’t want to leave behind any laws that might be used to harass you while you are out of power. So the ruling party should tend to ease restrictions that can be used against its members when they are out of power.

Again, this is fine in theory, but why does it not always happen? The answer is that opposing political parties are not “orthogonal enough”. If politicians on multiple sides of the divide have broadly similar ideas on certain issues, there can be a tacit understanding (a “doctrine of no first use”, perhaps) to not use the laws that they agree on against each other.

When you have parties that have orthogonal philosophies, you can expect them to do their bit while in power to undermine the sources of their rivals’ control, so that their rivals might enjoy less control the next time they are in power. And citizens in such democracies are likely to enjoy greater freedoms.

As the old saying (paraphrased) goes, “when politicians from all parties agree to something, it is unlikely to be in the interests of the people”.

Admission of errors and bad bank loans

I have a policy that whenever I make a mistake, I admit it. I believe that suppressing an error does more harm than good in the long run, and it is superior to admit it at the time of discovery and correct course rather than keeping things under wraps until the shit hits the fan (a la Nick Leeson, for example).

There is another reason I like to admit to my mistakes – by doing so frequently, I want to send the signal that I’m self-aware and self-critical and aware of what I’ve done wrong. This, I believe, sends a signal that I should be trusted more, since I have a grip on rights and wrongs.

It doesn’t always work that way. There was a company I once worked for, where my responsibilities meant that my errors had an immediate material impact on the company. I don’t know if this (direct material impact) mattered, but my signalling went horribly wrong there.

The powers-that-were came from a prior belief that people would suppress their mistakes as much as they could, and that I was admitting to them only because I couldn’t suppress them further. Their reaction to my constant admission of mistakes (I was writing production code, a bad bad idea given my ADHD) was that if I were admitting to so many mistakes, how many more of my mistakes were yet to be discovered?

In other words, the strategy backfired spectacularly, possibly given the mismatch of our priors, and I later figured I might have done better had I tried suppressing (or quietly fixing) rather than admitting. That, however, hasn’t led to a change in my general strategy on this issue.

I was reminded of this strategy when State Bank of India and Punjab National Bank released their quarterly results last week. Their stocks got hammered on the back of drastically reduced profits on account of higher provisions – an admission that a significantly higher proportion of their loans had gone bad compared to their earlier admissions.

The question that comes to mind is whether the increase in provisioning and admission of bad loans should be taken as a credible signal that these banks are cleaning up their balance sheets (which is a good thing) or whether it only indicates a bigger tip of a bigger iceberg (in which case I’d be paranoid about my deposits).

Not knowing what strategy these banks are playing (though statements from the RBI suggest they’re likely to be cleaning up), I guess we have to wait for results over the next couple of quarters to learn their signals better.

Capitalism and Freedom and JNU

This piece by David Henderson has a very powerful quote by Milton Friedman. Quoting in full:

In the circumstances envisaged in the socialist society, the man who wants to print the paper to promote capitalism has to persuade a government mill to sell him the paper, a government printing press to print it, a government post office to distribute it among the people, a government agency to rent him a hall in which to talk and so on. Maybe there is some way in which one could make arrangements under a socialist society to preserve freedom and to make this possible. I certainly cannot say that it is utterly impossible. What is clear is that there are very real difficulties in preserving dissent and that, so far as I know, none of the people who have been in favor of socialism and also in favor of freedom have really faced up to this issue or made even a respectable start at developing the institutional arrangements that would permit freedom under socialism. By contrast, it is clear how a free market capitalist society fosters freedom.

Think about the ongoing protests at Jawaharlal Nehru University, a far-left-of-centre university, regarding the rally they took out last week and the government crackdown thereafter. While the current protests there have little to do with economics, and mostly about government control, given that a large section of the university has a mostly leftist anti-capitalist agenda, it’s a good example to take.

So where did the students and faculty of JNU obtain the resources to organise their protest marches? Some posters and banners might have been handmade, but many would’ve been bought (or made to order) from capitalist banner manufacturers.

The protests were largely covered by capitalist media houses which gave them further ballast, and acted as a force multiplier. Discussions on capitalist TV channels and newspapers (some of them publicly listed) added legitimacy to the protests.

Protestors would have needed a way to coordinate regarding the time and location and manner of protests. While old-fashioned methods such as notice boards and offline meetings could have been used, it is far more likely (and far easier) that the protestors used a capitalist social network (such as WhatsApp or Telegram (though admittedly the latter is not-for-profit, but it’s just that its owners are not optimising for profits) ) to coordinate their protests, using smartphones and computers made by capitalist manufacturers and sold by capitalist shopkeepers.

In other words, capitalism is a necessary condition for any kind of freedom, especially freedoms directed against the state. In a wholly state-owned economy, last week’s protests would have been far harder, if not impossible.

The state-owned media could have been one-sided in the coverage. The state-owned banner manufacturers could have refused to sell to the protestors. State-owned social media would have snooped on and subverted attempts to organise (if not block them altogether). I’m only picking a few examples here.

The next time you think you can have social freedom without capitalism, think again. It is capitalists driven by profit motives who provide anti-state activists the necessary tools to express their freedom.

Parks and public safety

I spent the last hour and a half working from a park near my house in Barcelona. It helped that I wasn’t using my laptop – I was mostly working with a notebook and pen. The incredible thing was that never once did I feel unsafe working in that park, and it has to do with the park’s design.

I got accosted by a human only once – by this guy asking me if I had a cigarette lighter and who walked away when I said no, and by dogs (of all shapes and sizes) multiple times. Despite the fact that I was in a park, and people don’t go to parks at 10 am on a weekday morning, there was a constant flow of people in front of me. There were, to put it in other words, sufficient “eyes on the street” which contributed to the place’s safety.

I’ve ranted sufficiently on this blog about the design (or lack of it) of Bangalore’s public parks (one with a name sufficiently similar to that of this post). The problem with the parks, in my opinion, is that they are exclusive closed spaces which are hard to access.

The sprawling Krishna Rao Park in the middle of Basavanagudi, for example, has only two or three entrances, and the number of trees in the park means that large parts of it are hardly visible, providing a refuge to unsavoury elements. This phenomenon of few entrances to parks is prevalent in other city parks as well, with the consequence that the BBMP (city administration) closes off the parks during the day when few people want to go in.

The park I was sitting in this morning, on the other hand, had no such safety issues. It helped that there weren’t too many trees (not always a positive thing about parks), which improved visibility, but most importantly, it was open on all sides, providing a nice thoroughfare for people walking across the area. This meant that a large number of people in the vicinity, even if they didn’t want to “go to a park” ended up passing through the park, because of which there was a constant flow of human traffic and “eyes on the park street”, making it a significantly safer space.

There might be (maintenance-related ) reasons for having limited entrances to parks in Bangalore, but the administration should seriously consider opening up parks on all sides and encouraging people to walk through them (after all, walking paths are an important part of Bangalore parks). Maintenance costs might go up, but safety of parks will be enhanced significantly, and it will be possible to keep parks open at all times, which will enhance their utility to the public.

Maybe Krishna Rao park, with roads on all sides and in the middle of Basavanagudi, might serve as a good pilot case for this.

Bias in price signals from ask only markets

Yesterday I listened to this superb podcast where Russ Roberts of the Hoover Institution interviews Josh Luber who runs Campless, a secondary market for sneakers (listen to the podcast, it isn’t as bizarre as it sounds). The podcast is full of insights on markets and “thickness” and liquidity and signalling and secondary markets and so on.

To me, one of the most interesting takeaways of the podcast was the concept that the price information in “ask only markets” is positively biased. Let me explain.

A financial market is symmetric in that it has both bids (offers to buy stock) and asks (offers to sell). When there is a seller who is willing to sell the stock at a bid amount, he gets matched to the corresponding bid and the two trade. Similarly, if a buyer is willing to buy at ask, the ask gets “taken out”.

The “order book” at any time thus contains of both bids and asks – which have been unmatched thus far, and looking at the order book gives you an idea of what the “fair price” for the stock is.

However, not all markets are symmetric this way. In fact, most markets are asymmetric in that they only contain asks – offers to sell. Think of your neighbourhood shop – the shopkeeper is set up to only sell goods, at a price he determines (his “ask”). When a buyer comes along who is willing to pay the ask price of a good, a transaction happens and the good disappears.

Most online auction markets (such as eBay or OLX) also function the same way – they are ask only. People post on these platforms only when they have something to sell, accompanied by the ask price. Once a buyer who is willing to pay that price is found, the item disappears and the transaction is concluded.

What makes things complicated with platforms such as OLX or eBay (or Josh Luber’s Campless) is that most sellers are “retail”, who don’t have a clear idea of what price to ask for their wares. And this introduces an interesting bias.

Low (and more reasonable) asks are much more likely to find a match than higher asks. Thus, the former remain in the market for much shorter amount of time than the latter.

So if you were to poll the market at periodic intervals looking at the “best price” for a particular product, you are likely to end up with an overestimate because the unreasonable asks (which don’t get taken out that easily) are much more likely to occur in your sample than more reasonable asks. This problem can get compounded by prospective sellers who decide their ask by polling the market at regular intervals for the “best price” and use that as a benchmark.

Absolutely fascinating stuff that you don’t normally think about. Go ahead and listen to the full podcast!

PS: Wondering how it would be if OLX/eBay were to be symmetric markets, where bids can also be placed. Like “I want a Samsun 26 inch flatscreen LCD TV for Rs. 10000”. There is a marketplace for B&Bs (not Airbnb) which functions this way. Would be interesting to study for sure!

Continuous and barrier regulation

One of the most important pieces of financial regulation in the US and Europe following the 2008 financial crisis is the designation of certain large institutions as “systemically important”, or in other words “too big to fail”. Institutions thus designated have greater regulatory and capital requirements, thus rendering them at a disadvantage compared to smaller competitors.

This is by design – one of the intentions of the “SiFi” (systemically important financial regulations) is to provide incentives to companies to become smaller so that the systemic risk is reduced. American insurer Metlife, for example, decided to hive off certain divisions so that it’s not a SiFi any more.

AIG, another major American insurer (which had to be bailed out during the 2008 financial crisis), is under pressure from its activist investors led by Carl Icahn to similarly break up so that it can avoid being a SiFi. The FT reports that there were celebrations in Italy when insurer Generali managed to get itself off the global SiFi list. Based on all this, the SiFi regulation seems to be working in spirit.

The problem, however, is with the method in which companies are designated SiFis, or rather, with that SiFi is a binary definition. A company is either a SiFi or it isn’t –  there is no continuum. This can lead to perverse incentives for companies to escape the SiFi tag, which might undermine the regulation.

Let’s say that the minimum market capitalisation for a company to be defined a SiFi is $10 billion (pulling this number out of thin air, and assuming that market cap is the only consideration for an entity to be classified as a SiFi). Does this mean that a company that is worth $10 Bn is “systemically important” but one that is worth $9.9 Bn is not? This might lead to regulatory arbitrage that might lead to a revision of the benchmark, but it still remains a binary thing.

A better method for regulation would be for the definition of SiFi to be continuous, or fuzzy, so that as the company’s size increases, its “SiFiness” also increases proportionally, and the amount of additional regulations it has to face goes up “continuously” rather than being hit by a “barrier”. This way, the chances of regulatory arbitrage remain small, and the regulation will indeed serve its purpose.

SiFi is just one example – there are several other cases which are much better served by regulating companies (or individuals) as a continuum and not classifying them into discrete buckets. When you regulate companies as parts of discrete buckets, there is always the temptation to change just enough to move from one bucket to the other, and that might result in gaming. Continuous regulation, on the other hand, leaves no room for such marginal gaming – marginal changes aer only giong to have a marginal impact.

Perhaps for something like SiFi, where the requirements of being a SiFi are binary (compliance, etc.) there may not be a choice but to keep the definition discrete (if there are 10 different compliance measures, they can kick in at 10 different points, to simulate a continuous definition).

However, when the classification results in monetary benefits or costs (let’s say something like SiFis paying additional regulatory costs) it can be managed via non-linear funding. Let’s say that you pay 10% fees (for whatever) in category A and 12% in category B (which you get to once you cross a benchmark). A simply way to regulate would be to have the fees as a superlinear function of your market cap (if that’s what the benchmark is based on).

 

The myth of affordable housing

Cities are unaffordable by definition because of the value that can be extracted by living in them. 

A few months back, my Takshashila colleague Varun KR (Shenoy) asked me if there is any city where housing is not prohibitively expensive. It wasn’t a rhetorical question. While answering “no”, I went off on a long rant as to why affordable housing is a myth, and why housing in urban areas is by definition expensive. I had been planning to blog it for a while but I get down to it only now.

Cities are expensive to live in due to a simple reason – lots of people want to live there. And why do lots of people want to live in cities? Because the density in cities means that there is a lot more economic activity happening per capita that results in greater productivity and happiness.

If you are in a rural area, for example, there are few services that you could afford to outsource, for the small scale means that it doesn’t make sense for people to provide that service. Even when such services exist, lack of competition might mean a large “bid-ask spread” and hence inefficiency. This means you are forced to do a lot more tasks which you suck at, leaving less time for you to do things you are good at and make money from.

Needs of a rural area also means that there is a natural limit on the kind of economic activities that can be remunerative there, so if your skills don’t lie in one of those, you are but forced to lead a suboptimal existence.

Larger agglomerations (such as cities), by putting people closer to each other, provide sufficient scale for more goods and services to become tradable. Transaction costs are reduced, and you can afford to outsource a lot more tasks than you could afford to in a rural area, thus boosting your productivity.

Economist and noted urban theorist Jane Jacobs, in her book “Cities and the Wealth of Nations”, argues that economic development occurs exclusively in cities and “city regions” and proceeds to demolish different theories by which people have tried to create economic value in remote areas (my review of the book here).

The larger a city is, the greater the benefits for someone who lives there, controlling for ability and skill. Thus, ceteris paribus, the demand for living in cities exceeds that of living in smaller agglomerations, which gets reflected in the price of housing.

It might be argued that what I have presented so far is only an analysis of demand, and supply is missing from my analysis. (I don’t understand who is on the left and who is on the right on this one but) One side argues that the reason housing is not affordable in cities is that strict regulations and zoning laws limit the amount of housing available leading to higher prices. The other side talks about the greed of builders who want to “maximise profits by building for the rich”, which leads to undersupply at the lower end of the market.

While zoning and building restrictions might artificially restrict supply and push up prices (San Francisco is a well-known example of a city with expensive housing for this reason), easing such restrictions can have only a limited impact. While it is true that increasing density might lead to an increase in supply and thus lower prices, a denser city will end up providing scale to far more goods and services than a less dense city can, thus increasing the value addition for people living there, which means more people want to live in these denser cities.

As for regulations that dictate that “affordable housing” be built, one needs to look no further than the “Slum Rehabilitation Apartments” that have been built in Mumbai on land recovered from slums (the usual deal is for a builder to commit to building a certain number of “affordable” houses for the erstwhile dwellers of the slums thus demolished apart from “conventional” housing). Erstwhile slumdwellers rarely occupy such apartments, for they are willing to accept a lower quality of life (in another slum, perhaps) in exchange for the money that can be generated by renting out these apartments.

This piece is far from over, but given how long it’s been, I’ll probably continue in a second part. Till then, I leave you with this thought – a city becoming an “affordable” place to live is a cause of worry for policymakers (and dwellers of the city itself) because it is an indicator that the city is not adding as much economic value as it used to.

 

Why Delhi’s odd-even plan might work

While it is too early to look at data and come to an objective decision, there is enough reason to believe that Delhi’s “odd-even” plan (that restricts access to streets on certain days to cars of a certain parity) might work.

 

The program was announced sometime in December and the pilot started in January, and you have the usual (and some unusual) set of outragers outraging about it, and about how it can cause chaos, makes the city unsafe and so forth. An old picture of a Delhi metro was recirculated on Monday and received thousands of retweets, by people who hadn’t bothered to check facts and were biased against the odd-even formula. There has been some anecdotal evidence, however, that the plan might be working.

It can be argued that the large number of exceptions (some of which are bizarre) might blunt the effect of the new policy, and that people might come up with innovative car-swap schemes (not all cars get out of their lots every morning, so a simple car-swap scheme can help people circumvent this ban), because of which only a small proportion of cars in Delhi might go off the roads thanks to the scheme.

While it might be true that the number of cars on Delhi roads might fall by far less than half (thanks to exemptions and swap schemes) due to this measure, that alone can have a significant impact on the city’s traffic, and pollution. This is primarily due to non-linearities in traffic around the capacity.

Consider a hypothetical example of a road with a capacity for carrying 100 cars per hour. As long as the number of cars that want to travel on it in an hour is less than 100, there is absolutely no problem and the cars go on. The 101st car, however, creates the problem, since the resource now needs to be allocated. The simplest way to allocate a resource such as a road is first come-first served, and so the 101st car waits for its turn at the beginning of the road, causing a block in the road it is coming from.

While this might be a hypothetical and hard-to-visualise example, it illustrates the discontinuity in the problem – up to 100, no problem, but 101st causes problem and every additional car adds to the problem. More importantly, these problems also cascade, since a car waiting to get on to a road clogs the road it is coming from.

Data is not available about the utilisation of Delhi roads before this new measure was implemented, but as long as the demand-supply ratio was not too much higher than 1, the new measure will be a success. In fact, if a fraction f of earlier traffic remains on the road, the scheme will be a success as long as the earlier utilisation of the road was no more than \frac{1}{f} (of course we are simplifying heavily here. Traffic varies by region, time of day, etc.).

In other words, the reduction in number of cars due to the new measure should mean significantly lower bottlenecks and traffic jams, and ensure that the remaining cars move much faster than they did earlier. And with lesser bottlenecks and jams, cars will end up burning less fuel than they used to, and that adds a multiplier to the drop in pollution.

Given that roads are hard to price (in theory it’s simple but not so in practice), what we need is a mechanism so that the number of cars using it is less than or equal to capacity. The discontinuity around this capacity means that we need some kind of a coordination mechanism to keep demand below the capacity. The tool that has currently been used (limiting road use based on number plate parity) is crude, but it will tell us whether such measures are indeed successful in cutting traffic.

More importantly, I hope that the Delhi government, traffic police, etc. have been collecting sufficient data through this trial period to determine whether the move has the intended effects. Once the trial period is over, we will know the true effect this has had (measuring pollution as some commentators have tried is crude, given lag effects, etc.).

If this measure is successful, other cities can plan to either replicate this measure (not ideal, since this is rather crude) or introduce congestion pricing in order to regulate traffic on roads.