Wednesday, April 22, 2015

Spoofing in an Algorithmic Ecosystem

A London trader recently charged with price manipulation appears to have been using a strategy designed to trigger high-frequency trading algorithms. Whether he used an algorithm himself is beside the point: he made money because the market is dominated by computer programs responding rapidly to incoming market data, and he understood the basic logic of their structure.

Specifically, Navinder Singh Sarao is accused of having posted large sell orders that created the impression of substantial fundamental supply in the S&P E-mini futures contract:
The authorities said he used a variety of trading techniques designed to push prices sharply in one direction and then profit from other investors following the pattern or exiting the market.

The DoJ said by allegedly placing multiple, simultaneous, large-volume sell orders at different price points — a technique known as “layering”— Mr Sarao created the appearance of substantial supply in the market.
Layering is a type of spoofing, a strategy of entering bids or offers with the intent to cancel them before completion.
Who are these "other investors" that followed the pattern or exited the market? Surely not the fundamental buyers and sellers placing orders based on an analysis of information about the companies of which the index is composed. Such investors would not generally be sensitive to the kind of order book details that Sarao was trying to manipulate (though they may buy or sell using algorithms sensitive to trading volume in order to limit market impact). Furthermore, as Andrei Kirilenko and his co-authors found in a transaction level analysis, fundamental buyers and sellers account for a very small portion of daily volume in this contract.

As far as I can tell, the strategies that Sarao was trying to trigger were high-frequency trading programs that combine passive market making with aggressive order anticipation based on privileged access and rapid responses to incoming market data. Such strategies correspond to just one percent of accounts on this exchange, but are responsible for almost half of all trading volume and appear on one or both sides of almost three-quarters of traded contracts.

The most sophisticated algorithms would have detected Sarao's spoofing and may even have tried to profit from it, but less nimble ones would have fallen prey. In this manner he was able to syphon off a modest portion of HFT profits, amounting to about four forty million dollars over four years.

What is strange about this case is the fact that spoofing of this kind is, to quote one market observer, as common as oxygen. It is frequently used and defended against within the high frequency trading community. So why was Sarao singled out for prosecution? I suspect that it was because his was a relatively small account, using a simple and fairly transparent strategy. Larger firms that combine multiple strategies with continually evolving algorithms will not display so clear a signature. 

It's important to distinguish Sarao's strategy from the ecology within which it was able to thrive. A key feature of this ecology is the widespread use of information extracting strategies, the proliferation of which makes direct investments in the acquisition and analysis of fundamental information less profitable, and makes extreme events such as the flash crash practically inevitable.

Monday, April 06, 2015

Intermediation in a Fragmented Market

There’s a recent paper by Merritt Fox, Lawrence Glosten and Gabriel Rauterberg that anyone interested in the microstructure of contemporary asset markets would do well to read. It's one of the few papers to take a comprehensive and theoretically informed look at the welfare implications of high frequency trading, including effects on the incentives to invest in the acquisition and analysis of fundamental information, and ultimately on the allocation of capital and the distribution of risk.

Back in 1985, Glosten co-authored what has become one of the most influential papers in the theory of market microstructure. That paper considered the question of how a market maker should set bid and ask prices in a continuous double auction in the presence of potentially better informed traders. The problem facing the market maker is one of adverse selection: a better informed counterparty will trade against a quote only if doing so is profitable, which necessarily means that all such transactions impose a loss on the market maker. To compensate there must be a steady flow of orders from uninformed parties, such as investors in index funds who are accumulating or liquidating assets to manage the timing of their consumption. The competitive bid-ask spread depends, among other things, on the size of this uninformed order flow as well as the precision of the signals received by informed traders.

The Glosten-Milgrom model, together with a closely related contribution by Albert Kyle, provides the theoretical framework within which the new paper develops its arguments. This is a strength because the role of adverse selection is made crystal clear. In particular, any practice that defends a market maker against adverse selection (such as electronic front running, discussed further below) will tend to lower spreads under competitive conditions. This will benefit uninformed traders at the margin, but will hurt informed traders, reduce incentives to acquire and analyze fundamental information, and could result in lower share price accuracy.

Such trade-offs are inescapable, and the Glosten-Milgrom and Kyle models help to keep them in sharp focus. But this theoretical lens is also a limitation because the market makers in these models are passive liquidity providers who do not build directional exposure based on information gleaned from their trading activity. This may be a reasonable description of the specialists of old, but the new market makers combine passive liquidity provision with aggressive order anticipation, and respond to market data not simply by cancelling orders and closing out positions but by speculating on short term price movements. They would do so even in the absence of market fragmentation, and this has implications for price volatility and the likelihood of extreme events which I have discussed in earlier posts.

But the focus of the paper is not on volatility, but rather on market fragmentation and differential access to information. The authors argue that three controversial practices---electronic front running, slow market arbitrage, and midpoint order exploitation---can all be traced to these two features of contemporary markets, and can all be made infeasible by a simple change in policy. It's worth considering these arguments in some detail.

Electronic front running is the practice of using information acquired as a result of a trade at one venue to place or cancel orders at other venues while orders placed at earlier points in time are still in transit. The authors illustrate the practice with the following example: 
For simplicity of exposition, just one HFT, Lightning, and two exchanges, BATS Y and the NYSE, are involved. Lightning has co-location facilities at the respective locations of the BATS Y and NYSE matching engines. These co-location facilities are connected with each other by a high-speed fiber optic cable.
An actively managed institutional investor, Smartmoney, decides that Amgen’s future cash flows are going to be greater than its current price suggests. The NBO is $48.00, with 10,000 shares being offered at this price on BATS Y and 35,000 shares at this price on NYSE. Smartmoney decides to buy a substantial block of Amgen stock and sends a 10,000 share market buy order to BATS Y and a 35,000 share market buy order to NYSE. The 35,000 shares offered at $48.00 on NYSE are all from sell limit orders posted by Lightning.
The order sent to BATS Y arrives at its destination first and executes. Lightning’s colocation facility there learns of the transaction very quickly. An algorithm infers from this information that an informed trader might be looking to buy a large number of Amgen shares and thus may have sent buy orders to other exchanges as well. Because of Lightning’s ultra-high speed connection, it has the ability to send a message from its BATS Y co-location facility to its co-location facility at NYSE, which in turn has the ability to cancel Lightning’s 35,000 share $48.00 limit sell order posted on NYSE. All this can happen so fast that the cancellation would occur before the arrival there of Smartmoney’s market buy order. If Lightning does cancel in this fashion, it has engaged in “electronic front running.” 
Note that if Smartmoney had simply sent an order to buy 45,000 shares to BATS Y, of which an unfilled portion of 35,000 was routed to NYSE, the same pattern of trades and cancellations would occur. But in this alternative version of the example, orders would not be processed in the sequence in which they make first contact with the market. In particular, the cancellation order would be processed before the original buy order had been processed in full. This seems to violate the spirit if not the letter of Regulation NMS.

Furthermore, while the authors focus on order cancellation in response to the initial information, there is nothing to prevent Lightning from buying up shares on NYSE, building directional exposure, then posting offers at a slightly higher price. In fact, it cannot be optimal from the perspective of a firm with such a speed advantage to simply cancel orders in response to new information: there must arise situations in which the information is strong enough to warrant a speculative trade. In effect, the firm would mimic the behavior of an informed trader by extracting the information from market data, at a fraction of the cost of acquiring the information directly. 

Electronic front running prevents informed traders from transacting against all resting orders that are available at the time they place an order. This defends high frequency traders against adverse selection, allowing them to post smaller spreads, which benefits uninformed traders. But it also lowers the returns to investing in the acquisition and analysis of information, potentially lowering share price accuracy. Given this, the authors consider the welfare effects of electronic front running to be ambiguous.

The other two practices, however, result in unambiguously negative welfare effects. First consider slow market arbitrage, defined and illustrated by the authors as follows:
Slow market arbitrage can occur when an HFT has posted a quote representing the NBO or NBB on one exchange, and subsequently someone else posts an even better quote on a second exchange, which the HFT learns of before it is reported by the national system. If, in the short time before the national report updates, a marketable order arrives at the first exchange, the order will transact against the HFT’s now stale quote. The HFT, using its speed, can then make a riskless profit by turning around and transacting against the better quote on the second exchange…

To understand the practice in more detail, let us return to our HFT Lightning. Suppose that Lightning has a limit sell order for 1000 shares of IBM at $161.15 posted on NYSE. This quote represents the NBO at the moment. Mr. Lowprice then posts a new 1000 share sell limit order for IBM on EDGE for $161.13.

The national reporting system is a bit slow, and so a short period of time elapses before it reports Lowprice’s new, better offer. Lightning’s co-location facility at EDGE very quickly learns of the new $161.13 offer, however, and an algorithm sends an ultra-fast message to Lightning’s co-location facility at NYSE informing it of the new offer. During the reporting gap, though, Lightning keeps posted its $161.15 offer. Next, Ms. Stumble sends a marketable buy order to NYSE for 1000 IBM shares. Lightning’s $161.15 offer remains the official NBO, and so Stumble’s order transacts against it. Lightning’s co-location facility at NYSE then sends an ultra-fast message to the one at EDGE instructing it to submit a 1000 share marketable buy order there. This buy order transacts against Lowprice’s $161.13 offer. Thus, within the short period before the new $161.13 offer is publicly reported, Lightning has been able to sell 1000 IBM shares at $161.15 and purchase them at $161.13, for what appears to be a $20 profit. 
This practice hurts both informed and uninformed traders, and is a clear example of what I have elsewhere called superfluous financial intermediation. According to the authors this practice would have negative welfare effects even if it did not require the investment of real resources.

In discussing wealth transfer, the authors argue that "Ms. Stumble... would have suffered the same fate if Lightning had not engaged in slow market arbitrage because that course of action would have also left the $161.15 offer posted on NYSE and so Stumble’s buy order would still have transacted against it." While this is true under existing order execution rules, note that it would not be true if orders were processed in the sequence in which they make first contact with the market. 

Finally, consider mid-point order exploitation:
A trader will often submit to a dark pool a “mid-point” limit buy or sell order, the terms of which are that it will execute against the next marketable order with the opposite interest to arrive at the pool and will do so at a price equal to the mid-point between the best publicly reported bid and offer at the time of execution. Mid-point orders appear to have the advantage of allowing a buyer to buy at well below the best offer and sell well above the best bid. It has been noted for a number of years, however, that traders who post such orders are vulnerable to the activities of HFTs… Mid-point order exploitation again involves an HFT detecting an improvement in the best available bid or offer on one of the exchanges before the new quote is publicly reported. The HFT puts in an order to transact against the new improved quote, and then sends an order reversing the transaction to a dark pool that contains mid-point limit orders with the opposite interest that transact at a price equal to the mid-point between the now stale best publicly reported bid and offer…

Let us bring back again our HFT, Lightning. Suppose that the NBO and NBB for IBM are $161.15 and $161.11, respectively, and each are for 1000 shares and are posted on NYSE by HFTs other than Lightning. Then the $161.15 offer is cancelled and a new 1000 share offer is submitted at $161.12. Lightning, through its co-location facilities at NYSE, learns of these changes in advance of their being publicly reported. During the reporting gap, the official NBO remains $161.15.

Lightning knows that mid-point orders for IBM are often posted on Opaque, a well known dark pool, and Lightning programs its algorithms accordingly. Because Opaque does not disclose what is in its limit order book, Lightning cannot know, however, whether at this moment any such orders are posted on Opaque, and, if there are, whether they are buy orders or sell orders. Still there is the potential for making money.

Using an ultra-fast connection between the co-location facility at NYSE and Opaque, a sell limit order for 1000 shares at $161.13 is sent to Opaque with the condition attached that it cancel if it does not transact immediately (a so-called “IOC” order). This way, if there was one or more mid-point buy limit orders posted at Opaque for IBM, they will execute against Lightning’s order at $161.13, half way between the now stale, but still official, NBB of $161.11 and NBO of $161.15. If there are no such mid-point buy orders posted at Opaque, nothing is lost.

Assume that there are one or more such mid-point buy orders aggregating to at least 1000 shares and so Lightning’s sell order of 1000 shares transacts at $161.13. Lightning’s co-location facility at NYSE is informed of this fact through Lightning’s ultra-fast connection with Opaque. A marketable buy order for 1000 shares is sent almost instantaneously to NYSE, which transacts against the new $161.12 offer. Thus, within the short period before the new $161.12 offer on NYSE is publicly reported, Lightning has been able to execute against this offer, purchase 1000 IBM shares at $161.12, and sell them at $161.13, for what appears to be a $10.00 profit. 
As in the case of slow market arbitrage, this hurts informed and uninformed traders alike. 

The three activities discussed above all stem from the fact that trading in the same securities occurs across multiple exchanges, and market data is available to some participants ahead of others. The authors argue that a simple regulatory change could make all three practices infeasible:
We think there is an approach to ending HFT information speed advantages that is simpler both in terms of implementation and in terms of achieving the needed legal changes. None of these three practices would be possible if private data feeds did not make market quote and transaction data effectively available to some market participants before others. Thus, one potential regulatory response to the problem posed by HFT activity is to require that private dissemination of quote and trade information be delayed until the exclusive processor under the Reg. NMS scheme, referred to as the “SIP,” has publicly disseminated information from all exchanges.
Rule 603(a)(2) of Reg. NMS prohibits exchanges from “unreasonably discriminatory” distribution of market data… Sending the signal simultaneously to an HFT and to the SIP arguably is “unreasonably discriminatory” distribution of core data to the end users since it is predictable that some will consistently receive it faster than others… Interestingly, this focus on the time at which information reaches end users rather than the time of a public announcement is the approach the courts and the SEC have traditionally taken with respect to when, for purposes of the regulation of insider trading, information is no longer non-public. Thus the SEC’s ability to alter its interpretation of Rule 603(a)(2) may be the path of least legislative or regulatory resistance to prohibiting electronic front-running. 
There’s an even simpler solution, however, and that is to process each order in full in the precise sequence in which it makes first contact with the market. That is, if two orders reach an exchange in quick succession, they should be processed not in the order in which they reach the exchange but rather the order in which they have reached any exchange. Failing this, I don't see how we can be said to have a "national market system" at all.

Friday, April 03, 2015

Prediction Market Design

The real money, peer-to-peer prediction market PredictIt is up and running in the United States. Modeled after the pioneering Iowa Electronic Markets, it offers a platform for the trading of futures contracts with binary payoffs contingent on the realization of specified events. 

There are many similarities to the Iowa markets: the exchange has been launched by an educational institution (New Zealand's Victoria University), is offered as an experimental research facility rather than an investment market, operates legally in the US under a no-action letter from the CFTC, and limits both the number of traders per contract and account size. While there are no fees for depositing funds or entering positions, the exchange takes a 10% cut when positions are closed out at a profit and charges a 5% processing fee for withdrawals. (IEM charges no fees whatsoever.) 

While still in beta and ironing out some software glitches, trading is already quite heavy with bid-ask spreads down to a penny or two in some contracts referencing the 2016 elections. Trading occurs via a continuous double auction, but the presentation of the order book is non-standard. Here, for instance, is the current book for a contract that pays off if the Democratic nominee wins the 2016 presidential election:

 

To translate this to the more familiar order book representation, read the left column as the ask side and subtract the prices in the right column from 100 to get the bid side.

There's one quite serious design flaw, which ought to be easy to fix. Unlike the IEM (or Intrade for that matter), short positions in multiple contracts referencing the same event are not margin-linked. To see the consequences of this, consider the prices of contracts in the heavily populated Republican nomination market:


These are just 10 of the 17 available contracts, and the list is likely to expand further. According to the prices at last trade, there's a 102% chance that the nominee will be Bush, Walker or Rubio, and a 208% chance that it will be one of these ten. If one buys the "no" side of all ten contracts at the quoted prices at a cost of $8.10, a payoff of at least $9 is guaranteed, since the party will have at most one nominee. That's a risk-free return of at least 11% over a year and a quarter. 

This mispricing would vanish in an instant if the cost of buying a set of contracts were limited to the worst case loss, as indeed was the case on Intrade (IEM allows the purchase and sale of bundles at par, which amounts to the same thing.) Then buying the "no" side of the top two contracts would cost $0.26 instead of $1.26, and shorting the top three would be free.

If the exchange were to manage a switch to margin-linked shorts, all those currently holding no positions would make a windfall gain as prices snap into line with a no-arbitrage condition. Furthermore, algorithmic traders would jump into the market to exploit new arbitrage opportunities as they appear. Such algos have been active on IEM for a while now, and were responsible for a good portion of transactions on Intrade.

Despite this one design flaw, I expect that these markets will be tracked closely as the election approaches, and that liquidity will increase quite dramatically. This despite the fact that traders are entering into negative-sum bets with each other, which ought to be impossible under the common prior assumption. The arbitrage conditions will come to be more closely approximated as the time to contract expiration diminishes, especially in markets with few active contracts (such as that for the winning party). But unless the flaw is fixed, the translation of prices into probabilities will require a good deal of care.

Sunday, March 29, 2015

A Separating Equilibrium in Indiana

In the wake of Indiana's passage of the Religious Freedom Restoration Act, the following stickers have started appearing on storefronts across the state:


These signs allow business owners to signal their disapproval of the law, and if they spread sufficiently far and wide, will force those not displaying them to implicitly signal approval of the law. It's worth reflecting on the consequences of this for customer choices, the profitability of firms, and the beliefs of individuals about the preferences of those with whom they occasionally interact.

At any given location, the meaning of the symbol will come to depend on the number and characteristics of the nearby firms displaying it. If all businesses were to paste the sticker alongside their Visa and Mastercard logos, it would be devoid of informational content and would not influence customer choices; this is what game theorists quaintly call a babbling equilibrium

But it's highly unlikely that such a situation would arise. Some owners will display the sign as a matter of principle, regardless of it's effect on their bottom line, while others will adamantly refuse to do to even if profitability suffers as a result. 

Between these extremes lies a large segment of firms for whom the choice involves a trade-off between profit and principle. They may disapprove of the law and yet abstain from taking a public position, or they may approve and cynically pretend to disapprove. What they choose will depend on the distribution of characteristics in their customer base, as well as the choices made by other firms. 

In more liberal areas, such as college towns, those who display the stickers will likely profit from doing so, and owners concerned primarily with their profitability will be induced to join them. The meaning of the symbol will accordingly be diluted: some of those displaying it will be indifferent to the law or even mildly supportive. By the same token, the meaning of not displaying the symbol will be sharpened. Customers will sort themselves across businesses accordingly, with those opposed to the law actively avoiding businesses without stickers, thus reinforcing the effects on profitability and firm behavior.

In more conservative areas, those who display the stickers will likely experience a net loss of customers, and the meaning of the symbol will accordingly be quite different. Only those strongly opposed to the law will publicly exhibit their disapproval, and among those who abstain from displaying the stickers will be some who are privately opposed to the law. In this case customers opposed to the law will be less vigorous in seeking out businesses with stickers, again reinforcing the effects on profitability and firm behavior.  

Just as customers will come to know more about the private preferences of business owners, the owners will come to know more about the customers they attract and retain. Furthermore, customers in a given store will come to know more about each other. Bars and bakeries will become a bit more like niche bookstores, and casual interactions will become a bit more segregated along ideological lines. None of these are intended consequences of the law, but they are some of its predictable effects, and it's worth giving some thought to whether or not they are desirable.

I've heard it said that businesses in Indiana had the authority to deny service to some customers even prior to the passage of the new law, and that it therefore doesn't involve any substantive change in rights. Even so, it's a symbolic gesture that pins upon a group of people a badge of inferiority. Responding to this with a different set of symbols thus seems entirely appropriate.

Friday, December 19, 2014

Coordination, Efficiency, and the Coase Theorem

A recent post by Matt Levine starts out with the following observation:
A good general principle in thinking about derivatives is that real effects tend to ripple out from economic interests. This is not always true, and not always intuitive: If you and I bet on a football game, that probably won't affect the outcome of the game. But most of the time, in financial markets, it is a mistake to think of derivatives as purely zero-sum, two-party bets with no implications for the underlying thing. Those bets don't want to stay in their boxes; they want to leak out and try to make themselves come true.
Now one could object that you and I can't affect the outcome of a sporting event because neither of us is Pete Rose or Hansie Cronje, and that we can't affect credit events with our bets either. But this would be pedantic, and miss the larger point. Levine is arguing that the existence of credit derivatives creates incentives for negotiated actions that result in efficient outcomes; that the "Coase Theorem works pretty well in finance." 

To make his point, Levine draws on two striking examples in which parties making bets on default using credit derivatives spent substantial sums trying to make their bets pay off, using the anticipated revenues to subsidize their efforts. In one case a protection buyer provided financing on attractive terms for the reference entity (Codere), under the condition that it delay an interest payment, thus triggering a credit event and resulting in a payout on the bet. In the other case, a protection seller offered financing to the reference entity (Radio Shack) in order to help it meet contractual debt obligations until the swaps expire. The significance of these examples, for Levine, is that they are on opposite sides of the market: "the two sides can manipulate against each other, and in expectation the manipulations and counter-manipulations will cancel each other out and you'll get the economically correct result." 

Well, yes, if we lived in a world without transactions costs. Such a world is sometimes called Coasean, but it would be more accurate to describe it as anti-Coasean. The world of zero transactions costs that Coase contemplated in his classic paper was a thought experiment designed to illustrate certain weaknesses in the neoclassical method, especially as it pertains to the analysis of externalities. But the world in which these deals were made is one in which transactions costs are significant and pervasive. Given this, what do the examples really teach us? 

Transactions costs arise from a broad range of activities, including the negotiation and enforcement of contracts, and the coordination of efforts by multiple interested parties. In two party settings (such as the case of Sturges v. Bridgman explored by Coase) these costs can be manageable, since little coordination is required. But once multiple parties are involved transactions costs can quickly become prohibitive, in part because no stable agreement may exist. And as Levine himself usefully informs us, "there are a lot of credit default swaps outstanding on Radio Shack's debt, now about $26 billion gross and $550 million net notional." 

The two sides of this market are populated by multiple firms, each with different stakes in the outcome. For a single party on one side of the market to negotiate a deal with the reference entity requires that its position be large, especially in relation to those on the opposite side of the trade. The resulting outcome will reflect market structure and the distribution of position sizes rather than the overall gains from trade. The examples therefore point not to the relevance of the Coase Theorem, which Coase himself considered largely irrelevant as a descriptive claim, but rather to the fact that coordination trumps efficiency in finance. 

Saturday, September 06, 2014

The CORE Project

Back in October 2012 I got an unexpected email from Wendy Carlin, Professor of Economics at University College London, asking me to join her and a few others for a meeting in Cambridge, Massachusetts, to be held the following January. The goal was to "consider how we could better teach economics to undergraduates." Wendy motivated the project as follows:
People say that altering the course of the undergraduate curriculum is like turning around a half a million ton super tanker. But I think that the time may be right for the initiative I am inviting you to join me in proposing. 
First the economy has performed woefully over the past few decades in most of the advanced economies with increasing inequality, stagnant or declining living standards for many, and increased instability. Second, in the public eye economics as a profession has performed little better; with many of our colleagues offering superficial and even incorrect diagnoses and remedies. Third, what economists now know is increasingly remote from what is taught to our undergraduates. We can teach much more exciting and relevant material than the current diet... Fourth, the economy itself is grippingly interesting to students. 
I think that a curriculum that places before students the best of the current state of economic knowledge addressed to the pressing problems of concern... could succeed.
I attended the meeting, and joined a group that would swell to incorporate more than two dozen economists spread across four continents. Over the next eighteen months, with funding from the Institute for New Economic Thinking, we began to assemble a set of teaching materials under the banner of Curriculum Open-Access Resources in Economics (CORE).


A beta version of the resulting e-book, simply called The Economy, is now available free of charge worldwide to anyone interested in using it. Only the first ten units have been posted at this time; the remainder are still in preparation. The published units cover the industrial revolution, innovation, firms, contracts, labor and product markets, competition, disequilibrium dynamics, and externalities. For the most part these are topics in microeconomics, though with a great deal of attention to history, institutions, and experiments. The latter half of the book, dealing with money, banking, and aggregate activity is nearing completion and is targeted for release in November.

It is our hope that these materials make their way in some form into every introductory classroom and beyond. Instructors could use them to supplement (and perhaps eventually replace) existing texts, and students could use them to dig deeper and obtain fresh and interesting perspectives on topics they encounter (or ought to encounter) in class. And anyone interested in an introduction to economics, regardless of age, occupation or location, can work through these units at their own pace.

The unit with which I had the greatest involvement is the ninth, on Market Dynamics. Here we examine the variety of ways in which markets respond to changes in the conditions of demand and supply. The focus is on adjustment processes rather than simply a comparison of equilibria. For instance, we look at the process of trading in securities markets, introducing the continuous double auction, bid and ask prices, and limit orders. We examine the manner in which new information is incorporated into prices through order book dynamics. The contrasting perspectives of Fama and Shiller on the possibility of asset price bubbles are introduced, with a discussion of the risks involved in market timing and short selling.  Markets with highly flexible prices are then contrasted with posted price markets (such as the iTunes store) where changes in demand are met with pure quantity adjustments in the short run. We look at rationing, queueing and secondary markets in some detail, with reference to the deliberate setting of prices below market-clearing levels, as in the case of certain concerts, sporting events, and elite restaurants.

I mention this unit not just because I had a hand in developing it, but to make the point that there are topics covered in these materials that would not ordinarily be found in an introductory text. Other units draw heavily on the work of economic historians, and pay more than fleeting attention to the history of ideas. The financial sector makes a frequent appearance in the posted units, and will do so to an even greater extent in the units under development.

But far more important than the content innovations in the book are the process innovations. The material was developed collaboratively by a large team, and made coherent through a careful editing process. It is released under a creative commons license, so that any user can customize, translate, or improve it for their own use or the use of their students. Most importantly, we see this initial product not as a stand-alone text, but rather as the foundation on which an entire curriculum can be built. We can imagine the development of units that branch off into various fields (for use in topics courses), as well as the incorporation of more advanced material eventually making its way into graduate education.

So if you're teaching an introductory economics course, or enrolled in one, or just interested in the material, just register here for complete access without charge. We will eventually set up instructor diaries to consolidate feedback, and welcome suggestions for improvement. This is just the start of a long but hopefully significant and transformative process of creative destruction. 

Tuesday, August 19, 2014

The Agent-Based Method

It's nice to see some attention being paid to agent-based computational models on economics blogs, but Chris House has managed to misrepresent the methodology so completely that his post is likely to do more harm than good. 

In comparing the agent-based method to the more standard dynamic stochastic general equilibrium (DSGE) approach, House begins as follows:
Probably the most important distinguishing feature is that, in an ABM, the interactions are governed by rules of behavior that the modeler simply encodes directly into the system individuals who populate the environment.
So far so good, although I would not have used the qualifier "simply", since encoded rules can be highly complex. For instance, an ABM that seeks to describe the trading process in an asset market may have multiple participant types (liquidity, information, and high-frequency traders for instance) and some of these may be using extremely sophisticated strategies.

How does this approach compare with DSGE models? House argues that the key difference lies in assumptions about rationality and self-interest:
People who write down DSGE models don’t do that. Instead, they make assumptions on what people want. They also place assumptions on the constraints people face. Based on the combination of goals and constraints, the behavior is derived. The reason that economists set up their theories this way – by making assumptions about goals and then drawing conclusions about behavior – is that they are following in the central tradition of all of economics, namely that allocations and decisions and choices are guided by self-interest. This goes all the way back to Adam Smith and it’s the organizing philosophy of all economics. Decisions and actions in such an environment are all made with an eye towards achieving some goal or some objective. For consumers this is typically utility maximization – a purely subjective assessment of well-being.  For firms, the objective is typically profit maximization. This is exactly where rationality enters into economics. Rationality means that the “agents” that inhabit an economic system make choices based on their own preferences.
This, to say the least, is grossly misleading. The rules encoded in an ABM could easily specify what individuals want and then proceed from there. For instance, we could start from the premise that our high-frequency traders want to maximize profits. They can only do this by submitting orders of various types, the consequences of which will depend on the orders placed by others. Each agent can have a highly sophisticated strategy that maps historical data, including the current order book, into new orders. The strategy can be sensitive to beliefs about the stream of income that will be derived from ownership of the asset over a given horizon, and may also be sensitive to beliefs about the strategies in use by others. Agents can be as sophisticated and forward-looking in their pursuit of self-interest in an ABM as you care to make them; they can even be set up to make choices based on solutions to dynamic programming problems, provided that these are based on private beliefs about the future that change endogenously over time. 

What you cannot have in an ABM is the assumption that, from the outset, individual plans are mutually consistent. That is, you cannot simply assume that the economy is tracing out an equilibrium path. The agent-based approach is at heart a model of disequilibrium dynamics, in which the mutual consistency of plans, if it arises at all, has to do so endogenously through a clearly specified adjustment process. This is the key difference between the ABM and DSGE approaches, and it's right there in the acronym of the latter.

A typical (though not universal) feature of agent-based models is an evolutionary process, that allows successful strategies to proliferate over time at the expense of less successful ones. Since success itself is frequency dependent---the payoffs to a strategy depend on the prevailing distribution of strategies in the population---we have strong feedback between behavior and environment. Returning to the example of trading, an arbitrage-based strategy may be highly profitable when rare but much less so when prevalent. This rich feedback between environment and behavior, with the distribution of strategies determining the environment faced by each, and the payoffs to each strategy determining changes in their composition, is a fundamental feature of agent-based models. In failing to understand this, House makes claims that are close to being the opposite of the truth: 
Ironically, eliminating rational behavior also eliminates an important source of feedback – namely the feedback from the environment to behavior.  This type of two-way feedback is prevalent in economics and it’s why equilibria of economic models are often the solutions to fixed-point mappings. Agents make choices based on the features of the economy.  The features of the economy in turn depend on the choices of the agents. This gives us a circularity which needs to be resolved in standard models. This circularity is cut in the ABMs however since the choice functions do not depend on the environment. This is somewhat ironic since many of the critics of economics stress such feedback loops as important mechanisms.
It is absolutely true that dynamics in agent-based models do not require the computation of fixed points, but this is a strength rather than a weakness, and has nothing to do with the absence of feedback effects. These effects arise dynamically in calendar time, not through some mystical process by which coordination is instantaneously achieved and continuously maintained. 

It's worth thinking about how the learning literature in macroeconomics, dating back to Marcet and Sargent and substantially advanced by Evans and Honkapohja fits into this schema. Such learning models drop the assumption that beliefs continuously satisfy mutual consistency, and therefore take a small step towards the ABM approach. But it really is a small step, since a great deal of coordination continues to be assumed. For instance, in the canonical learning model, there is a parameter about which learning occurs, and the system is self-referential in that beliefs about the parameter determine its realized value. This allows for the possibility that individuals may hold incorrect beliefs, but limits quite severely---and more importantly, exogenously---the structure of such errors. This is done for understandable reasons of tractability, and allows for analytical solutions and convergence results to be obtained. But there is way too much coordination in beliefs across individuals assumed for this to be considered part of the ABM family.

The title of House's post asks (in response to an earlier piece by Mark Buchanan) whether agent-based models really are the future of the discipline. I have argued previously that they are enormously promising, but face one major methodological obstacle that needs to be overcome. This is the problem of quality control: unlike papers in empirical fields (where causal identification is paramount) or in theory (where robustness is key) there is no set of criteria, widely agreed upon, that can allow a referee to determine whether a given set of simulation results provides a deep and generalizable insight into the workings of the economy. One of the most celebrated agent-based models in economics---the Schelling segregation model---is also among the very earliest. Effective and acclaimed recent exemplars are in short supply, though there is certainly research effort at the highest levels pointed in this direction. The claim that such models can displace the equilibrium approach entirely is much too grandiose, but they should be able to find ample space alongside more orthodox approaches in time. 

---

The example of interacting trading strategies in this post wasn't pulled out of thin air; market ecology has been a recurrent theme on this blog. In ongoing work with Yeon-Koo Che and Jinwoo Kim, I am exploring the interaction of trading strategies in asset markets, with the goal of addressing some questions about the impact on volatility and welfare of high-frequency trading. We have found the agent-based approach very useful in thinking about these questions, and I'll present some preliminary results at a session on the methodology at the Rethinking Economics conference in New York next month. The event is free and open to the public but seating is limited and registration required.

---

Update: Chris House responds, leaping from the assertion that agent-based models disregard rationality and self-interest to the diametrically opposed claim that DSGEs are a special case of agent-based models. Noah Smith concurs, but seems to misunderstand not just the agent-based method but also the rational expectations hypothesis. Leigh Tesfatsion's two comments on Chris' posts are spot on, and it's worth spending a bit of time on her agent-based computational economics page. There you will find the following definition (italics added):
Agent-based computational economics (ACE) is the computational modeling of economic processes (including whole economies) as open-ended dynamic systems of interacting agents... ACE modeling is analogous to a culture-dish laboratory experiment for a virtual world. Starting from an initial world state, specified by the modeler, the virtual world should be capable of evolving over time driven solely by the interactions of the agents that reside within the world. No resort to externally imposed sky-hooks enforcing global coordination, such as market clearing and rational expectations constraints, should be needed to drive or support the dynamics of this world.
As I said in a response to Noah, the claim that DSGE's are a special case of agent-based models is not just wrong, it makes the case for pluralism harder to make. But the good news is that there seems to be a lot of interest in the approach among graduate students. I introduced the basic idea at the end of a graduate math methods course for first year PhD students at Columbia a couple of years ago, and it was really nice to see a few of them show up to the agent-based modeling session at the recent Rethinking Economics conference. I suspect that before long, knowledge of this (along with more orthodox methods) will be an asset in the job market.