Spontaneous Segregation of Agents Across Double Auction Markets
aa r X i v : . [ q -f i n . E C ] A ug Spontaneous Segregation of Agents Across DoubleAuction Markets
Aleksandra Alori´c † , Peter Sollich † , Peter McBurney ‡ † Department of Mathematics, King’s College London, Strand, London WC2R 2LS,UK ‡ Department of Informatics, King’s College London, Strand, London WC2R 2LS,UKE-mail: [email protected]
Abstract.
In this paper we investigate the possibility of spontaneous segregation intogroups of traders that have to choose among several markets. Even in the simplestcase of two markets and Zero Intelligence traders, we are able to observe segregationeffects below a critical value T c of the temperature T ; the latter regulates how stronglytraders bias their decisions towards choices with large accumulated scores. It is notablethat segregation occurs even though the traders are statistically homogeneous. Traderscan in principle change their loyalty to a market, but the relevant persistence timesbecome long below T c .
1. Introduction
Adam Smith, in his
The Wealth of Nations said that the concept of economic growthis deeply rooted in the division of labour. This primarily relates to the specialization ofthe labour force, where narrowing expertise allows better exploitation. Contemporaryexamples of such specialization include, e.g., airline companies: some specialize in firstclass and business flights, while others provide mainly low cost flights. The paper [8]reports segmentation phenomena in the informal credit market in the Philippines, wherelenders who specialize in trading make loans mainly to large and asset-rich farmers, whileothers lend more to small farmers and landless labourers.It can be argued that the space of customers is already segmented, and that therole of an efficient merchant is to find and adapt to niches in this customer space (seefor example [9]). However, here we want to explore the possibility of spontaneoussegregation of initially homogeneous traders. This work was motivated by observationsfrom the CAT Market Design Tournament [3] where competitors were invited to submitmarket mechanisms for a population of traders provided by the tournament organizers.It was observed that by co-adaptation of markets and traders the system evolved to asegregated state signalled by persistent “loyalty” of certain groups of traders to certainmarkets. pontaneous Segregation of Agents Across Double Auction Markets
2. Model
We consider a simplified model of markets and decision-making traders with the aimof investigating the segregation of traders. During each trading period agents areconfronted with a choice of actions: where to trade – choice of market – and how totrade – whether to act as buyer or seller . Decisions are made based on the attractions,which are accumulated scores an agent has received when taking actions in the past.The attractions to the various actions are updated after every trading period using areinforcement learning rule of the form ‡ A γ ( n + 1) = ( (1 − r ) A γ ( n ) + rS γ ( n ) , if agent has chosen action γ (1 − r ) A γ ( n ) , if agent has chosen action β = γ where S γ ( n ) is the return gained by taking action γ during n -th trade; r is the parameterthat describes the agent’s memory. Its intuitive meaning is that each attraction iseffectively an average of the returns over a shifting time window covering the previous ‡ Ref. [5] uses the same rule with ω = 1 − r , while in Ref. [10] the prescription used was A ( n +1) = S ( n )+(1 − α ) A ( n ). The second rule allows the attractions to increase to infinity, while in thefirst case, they are constrained. However, up to a temperature rescaling, the two rules are equivalent.The more important difference is that in the paper [10], the attractions of unplayed actions are updatedwith fictitious scores an agent would have got had he played the action, while we effectively updatethem with score S ( n ) = 0. pontaneous Segregation of Agents Across Double Auction Markets r trades. Finally, A γ ( n + 1) is attraction to the action γ after n trades, which willdetermine the action chosen in the following ( n + 1)-st trading period. The choiceof action is then calculated using the softmax § function: the probability of taking anaction γ is P γ ∝ exp ( A γ /T ). The temperature T regulates how strongly agents biastheir preferences towards the option that gathered them the highest score. For T → T → ∞ theychoose randomly among the options.Orders to buy/sell at a certain price (bids and asks) are generated by tradersindependently of previous success or any other information; the bids and asks areindependently identically distributed random variables (thus Zero Intelligence). Weassumed bids ( b ) and asks ( a ) are normally distributed ( a ∼ N ( µ a , σ a ) and b ∼N ( µ b , σ b )), with means satisfying µ b > µ a . The assumption that the average bid ishigher than the average ask is not crucial; it mainly allows a larger number of successfultrades as the resulting trading price is typically below the average bid and above theaverage ask. In the work of Gode and Sunder (Ref. [4]) various demand and supplycurves were used and thus both orderings of average bids and asks, h a i > h b i and h a i < h b i , were investigated: they lead qualitatively to the same results. We similarlyexplored the case µ a > µ b , and apart from the obvious quantitative consequence that asmaller fraction of orders is valid for trade and consequently the number of successfultrades is smaller, the qualitative results remain the same. Once all traders havesubmitted an order to the market of their choice, then at each market the average bid h b i and average ask h a i are calculated and the trading price is set as π = h a i + θ ( h b i − h a i )with θ being a parameter that describes the bias or the market towards buyers (for θ < /
2) or sellers (for θ > / k . All buyers who bid less and all sellers who ask morethan the trading price are removed from the trading pool, as their orders cannot besatisfied at the price that has been set. The remaining traders are matched in randompairs of buyers and sellers, giving a total number of trades min ( N valid bids , N valid asks ).For traders who manage to trade, the score is calculated as: S ( n ) = π − a n (sellers value getting more than they were asking for, i.e. a n ) S ( n ) = b n − π (buyers value when they pay less then they intended, i.e. b n )All traders who do not get to trade receive return S ( n ) = 0, and all orders are deletedfrom the market after each trading period. Figure 1 illustrates this market mechanism.The assignment of returns that we are using was introduced in Ref. [4], where it isassociated with budget constraints of ”Zero Intelligence-Constrained” traders. Exactlythese agents were shown to reproduce the efficiency of human traders in double auctionmarkets. In the original work, a n are cost values assigned to sellers, while b n are § The softmax function is commonly used in models of learning agents, see for example [5], [10].Another common formulation of the softmax function is P γ ∝ exp ( βA γ ), where β = 1 /T is sometimescalled the intensity of choice as in Ref. [2]. k Note that traders are not informed about these market biases, nor the market mechanism in general;they learn only by means of the scores they receive. pontaneous Segregation of Agents Across Double Auction Markets Figure 1.
Illustration of market mechanism. (Left) Histogram of bids and asksarriving at a given market. The inset shows how the trading price is set, with a biastowards average bid or average ask regulated by the bias parameter θ of the market.(Right) Once invalid orders are eliminated, i.e. bids below or asks above the tradingprice, the distributions of valid bids and asks remain. Traders who have submittedvalid orders are matched in random buyer-seller pairs for trading. redemption values assigned to buyers. Traders were allowed to trade only if the tradingprice was lower than the redemption value or higher than the cost value, thus the name constrained agents. Although the assignment of returns is the same in our model, wedo not use the term budget constrained in the description as our agents are allowed topersistently buy (or sell), which is possible only if there is no overall wealth constraint ¶ .In our model the bids and asks could similarly be interpreted as cost and redemptionvalues. We assume in addition that agents set orders based on these values, while theactual trading price is a function of the population averages.
3. Results and Discussion
In this section we will present the results from the simulations of the trading systemdescribed so far in this paper. Every system was defined in terms of the number ofagents N , the number of markets M = 2, the biases of the markets θ , θ , the means andstandard deviations of the distributions of bids and asks µ a , σ a , µ b , σ b , the temperature T and the forgetting rate r . For every set of parameters simulations were run for 10 , p B , p B , p S , p S for the four possibleactions of buying and selling at market 1 or 2. In the figures below, to help visualizationwe represent each agent by their total preference for buying ( p B = p B + p B ) and for ¶ We note that also in Ref. [4], agents were preassigned the role of a buyer or a seller and were notallowed to change this during trading, thus acting as if there was no overall constraint on the possessionof money/goods for trade. pontaneous Segregation of Agents Across Double Auction Markets p = p B + p S ). This is convenient as the corners in the ( p B , p ) plane thenrepresent the four pure strategies – agents always buying at market 1, etc. Similarly, inthe space of attractions we use two coordinates (∆ BS , ∆ ), which are basically attractionto buying as against selling and attraction to market 1 as against market 2. (a) (b) Figure 2.
Steady state distributions at temperature T = 0 .
29, with other parametersset to N = 200, M = 2, θ = 0 . θ = 0 . r = 0 . µ b − µ a = 1, σ a = 1, σ b = 1. 2(a):Distribution of attractions. 2(b): Distribution of preferences. In Figure 2 we present steady state attraction and preference distributions fortemperature T = 0 .
29. An initially narrow, delta peaked distribution (all scores areequal to 0) has been broadened due to diffusion arising from the random nature ofreturns. This steady state represents unsegregated behaviour of a population of traders.While the population does include some traders with moderately strong preferences forone of the actions, preferences remain weak on average. The population as a wholeremains homogeneous in the sense that there is no split into discernible groups.Figure 3 contrasts this scenario with the steady state of a system with exactly thesame set of parameters but at the lower temperature T = 0 .
14. The population oftraders now splits into four groups, with the agents persistently trading at one of themarkets, and thus we call this state segregated . The markets shown in this example(Figs. 2, 3) are biased so that if an agent buys at market 1, or sells at market 2 (actions B S
2) he is awarded with a higher score. The traders who prefer these actionsare “return-oriented traders” . However, if all traders were return-oriented, they wouldhave no partners for trading, and consequently they would received zero scores. Toenable trading, some traders have developed strong preferences for buying (selling) ata market that gives them a lower average return ( B S “volume-oriented traders” . Theoccurrence of segregation of an initially homogeneous population of traders into groupsof return-oriented and volume-oriented traders is the main qualitative result of this pontaneous Segregation of Agents Across Double Auction Markets (a) (b) Figure 3.
Steady state distributions in the low temperature regime ( T = 0 . paper.When assessing stationarity of our system we measured population and timeaverages for various observables ( A γ , ∆ BS ...). Depending on parameters, a stationarystate was generally reached reasonably quickly, mostly within the first 1 ,
000 tradingperiods. Apart from stationarity we also investigated to what extent our system isergodic, i.e. we wanted to exclude possibility that distributions in the low temperatureregime might be a consequence of some agents’ preferences becoming essentially frozen after the first few trades. Quantitatively, we measured persistence times in one of fourquadrants – “prefer buying at market 1” (∆ BS > > BS < > r , andusing the rescaled time t = rn , where n is the number of trading periods. (The use of t rather than n ensures that the trivial effect on persistence times of agents updatingtheir attractions more slowly at smaller r is removed.) From the Figure one sees that atsmall enough r , the onset of segregation is accompanied by a rapid increase in persistencetimes, showing that in the segregated state agents do indeed remain ”loyal” to a givenmarket for long times. On the other hand, we see that when temperatures are not toolow (i.e. above the levelling off of the small- r curves in Fig. 4) then persistence timesare short compared to the overall length of our runs, so that the system is ergodic.To quantify the observed change in the distributions of agent attractions orpreferences as we go from unsegregated to segregated states, we measured highercumulants of the distributions P (∆ BS ) and P (∆ ). Specially we tracked the Bindercumulant : B = 1 − h ∆ i h ∆ i . Figure 5 shows values of this Binder cumulant for varioustemperatures of the system, with all other parameters being same as in the previousfigures. For higher temperatures, the Binder cumulant of our distributions approaches pontaneous Segregation of Agents Across Double Auction Markets Temperature - T R e s c a l e d t i m e t = n r r=0.01r=0.1r=0.05 Figure 4.
Average time an agent persists in any one of the four preference quadrants,plotted against temperature for different values of the forgetting rate, r = 0 . r = 0 .
05 (red) and r = 0 .
01 (green). Dashed lines are sketches of how the persistencetimes would increase further if they were not limited by the length of our simulationruns. Other parameters (as previously): N = 200, M = 2, θ = 0 . θ = 0 . µ b − µ a = 1, σ a = 1, σ b = 1. value characteristic of Gaussian distributions ( B = 0) as expected. At the other extreme,in the low temperature regime, the cumulant approaches a second characteristic value B = 2 /
3, which is the Binder cumulant of a distribution consisting of two sharp peakswith equal weight. The transition between these two regimes is sharper for smallervalues of r , making it possible to estimate the critical temperature for the onset ofsegregation.Our simulation results suggest that even our simplified trading system shows richand interesting behaviour. There exists a critical temperature T c , such that for values T < T c the system segregates, i.e. the population of initially homogeneous traders splitsinto groups that persistently choose to trade at a specific market. The persistence timesincrease strongly with decreasing forgetting rate r (see Fig. 4) and we conjecture thatin the limit r → T c in the sense that the persistence timediverges there. The exact value of the critical temperature is a function of the marketparameters, and for the values of θ , used above, we would estimate it from Figure 5to be T c ≈ . T is lowered, a simple mathematical description wouldevidently be useful. To obtain such a description, we can build on the approach ofRef. [2]. This work studies the dynamics of agents who have to decide whether topurchase a sophisticated price predictor, or use a freely available naive predictor ofprice. This scenario differs from our model in a number of ways; apart from the more pontaneous Segregation of Agents Across Double Auction Markets Temperature - T B i nd e r c u m u l a n t r=0.01 P( ∆ )r=0.1 P( ∆ )r=0.01 P( ∆ BS )r=0.1 P( ∆ BS ) Figure 5.
Binder cumulant for P (∆ BS ) and P (∆ ) distributions, averaged over last100 trading periods versus temperature for two different values of the forgetting rate, r = 0 . r = 0 .
01. Other parameters as previously N = 200, M = 2, θ = 0 . θ = 0 . µ b − µ a = 1, σ a = 1, σ b = 1. sophisticated trading strategies of the agents, it assumes perfect information aboutprevious prices and about the performance of any price predictor. What is importantin the analysis of Ref. [2], however, is that the limit of a large population of agents isimplicitly taken, so that the system can be described entirely in terms of the fractionof agents choosing a given action (price predictor) at any instant in time, with thesefractions evolving deterministically in time. The authors of Ref. [2] show that dependingon the temperature, or the ”intensity of choice” β = 1 /T , these two fractions can exhibitrich dynamics. The origin of this is that when all traders use sophisticated predictors,the cost of this predictor leads some agents to start choosing the free predictors, whilethere is a reverse effect from positive feedback when all traders use the simple predictor.To adopt a similar approach for our model, we realize that mathematically ourdynamics is Markovian, provided that we keep track of the attractions A iγ to all actions γ = B , S , B , S i = 1 , . . . , N . Working with this description in a4 N -dimensional continuous state space is, however, very difficult. As in Ref. [2] wecan therefore consider the large N -limit where the trading price at each market is nolonger affected by fluctuations in the number and value of orders submitted. We alsoconsider the limit of small r , using as time unit again the rescaled time t = rn so thata unit time interval in t corresponds to 1 /r trading periods. The fluctuations in eachindividual agent’s attractions then also tend to zero because they are averaged overmany ( ∼ /r ) returns each contributing a small ( ∼ r ) change of attraction. As long asthe agent population remains homogeneous, all agents should in the limit have the sameattractions A γ . In that case the system is described entirely in terms of the average pontaneous Segregation of Agents Across Double Auction Markets γ . As these fractions add to unity it is enough to keep track of three ofthem, and one can write down deterministic equations for their time evolution.(Detailsare beyond the scope of this paper and will be given elsewhere.)The results of the above approach for our model are still somewhat difficult tovisualize as we need to track fixed points and trajectories in a three-dimensional space.We therefore switch to a simpler system that gives qualitatively similar results: apopulation of traders consisting of two equal-sized groups with fixed preference forbuying p (1) B and p (2) B , respectively. The agents then only choose between two actions,namely, whether to go to market 1 or 2 in each trading period. Although the systemwhere agents change their buy-sell preferences is more plausible behaviourally, the two-group model still undergoes segregation and requires us (for N → ∞ , r → f (1) and f (2) . InFigure 6 we present the flow diagrams that we find for the time evolution of these twofractions, at high and low T . At high temperature, one observes a single fixed pointas expected (Fig 6 (a)). As T is lowered, this fixed point becomes unstable, and twoadditional stable fixed points appear ((Fig 6 (b)). The temperature where the high- T fixed point first becomes unstable thus identifies the critical temperature T c for the onsetof segregation. We also find that the new stable fixed points evolve continuously fromthe high- T fixed point as T is lowered through T c , so the segregation transition has thecharacter of a bifurcation and is continuous.It is worth emphasizing that the locations of the new fixed points that appear atlow temperature are not necessarily meaningful: as explained above, the simplificationsthat have allowed us to consider deterministic time evolution in a simple two-dimensionalspace require that the agent population remains homogeneous. By construction, thissimple picture can therefore not describe quantitatively the segregated populations ofagents that arise below T c . Nevertheless, the instability of the high- T unsegregated fixedpoint is enough to identify the temperature for the onset of segregation.The analytical description sketched briefly above allows us to study, for example,how the value of the critical temperature T c depends on the parameters of the problem,specifically for the two-group model on p (1) B and p (2) B and on the market biases θ and θ . As an example, Figure 7 shows how T c varies with the market bias, still for the caseof symmetric markets θ = 1 − θ = θ . One sees that for every value θ there exists acritical temperature T c at which a bifurcation to a segregated steady state occurs. Notethat the temperature region where segregation occurs shrinks as the difference betweenthe market biases increases (smaller θ ), showing that segregation is a collective effectrather than being trivially driven by the differences between the markets. For θ = 0 . T c ( θ ) = 0 . N = 100traders and forgetting rate r = 0 .
1, we estimate a value of T c ≈ .
3. This is an excellentagreement with the theoretical prediction, especially bearing in mind that the latterapplies directly only to the limit N → ∞ and r → pontaneous Segregation of Agents Across Double Auction Markets f H L f H L (a) T = 0 . f H L f H L (b) T = 0 . Figure 6.
Flow diagrams that describe the large population dynamics of our two-group model in the space of fractions of agents from each group who choose market1. f (1) is the fraction going to market 1 in the group of agents who typically sell( p (1) B = 0 . f (2) the corresponding fraction in the group of “buyers” ( p (2) B = 0 . θ = 0 . − θ . 6(a) High temperature: thedynamics has a single fixed point. 6(b) Low temperature: single fixed point hasbecome unstable. In our original model where the agents can adapt their preferences both for the twomarkets and for whether to buy or sell, the quantitative agreement is slightly less good.E.g. for θ = 1 − θ = 0 . T c ≈ . N = 200traders with forgetting rate r = 0 .
1, on the other hand, lead to the estimate T c ≈ .
4. Concluding remarks
With so much trade and commerce moving online over the last two decades, the study,design, operation, and good governance of electronic marketplaces has become a majorarea of computer science, both theoretical and applied. Much online economic activity— for example, most trading in western financial markets — is now undertaken byautomated computer programs, which are software agents acting on behalf of humanprincipals or companies. A key research goal in the study of electronic marketplacesis, therefore, to understand the long-run dynamics of these markets when populated byautomated software traders. This leads to questions such as: what long-run states arepossible in these marketplaces, what patterns in states occur or recur, what states maybe avoided and how, what states may be encouraged to occur and how, etc. The practicaleconomic and financial consequences of such understanding are immense. The so-called pontaneous Segregation of Agents Across Double Auction Markets Θ T Figure 7.
Segregation temperature T c versus market bias θ = 1 − θ = θ . In thisdiagram T c ( θ ) separates segregated (light blue) and unsegregated (dark blue) steadystates. Results are shown for the two-group model with the two groups of agentshaving fixed buying preferences of p (1) B = 0 . p (2) B = 0 .
8, respectively.
Flash Crash of US stock markets on 6 May 2010 showed the vulnerability of inter-linkedtrading systems to a single large trade, for example, and has led to the implementationof automated “circuit breakers” to eliminate or reduce the sector-wide impacts of rapidmarket movements [1]. The importance of these issues is shown by the establishment ofa major research programme by the UK Government’s Department of Business, Industryand Skills on computer trading in financial markets + . Our research in this same veinfocuses on a description of a specific characteristic of trading systems — segregation.As argued in the introduction, specialized (segregated) traders might be better in termsof exploitation of a market. However with specialization there comes an associatedvulnerability as agents become more exposed to losses if all their investments are focusedon a single market that might crash. Ultimately, we would like to describe and predictthe long-run dynamics of marketplaces comprising automated interacting traders andto extract a set of regulations that might promote or suppress the segregation.In this paper we introduced a simplified model of double auction mechanismswith Zero Intelligence traders, with the goal of investigating the possibility of aspontaneous segregation of traders. The use of ZI traders was motivated by thehypothesis that segregation can emerge as a consequence of market mechanisms andlearning rules, neglecting complexity in trading strategies. We presented results form + See: pontaneous Segregation of Agents Across Double Auction Markets
References [1] Findings Regarding the Market Events of May 6, 2010.
Report of the staffs of the CFTC and SECto the Joint Advisory Committee on Emerging Regulatory Issues , (2010).[2] W. A. Brock and C. H. Hommes: Rational Route to Randomness.
Econometrica , (5): 321–354,(1997).[3] K. Cai, E. Gerding, P. McBurney, J. Niu, S. Parsons, and S. Phelps. Cat overview. Technicalreport, Univ. of Liverpool, (2009).[4] D. K. Gode and S. Sunder: Allocative Efficiency of Markets with Zero-Intelligence Traders: Marketas a Partial Substitute for Individual Rationality. The Journal of Political Economy , (1):119–137, (1993).[5] N. Hanaki, A. Kirman, and M. Marsili: Born under a lucky star?. Journal of Economic Behaviour& Organization , (3): 382–392, (2011).[6] Z. Huang, J. Zhang, J. Dong, L. Huang, and Y. Lai: Emergence of Grouping in Multi-ResourceMinority Game Dynamics. Scientific Reports , : 703, (2012).[7] D. Ladley: Zero Intelligence in Economics and Finance. The Knowledge Engineering Review , (2): 273–286, (2012).[8] G. Nagarajan, R. L. Meyer, and L. J. Hushak: Segmentation in the Informal Credit Markets - TheCase of the Philippines. Agricultural Economics , (2): 171–181, (1995).[9] E. Robinson, P. McBurney, and X. Yao: Co-learning Segmentation in Marketplaces. Lecture Notesin Computer Science , : 1–20, (2012).[10] Y. Sato and J. P. Crutchfield: Coupled Replicator Equations for the Dynamics of Learning inMultiagent Systems. Physical Review E ,67