Feng (pnas, 2012) inking agent based models and stochastic models of financial markets
Upcoming SlideShare
Loading in...5

Feng (pnas, 2012) inking agent based models and stochastic models of financial markets






Total Views
Views on SlideShare
Embed Views



0 Embeds 0

No embeds


Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

Feng (pnas, 2012) inking agent based models and stochastic models of financial markets Feng (pnas, 2012) inking agent based models and stochastic models of financial markets Document Transcript

  • Linking agent-based models and stochasticmodels of financial marketsLing Fenga,b,c,1, Baowen Lia,b,1, Boris Podobnikc,d,e,f, Tobias Preisc,g,h, and H. Eugene Stanleyc,1a Graduate School for Integrative Sciences and Engineering, National University of Singapore, Singapore 117456, Republic of Singapore; bDepartment ofPhysics and Centre for Computational Science and Engineering, National University of Singapore, Singapore 117542, Republic of Singapore; cCenter forPolymer Studies and Department of Physics, Boston University, Boston, MA 02215; dFaculty of Civil Engineering, University of Rijeka, 51000 Rijeka,Croatia; eFaculty of Economics, University of Ljubljana, 1000 Ljubljana, Slovenia; fZagreb School of Economics and Management, 10000 Zagreb, Croatia;g Chair of Sociology, in particular of Modeling and Simulation, Eidgenössische Technische Hochschule Zurich, 8092 Zurich, Switzerland; and hArtemisCapital Asset Management GmbH, 65558 Holzheim, GermanyContributed by H. Eugene Stanley, March 29, 2012 (sent for review December 6, 2011)It is well-known that financial asset returns exhibit fat-tailed Market surveys (16–18) also provide clear evidence of the preva-distributions and long-term memory. These empirical features lence of technical analysis. We consider here only technical tra-are the main objectives of modeling efforts using (i) stochastic ders, assuming that fundamentalists contribute only to marketprocesses to quantitatively reproduce these features and (ii) noise. Our study is of the empirical data recorded prior toagent-based simulations to understand the underlying microscopic 2006 and ignores the effect of high frequency trading (HFT) thatinteractions. After reviewing selected empirical and theoretical has become significant only in the past 5 y. We propose a beha-evidence documenting the behavior of traders, we construct an vioral agent-based model that is in agreement with the followingagent-based model to quantitatively demonstrate that “fat” tails empirical evidence:in return distributions arise when traders share similar technicaltrading strategies and decisions. Extending our behavioral model i. Random trading decisions made by agents on a daily basis. n0to a stochastic model, we derive and explain a set of quantitative technical traders use different trading strategies, hence theirscaling relations of long-term memory from the empirical behavior decisions to buy, sell, or hold a position appear to be random. A trading decision is made daily because empirical studiesof individual market participants. Our analysis provides a behavior- report the lack of intraday trading persistence in empiricalal interpretation of the long-term memory of absolute and squared trading data (19). Market survey (16) also shows that fundprice returns: They are directly linked to the way investors evaluate managers put very little emphasis on intraday tradings. We es-their investments by applying technical strategies at different timate the probability p of having daily trade empirically frominvestment horizons, and this quantitative relationship is in agree- trading volumes.ment with empirical findings. Our approach provides a possible ii. Price returns. The price return rt ≡ st − st−1 is controlled bybehavioral explanation for stochastic models for financial systems the imbalance dt between the demand and the supply ofin general and provides a method to parameterize such models stocks—the difference in the number of buy and sell tradesfrom market data rather than from statistical fitting. each day. The excess in total demand or supply moves the price up or down, where the largest r t occurs when all traderscomplex systems ∣ power law ∣ scaling laws act in unison, when they all either buy or sell their stocks. We assume this relationship between price change r t and dt to beM odeling price returns has become a central topic in the study of financial markets due to its key role in financialtheory and its practical utility. Following models by Engle and linear each day, as supported by empirical findings (20, 21). iii. Centralized interaction mechanism of returns on technical strategies. For technical traders, an important input para-Bollerslev (1, 2), many stochastic models have been proposed meter in their strategies is past price movement (22, 23).based on statistical studies of financial data to accurately repro- Consequently, prices and orders reflect a main interactionduce price dynamics. In contrast to this stochastic approach, mechanism between agents. In many agent-based models,economists and physicists using the tools of statistical mechanics the interaction strength between agents need to be adjustedhave adopted a bottom-up approach to simulate the same macro- with agent population size (5, 24, 25) or interaction structurescopic regularity of price changes, with a focus on the behavior (26) to sustain “fat” tails in return distributions. Here we pro-of individual market participants (3–10). Although the second so- pose a centralized interaction mechanism (price change)called agent-based approach has provided a qualitative under- among agents so that the strength of interaction grows withstanding of price mechanisms, it has not yet achieved sufficient agent population and is unaffected by interaction structure.quantitative accuracy to be widely accepted by practitioners. iv. Opinion convergence due to price changes. This is the unique Here, we combine the agent-based approach with the stochas- mechanism that distinguishes our model from other models.tic process approach and propose a model based on the empiri- It specifies the collective behavior of technical traders. Duffycally proven behavior of individual market participants that et al. (27) found that agents learn from each other and tend toquantitatively reproduces fat-tailed return distributions and adopt the strategy that gives the most payoff. Given the pricelong-term memory properties (11–14). patterns at any point in time, a few most profitable technical strategies dominate the market because every technical traderEmpirical and Theoretical Market BehaviorsWe start by arguing that technical traders (usually agents seekingarbitrage opportunities and make their trading decisions based on Author contributions: L.F., B.L., B.P., T.P., and H.E.S. designed research; L.F., B.L., B.P., T.P., and H.E.S. performed research; L.F., B.L., B.P., T.P., and H.E.S. contributed new reagents/price patterns) contribute much more to the dynamics of daily analytic tools; L.F., B.L., B.P., T.P., and H.E.S. analyzed data; and L.F., B.L., B.P., T.P., andstock prices St (or log price st ≡ lnðSt Þ) than fundamentalists H.E.S. wrote the paper.(who attempt to determine the fundamental values of stocks). The authors declare no conflict of interest.Although fundamentalists hold a majority of the stocks, they 1 To whom correspondence may be addressed. E-mail: g0801896@nus.edu.sg, phylibw@trade infrequently (see SI Appendix, Fig. S6). In contrast, techni- nus.edu.sg, or hes@bu.edu.cal traders contribute most of the trading activities (15) by trading This article contains supporting information online at www.pnas.org/lookup/suppl/their minority holdings more frequently than fundamentalists. doi:10.1073/pnas.1205013109/-/DCSupplemental.8388–8393 ∣ PNAS ∣ May 29, 2012 ∣ vol. 109 ∣ no. 22 www.pnas.org/cgi/doi/10.1073/pnas.1205013109
  • wants to maximize his/her profit by using the most profitable simulations because it produces results that are numerically strategy copied from each other (The most profitable strategy close to empirical findings. The case of ω ¼ 1 corresponds would become less profitable when most agents adopt it, and a to jr t jmin ¼ 1, and there is only one more buy/sell order than new profitable strategy emerges from the new price trends; sell/buy order. The result with different ω is presented in soon agents will flock to the new profitable strategy until it the end of this section. When market noise is considered, is no longer profitable. This is similar to the regime switching ctþ1 ∼ Nðn0 ∕jr t j; σc Þ, where N denotes the normal (Gaussian) 2 phenomenon in various agent-based models.). On the other distribution and σc ¼ b · n0 ∕jr t j quantifies market noise due to 2 hand, the individual strategies used by different technical tra- external news events. ders differ in their parameterizations of the buy/sell time, amount of risk tolerated, or portfolio composition (15). So To obtain an empirical value for daily trading probability p, when the input signal—the previous price change r t−1 —is we choose 309 companies from the Standard and Poor’s 500 small, every agent acts independently. When the input signal index traded over the 10-y period 1997–2006. Only 309 of the is large, the agents act more in concert, irrespective of their 500 total stocks were consistently listed during the entire 10-y differences in trading strategies. During the spreading panic period, and they are the ones we choose. We define the trading of market crashes, for example, most agents sell their stocks velocity V of an agent as the total number of shares he/she trades (and market makers are likely to make losses in such circum- in a year, divided by the number of shares, he/she owns on aver- stances). This supports the empirical finding that large price age over a year swings occur when the preponderance of trades have the same buy/sell decision indicated in the findings by Gabaix Number of trades V ¼ : [4] X. et al. (28). Number of sharesBehavioral Model and Results From the Compustat database, we divide the total number ofBased on the items of evidence (i)–(iv) listed above we construct shares traded on the market by the number of outstanding sharesa three-step behavioral model: of each stock and obtain the average yearly trading velocity, V , for these stocks through the 10-y period. Thus we obtain,• Step 1. Based on evidence (i), we assume n0 agents, each of equal size 1. Each day, a trading decision ψ i ðtÞ is made by each V ¼ 1.64; [5] agent i, 8 where the value of V varies from 1.3 to 1.9 throughout the 10 y. >1 with probability p ⇒ buy; Note that V > 1 means that, on average, each stock changes its < ψ i ðtÞ ≡ −1 with probability p ⇒ sell; owner more than once during a year. From the data documented > by Yahoo! Finance, we assume that institutional owners are fun- APPLIED PHYSICAL : 0 with probability 1 − 2p ⇒ hold: damentalists and that the rest of the traders are predominantly SCIENCES technical traders. The percentage of outstanding shares held by• Step 2. Based on evidence (ii), we define price change r t to be institutional owners is usually higher than 60%, and the average proportional to the aggregate demand dt , i.e., the difference in value is 83% (SI Appendix, Fig. S6A). the number of agents willing to buy and sell, Assuming institutional owners are fundamentalists with invest- n0 ment (trading) horizons longer than 1 y (they trade less frequently rt ≡ kdt ¼ k ψ i ðtÞ: [1] than once a year), we calculate the value of p as follows. We let ECONOMIC SCIENCES ∑ i¼1 the average yearly trading velocity of fundamentalists be V f , then the average yearly trading velocity of technical traders V c is Trading volume is equal to the total number of trades in this case because every agent has the same trading size of 1. Hence V c ¼ ðV − 0.83V f Þ∕ð1 − 0.83Þ: [6] daily trading volume N t is defined as Because there are about 250 trading days in a year, we calculate n0 the daily trading probability p Nt ≡ jψ i ðtÞj [2] p ¼ V c ∕ð250 · 2Þ: [7] ∑ i¼1 and k is the sensitivity of price change with respect to dt . We set Because fundamentalists have an investment horizon longer k to 1 because a choice for k does not affect the statistical prop- than 1 y, V f < 1 (see Eq. 4). We arbitrarily set V f to be 0.2, erties. Note that, according to Step 1, maximum (minimum) dt 0.4, 0.6, 0.8, and estimate the corresponding values of p as means that all agents are in collective mode when they behave 0.0174, 0.0154, 0.0134, 0.0115, respectively. For ðV f ; pÞ ¼ the same, all of them either buy or sell stocks. ð0.4; 0.0154Þ, we find that approximately 80% of the trading• Step 3. Based on evidence (iii) and (iv), at day t þ 1 each volume is contributed by technical traders. agent’s opinion is randomly distributed into each of the ctþ1 We compare the simulation results from our behavioral model opinion groups where (Steps 1, 2, and 3) with those obtained for the empirical set of stocks comprising the S&P 500 index. For the cumulative distri- ctþ1 ¼ ðn0 ∕jr t jÞ ω ; [3] bution (CDF) of both absolute returns and number of trades. Fig. 1 shows that the model reproduces the empirical data in both in which all agents comprising the same opinion group execute the central region and the tails. In particular, both model and the same action (buy, sell, or hold) with the same probability p empirical distributions have power-law tails (Pðjr t j > xÞ∼ as in Step 1. Because 1 ≤ ctþ1 ≤ n0 , Eq. 3 implies (a) when the x −ξr ; Pðnt > xÞ ∼ x −ξn ) (13, 29–31) where the power-law expo- previous return is maximum, jr t jmax ¼ n0 (everyone buys/sells), nents ξr and ξn that we obtain for the empirical data by applying there is only one trading opinion among the agents; (b) when the Hill’s estimator are in agreement with the ones obtained for ðω−1Þ∕ω the previous return is minimum jr t jmin ¼ n0 (see SI empirical data (32). Appendix, Section 5), there are n0 opinions and every agent acts It is worth noting that with different values of ω in Eq. 3, the independently of one another. We use ω ¼ 1 in most of our tail exponent ξr for the absolute return distribution varies asFeng et al. PNAS ∣ May 29, 2012 ∣ vol. 109 ∣ no. 22 ∣ 8389
  • Fig. 1. Comparison of the distributional properties of simulations with empirical results for the parameter set V f ¼ 0.4, n0 ¼ 2 10 , b ¼ 1.0. V f characterizesthe how fast one agent’s shares is traded. Empirical data are from the 309 stocks out of S&P 500 index components that have been consistently listed during the10-y period 1997–2006. There are ≈800;000 data points in empirical data, and 1,000,000 sample points from simulation. (A) Cumulative distributions of dailyreturns, defined as r t ≡ log½x t;close Š − log½x t;open Š, the difference between the daily opening and closing price of a stock on day t. Thus we ignore overnightreturns arising, e.g., due to news events. The price for each stock is normalized to zero mean and unit variance before aggregation into a single distribution.The simulation results agree with the shape of the empirical distribution. The Hill estimator on 1% of tail region gives ξr;S&P500 ¼ 3.69 Æ 0.07,ξr;simulation ¼ 4.08 Æ 0.08. (B) The cumulative distribution of the same set of data but analyzed on the daily number of trades. Because the number of tradesincreases each year, we normalize the data by each stock mean number of trades on a yearly basis before aggregating them into the distributions. The simula-tion again reproduces the empirical results. The Hill estimator applied to 2.5% of the tail region gives ξn;S&P500 ¼ 4.02 Æ 0.07, ξn;simulation ¼ 4.02 Æ 0.08.shown in Table 1. We find that ω ¼ 1 gives the tail exponent ξr Again we note that the variance σt2 in Eq. 8 is not constant butthat is closest to empirical finding (see SI Appendix, Section 5 for is time dependent, and time-dependent variances are commonlythe implication of different values in ω). found in a variety of empirical outputs where phenomena are ran- Overall, we are able to generate power-law distributions in ging from finance to physiology (2, 36). They are widely modeledboth returns and number of trades in agreement with empirical with the Autoregressive Conditional Heteroskedasticity (ARCH)data. The fact that we are able to capture the trends in the two process (1). Here we provide a possible explanation for thehighly correlated quantities (33) implies a very plausible mechan- ARCH effect found in financial data in terms of the behaviorism underlying our model. Furthermore, the tail exponent ξr is of technical traders—larger previous price change r t−1 brings tra-invariant with respect to different values of agent population sizen0 and fundamentalists’ investment horizon V f (Table 2 and SI ders’ opinions closer to each other, resulting in large subsequentAppendix, Section 1). In particular, the insensitivity of the result price fluctuations. Theoretical analysis on Eq. 8 leads to the fat-to the number of agents n0 distinguishes this model to most other tailed return distributions (SI Appendix, Section 2) ubiquitouslyagent-based models (34, 35). observed in real data, and in our case a power-law tail. Previous works have generated ARCH effect from other mechanisms thatExtension to Stochastic Model is different from our model (37).Next we study the underlying stochastic process of our behavioral The time-dependent variance of Eq. 8 defined by the most re-model (Step 1 to Step 3). The mechanism of opinion convergence cent price change r t−1 is therefore based on short memory in theunder price changes is incorporated into a mathematical form for previous r t . To this end, we further extend our behavioral modelan analytical understanding. Step 3 in our behavioral model in- with two more items of empirical evidence:dicates that the daily price change is not deterministic, where itsvariance σt2 ≡ Eðr t − Eðr t ÞÞ 2 is related to total number of opinion v. Technical strategies are applied at different return intervals. Ingroups ct , which is determined directly by previous return r t−1 . On contrast to the simplistic realization in our behavioral modelaverage, each opinion group has jr t−1 j agents, and we have (Step 1 to Step 3) in which technical traders make their de- cisions only upon the most recent daily returns (see Eq. 8 σt2 ≡ Eðr t2 jr t−1 Þ ¼ ct · ½p · r t−1 þ p · ð−rt−1 Þ 2 þ ð1 − 2pÞ · 0Š 2 and Step 3), market survey (16) indicates that technical stra- [8] tegies in practice are applied at different investment horizons σt2 ¼ 2pn0 jr t−1 j: ranging from 1 d to more than 1 y. This finding implies that agents calibrate their technical strategies based on returns ofBecause σt presents the standard deviation of price change rt , different time horizons, i.e., how stock preformed during thewe can model price change as r t ¼ σt ηt , where ηtþ1 is a random last day, week, month, up to year, or even longer. Most tech-variable with zero mean and unit variance, and its distribution is nical strategies are focused on short-term returns of a fewdetermined by Step 3. For simplicity, we use a normal distribution days, and fewer are focused at yearly returns according tofor ηt , although we find that other distributions, such as t-distri- the survey (16).bution, give similar results in our analysis (SI Appendix, vi. Increasing trading activity in volatile market conditions.Section 4). Agents tend to trade more after large price movements. Dif- ferent technical strategies set different thresholds on prices to trigger trading decisions (38), so large price fluctuations areTable 1 Tail exponents of absolute return distribution with likely to trigger more trades. Hence the probability of dailydifferent ω trade p is directly related to past returns. Because a large pro- portion of technical strategies is applied with short investmentω 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.4 1.5 2.0 horizons, price changes from previous days have larger impactξr 2.3 2.5 2.7 3.0 3.3 3.8 4.3 4.4 5.9 7.8 9.4 on p than price changes from past year.8390 ∣ www.pnas.org/cgi/doi/10.1073/pnas.1205013109 Feng et al.
  • Table 2 Tail exponents of absolute return distribution with different values of V f and n0 n0 ¼ 2 10 , b ¼ 1.0 V f ¼ 0.4, b ¼ 1.0 Parameter value V f ¼ 0.2 V f ¼ 0.4 V f ¼ 0.6 V f ¼ 0.8 n0 ¼ 2 8 n0 ¼ 2 10 n0 ¼ 2 12 n0 ¼ 2 14 Tail exponents ξr 3.69 ± 0.07 3.69 ± 0.07 3.74 ± 0.07 3.89 ± 0.07 3.86 ± 0.07 3.70 ± 0.07 3.66 ± 0.07 3.69 ± 0.07 The survey on US market (16) allows us to estimate the relative all opinion convergence with a weight αi . Even without knowingproportion of technical analysis applied at different investment the exact contribution of jst − st−i j in the overall opinion conver-horizons. Precisely, agents having investment horizon i days gence, by taking its first order effect with weight αi , we wouldare affected by price change in the past i days, and the relative have the functional form of Eq. 10.portion of such traders is characterized by αi . Fig. 2 illustrates this To take into account the effect of increasing trading activityplot, and we find that the curve follows a power-law decay with when market is more volatile, we assume that traders place tech-exponent d ¼ 1.12, i.e., αi ∝ i −d . As different agents look at re- nical thresholds based on returns of different horizons, and thatturns over time scales of differing lengths, their trading opinions the proportion of traders with different horizons is determined byare affected by the past returns of history longer than one day, so the same survey results reported in ref. (16). Similar to the con-is the convergence of their collective opinions. Agents having in- struction of cluster formation in Eq. 9, we define the time-depen-vestment horizon i days are affected by price difference in the dent probability of trading as ptþ1 ≈ p0 þ α 0 Σt . By p0 we denotepast i days, and the relative portion of such traders are charac- the base trading activity (largely due to fundamentalists) and α 0 Σtterized by αi . Hence the convergence of opinions is not only af- is the additional trade due to threshold crossing by technical tra-fected by the previous day’s return but also the price difference of ders. Therefore we transform Eq. 10 tolonger durations. Therefore Eq. 3 is better written as σtþ1 ≈ 2ptþ1 n0 αΣt ¼ 2αn0 ðp0 þ α 0 Σt ÞΣt 2 n0  2 ctþ1 ¼ M ; [9] αn0 p02 p αi jst − st−i j ¼− þ 2αα 0 n0 Σt þ 0 0 : ∑i¼1 2α 0 2αwhere M is the maximum investment horizon for which technical The first term is very small compared to the second term becauseanalysis is applied, and αi is the proportion of agents focusing on technical traders dominate trading activities. Hence, we caninvestment horizon i and it decays with i as αi ∝ i −d as in Fig. 2. ignore the first constant term and focus on the second quadraticWhen M ¼ 1, Eq. 9 is identical to Eq. 3, which is the scenario for term. Therefore, the previous equation transforms to APPLIED PHYSICALhomogeneous investment horizon of 1 d. jst − st−i j is used as asimplified information content for technical traders with invest- pffiffiffiffiffiffiffiffiffiffiffi  SCIENCES pment horizon i. Because there can be at least one opinion group, σtþ1 ≈ 2αα 0 Σt þ 0 0 ¼ A þ BΣt : [11]this boundary condition requires ∑M αi ¼ 1. From Eq. 9, Eq. 8 is 2α i¼1transformed into Constant A is a scaling parameter defining the average size of M returns, and B characterizes the relative portion of trades accom- σtþ1 ¼ 2pn0 2 αi jst − st−i j ¼ 2pn0 αΣt ; [10] plished by technical traders (due to crossing the thresholds) vs. ECONOMIC SCIENCES background trading activities (mostly by fundamentalists). Eq. 11 ∑ i¼1 has similar functional form as σtþ1 in the fractional integratedwhere α ≡ ½∑M i −d Š −1 and Σt ≡ ∑M i −d jst − st−i j. i¼1 i¼1 Note that Eq. 10 can be also intuitively derived. Because by αiwe denote the proportion of agents observing the price change inthe past i days, the price change jst − st−i j contributes to the over-Fig. 2. Plot of survey result (16) on percent importance placed on technical Fig. 3. Confirmation of the scaling relations Eq. 12. Dependence of γ1analysis at different time horizons by U.S. fund managers. The plot shows a against γ2 for the 30 stocks in Dow Jones Indices components. Daily closingpower-law function with exponent −1.12. We have combined the percent prices from 1971–2010 are used for each stock. The two exponents fulfillvalues for both flow and technical analysis at each time horizon, as flow ana- γ1 ≤ γ2 ≤ 2γ1 , so the scaling relation predicted by our stochastic model is con-lysis in a broad sense is one type of technical analysis. Technical analysis is sistent with these empirical data. The range of lag, 11 ≤ ℓ ≤ 250, is used be-heavily used at investment horizons of days to weeks and decays to close cause theoretical power-law decay of the ACF is valid for large ℓ, and forto zero at 500 d. ℓ > 250 the ACF values are close to the noise level.Feng et al. PNAS ∣ May 29, 2012 ∣ vol. 109 ∣ no. 22 ∣ 8391
  • Fig. 4. Comparison between empirical data and simulation. The empirical data (about 10,000 data points) are from the S&P 500 index daily closing prices inthe 40-y period 1971–2010. The simulation are carried out for 50,000 data points to obtain good convergence. Black Monday, October 19, 1989, is removedfrom the analysis of the ACF. (A) Autocorrelation of simulation vs. S&P 500 index. The simulation results show behavior similar to the S&P 500 for both absolutereturns and squared returns. The rate of decay is also similar numerically. (B) The CDF of absolute returns for simulations and the S&P 500. The simulationreproduces the return distribution well.processes (39). However, there are some differences in a way how (16). We set d ¼ 1.2, in agreement with empirical finding (16).past returns are used in σtþ1 —whereas in fractional integrated From the empirical trading volume fluctuations and uncondi-process σtþ1 depends on past daily returns, in Eq. 11 we use tional variance of price changes, we estimate A ¼ 0.002 and B ¼absolute values of past aggregate returns. Precisely, the absolute 0.05 (SI Appendix, Section 3). Therefore we obtain σtþ1 ≈ 0.002þvalues of past daily, weekly, and monthly returns, to mention a 0.05 ∑500 i −1.2 jst − st−i j. In Fig. 4 we compare the simulation re- i¼1few. Parke (40) has demonstrated how heterogeneous error dura- sults with the results for S&P 500 index. We demonstrate thattions among traders could result in fractional integration, and the ACF of absolute and squared returns—for both simulationshere we explicitly and quantitatively provide a behavioral inter- and the S&P 500 index—fulfill our scaling relations of Eq. 12pretation of the long memory in absolute returns. The decayingdependence of standard deviation σtþ1 on past aggregate returns with γ1;simulation ¼ 0.40, γ2;simulation ¼ 0.53; γ1;S&P500 ¼ 0.44, andof different durations in Eq. 11 is a direct outcome of agents γ2;S&P500 ¼ 0.7.applying technical strategies at different investment horizons. Eq. 11 reflects the long-term memory of empirical data accu-We find this dependence to decay as a power law, and the power- rately while still being a stationary process (SI Appendix,law exponent d is calculated from empirical observations (16). Section 3) in contrast to many other power-law decaying pro- cesses (2, 39). In addition, the behavioral picture of Eq. 11 ex-Analytical and Simulated Results plains the origin of long-term memory through heterogeneousIn general, the long memory in returns can be demonstrated investment horizons of different technical traders based on em-by analyzing auto-correlation functions (ACF). We find that pirical evidence.the ACFs of both absolute and squared returns (ρℓ and ρℓ ) decay 0as power laws with ℓ, i.e., ρℓ ðjr t j; jr t−ℓ jÞ ∝ ℓ −γ1 and ρℓ ðr t2 ; r t−ℓ Þ ∝ 0 2 Summaryℓ −γ2 , where we obtain the scaling relations (SI Appendix, Starting from the empirical behavior of agents, we construct anSection 2) similar to phase transitions in statistical mechanics, agent-based model that quantitatively explains the fat tails and 8 long-term memory phenomena of financial time series without > γ1 ¼ 2d − 2; < suffering from finite-size effects (35). The agent-based model 2d − 2 ≤ γ2 ≤ 4d − 4; [12] and the derived stochastic model differ in construction but share > : the same mechanism of opinion convergence among technical γ1 ≤ γ2 ≤ 2γ1 : traders. Whereas the agent-based model singles out the dominant market mechanism, the stochastic model allows a detailed ana- Whereas Ding et al. have shown that correlations in jr t j decay lytical study. Both approaches allow their parameter values tomore slowly than correlations in r t2 (41), we, instead, show quan- be retrieved from market data with clear behavioral interpreta-titative scaling relations that have been derived and explained by tions, thus allowing an in-depth study of this highly complex sys-the behavior of individual market participants (characterized byd). Empirical verification with the stock components of Dow tem of financial market.Jones Indices in Fig. 3 confirms the validity of the scaling relation The universality of various empirical features implies a domi-of Eq. 12. nant mechanism underlying market dynamics. Here we propose The behavioral understanding of our stochastic process Eq. 11 that this mechanism is driven by the use of technical analysisallows us to perform simulations in which every parameter is by market participants. In particular, past price fluctuationsbased on empirical calibration rather than on conventional can directly induce convergence or divergence of agents’ tradingstatistical estimation. In Eq. 10 we replace the upper limit of decisions, which in turn give rise to the “ARCH effect” in empiri-M in the summation by 500 trading days, which corresponds cal findings. Additionally, the heterogeneity in agents’ investmentto ≈2 years of investment horizon as implied by the survey horizons gives rise to long-term memory in volatility.8392 ∣ www.pnas.org/cgi/doi/10.1073/pnas.1205013109 Feng et al.
  • ACKNOWLEDGMENTS We thank F. Pammolli, J. Cherian, and Y. Chen for dis- of Croatia, the Keck Foundation Future Initiatives Program, Defense Threatcussions and suggestions. The work has been partially supported by the Grant Reduction Agency, and the National Science Foundation Grants PHY-R-144-000-285-646 from the National University of Singapore, the German 0855453, CMMI-1125290, CHE-0911389, and CHE-0908218.Research Foundation through Grant PR 1305/1-1, the Ministry of Science 1. Engle RF (1982) Autoregressive conditional heteroskedasticity with estimates of the 22. Preis T, Paul W, Schneider JJ (2008) Fluctuation patterns in high-frequency financial variance of United Kingdom inflation. Econometrica 50:987–1007. asset returns. Europhys Lett 82:68005. 2. Bollerslev T (1986) Generalized autoregressive conditional heteroskedasticity. J Econ- 23. Preis T, Virnau P, Paul W, Schneider JJ (2009) Accelerated fluctuation analysis by gra- om 31:307–327. phic cards and complex pattern formation in financial markets. New J Phys 11:093024. 3. Lux T, Marchesi M (1999) Scaling and criticality in a stochastic multi-agent model of a 24. Egenter E, Lux T, Stauffer D (1999) Finite-size effects in Monte Carlo simulations of two financial market. Nature 397:498–500. stock market models. Physica A 268:250–256. 4. Duffy J, Ünver MU (2006) Asset price bubbles and crashes with near-zero-intelligence 25. Lux T, Schornstein S (2005) Genetic learning as an explanation of stylized facts of traders. Econ Theor 27:537–563. foreign exchange markets. J Math Econ 41:169–196. 5. Cont R, Bouchaud JP (2000) Herd behavior and aggregate fluctuations in financial 26. Lux T (2009) Handbook of Financial Markets: Dynamics and Evolution. (North-Holland, markets. Macroecon Dyn 4:170–199. Amsterdam), pp 161–215. 6. Preis T (2011) Econophysics-complex correlations and trend switchings in financial time 27. Duffy J, Feltovich N (1999) Does observation of others affect learning in strategic series. Eur Phys J-Spec Top 194:5–86. environments? An experimental study. Int J Game Theory 28:131–152. 7. Preis T, et al. (2011) GPU-computing in econophysics and statistical physics. Eur Phys J Spec Top 194:87–119. 28. Gabaix X, Gopikrishnan P, Plerou V, Stanley HE (2003) A theory of power-law distribu- 8. Preis T, Moat HS, Stanley HE, Bishop SR (2012) Quantifying the advantage of looking tions in financial market fluctuations. Nature 423:267–270. forward. Sci Rep 2:350. 29. Plerou V, Stanley HE (2008) Stock return distributions: Tests of scaling and universality 9. Mike S, Farmer JD (2008) An empirical behavioral model of liquidity and volatility. from three distinct stock markets. Phys Rev E 77:037101. J Econ Dyn Control 32:200–234. 30. Podobnik B, Valentincic A, Horvatic D, Stanley HE (2011) Asymmetric levy flight in10. Hommes CH (2002) Modeling the stylized facts in finance through simple nonlinear financial ratios. Proc Natl Acad Sci USA 108:17883–17888. adaptive systems. Proc Natl Acad Sci USA 99:7221–7228. 31. Podobnik B, Horvatic D, Petersen AM, Urosevic B, Stanley HE (2010) Bankruptcy risk11. Mandelbrot B (1963) The variation of certain speculative prices. J Bus 36:394–419. model and empirical tests. Proc Natl Acad Sci USA 107:18325–18330.12. Gopikrishnan P, Plerou V, Amaral LAN, Meyer m, Stanley HE (1999) Scaling of the dis- 32. Hill BM (1975) A simple general approach to inference about the tail of a distribution. tribution of fluctuations of financial market indices. Phys Rev E 60:5305–5316. Ann Stat 3:1163–1174.13. Plerou V, Gopikrishnan P, Amaral LAN, Gabaix X, Stanley HE (2000) Economic fluctua- 33. Podobnik B, Horvatic D, Petersen AM, Stanley HE (2009) Cross-correlations between tions and anomalous diffusion. Phys Rev E 62:R3023–R3026. volume change and price change. Proc Natl Acad Sci USA 106:22079–22084.14. Maslov S, Mills M (2001) Price fluctuations from the order book perspective: Empirical 34. Alfarano S, Lux T, Wagner F (2008) Time-variation of higher moments in financial facts and a simple model. Physica A 299:234–246. markets with heterogeneous agents: An analytical approach. J Econ Dyn Control15. Brown B (2010) Chasing the Same Signals: How Black Box Trading Influences Stock 32:101–136. Markets from Wall Street to Shanghai. (Wiley, New York). 35. Irle A, Kauschke J (2011) Switching rates and the asymptotic behavior of herding16. Menkhoff L (2010) The use of technical analysis by fund managers: International evi- models. Adv Complex Syst 14:359–376. dence. J Bank Financ 34:2573–2586. 36. Ashkenazy Y, et al. (2001) Magnitude and sign correlations in heartbeat fluctuations.17. Taylor MP, Allen H (1992) The use of technical analysis in the foreign exchange market. Phys Rev Lett 86:1900–1903. J Int Money Financ 11:304–314.18. Cheung YW, Wong CYP (2000) A survey of market practitioners’ views on exchange 37. Aoki M (2002) Open models of market shares with two dominant types of market APPLIED PHYSICAL rate dynamics. J Int Econ 51:401–419. participants. J Econ Behav Organ 49:199–216. 38. Cont R (2007) Long Memory in Economics. (Springer, Berlin), pp 289–309. SCIENCES19. Eisler Z, Kertèsz J (2007) Liquidity and the multiscaling properties of the volume traded on the stock market. Europhys Lett 77:28001. 39. Baillie RT, Bollerslev T, Mikkelsen HO (1996) Fractionally integrated generalized auto-20. Plerou V, Gopikrishnan P, Gabaix X, Stanley HE (2002) Quantifying stock-price response regressive conditional heteroskedasticity. J Econom 74:3–30. to demand fluctuations. Phys Rev E 66:027104. 40. Parke WR (1999) What is fractional integration? Rev Econ Stat 81:632–638.21. Bouchaud JP, Farmer JD, Lillo F (2009) Handbook of Financial Markets: Dynamics and 41. Ding Z, Granger CWJ, Engle RF (1993) A long memory property of stock market returns Evolution. (North-Holland, Amsterdam), pp 57–160. and a new model. J Empir Financ 1:83–106. ECONOMIC SCIENCESFeng et al. PNAS ∣ May 29, 2012 ∣ vol. 109 ∣ no. 22 ∣ 8393
  • SUPPLEMENTARY INFORMATION This is the supplementary information for ‘Linking Agent-Based Models and Sto-chastic Models of Financial Markets’. 1. Robustness checking of behavioral model In order to see how the parameters affect our behavioral model, we vary the valuesof probability of trading p, agent population size n0 and market noise level b to studythe robustness of the model. Value of p is determined indirectly by Vf as shown inthe paper, by varying the value of Vf between 0.2 to 0.8, typically smaller than 1.0due to the nature of fundamentalists’ investment horizons longer than one year. n0is chosen to vary from 256 to 16,384 covering a wide range. Market noise b is defined 2 2in step 3 of the paper as: ct+1 ∼ Normal(n0 /|rt |, σc ), where σc = b · n0 /|rt |. Valueof b is taken to be from 0 to 3.0 – no noise to extremely high noise. Figure 1 showsthe simulation results of our behavioral model with different values of Vf and n0varying individually. Each curve is shifted vertically for clarity. In 1a and 1b, it is Figure 1. CDF plot for different values of each parameter. The curves are shifted vertically for clarity. a) different values of Vf b) different n0 . Different values of fundamentalists’ trading frequency Vf and agent population size n0 give almost identical results, showing the robustness of our model in producing the result matching empirical distributions. 1
  • 2 SUPPLEMENTARY INFORMATION Figure 2. CDF plot for different values of noise b. The curves are shifted upwards for clarity. When market noise is high with a lot of news impacting the traders’ decisions, b is big, and the tail of CDF becomes larger.evident that the curves are almost identical in shape, demonstrating a robustnessof the result against the variation in these two parameters. Hill estimator givestail exponents close to empirical values, and the result is shown in the manuscript.Figure 2 shows the influence of market noise b on the return distributions. Biggernoise gives fatter tail, resulting in huge price swings as expected. 2. Mathematical analysis on the stochastic process Excess Kurtosis of Behavioral Model In our behavioral model, the conditional kurtosis of rt is Kurt(rt |rt−1 ). Sincethere are n0 /|rt−1 | number of independent clusters with |rt−1 | agents each, the excesskurtosis is equal to the kurtosis contributed by each cluster divided by the numberof clusters. The kurtosis of each cluster is 1/(2p), therefore we have the conditionalexcess kurtosis Kurt(rt |rt−1 ) = ( 2p − 3) |rn0 | , which varies between ( 2p − 3)/n0 to 1 t−1 1 1 1( 2p − 3). In the limit n0 → ∞, we have 0 ≤ Kurt(rt |rt−1 ) ≤ ( 2p − 3) ≈ 30 when
  • SUPPLEMENTARY INFORMATION 3p = 0.015. Hence the conditional kurtosis of the distribution depends directly onprevious returns. For simplicity, we assume rt = σt ηt , where ηt ∼ N (0, 1) is a standard normalvariable. It is shown later that t-distributions give similar simulation result. Asimple calculation would show that this construction gives an unconditional kurtosisof rt 4 rt+1 4 Kurt(r) = = rt 2 2 rt+1 2 2 4 4 σt ηt = 2 2pn0 |rt | (2pn0 |rt |)2 ηt 4 = 2 2pn0 |rt | 2 6 σt ηt = |rt |2 2 σt 2 3π >3 = |rt | 2 > 3.This demonstrates the excess kurtosis of our time series model is in line with empiricalobservations. It is worth noting that the real conditional distribution of ηt in our model is notGaussian - it has larger kurtosis than Gaussian, and the conditional kurtosis value isvarying according to our earlier analysis. But this should not affect our conclusionsthat the unconditional kurtosis is greater than 3, yet we could not conclude if thevalue is finite. Autocorrelations of Stochastic Model
  • 4 SUPPLEMENTARY INFORMATION As absolute values are difficult to deal with, we approximate them to |st − st−i | ≈ √( i |ri−j |)/ i. Autocorrelation of absolute returns at lag l is given by j=1 ρl ∼ (|rt | − |rt | )(|rt+l | − |rt+l | ) ∼ (σt − σt )(σt+l − σt+l ) ∼ (Σt − Σt )(Σt+l − Σt+l ) ∞ ∼ i−d j −d (|st − st−i | − |st − st−i | )(|st+l − st+l−j | − |st+l − st+l−j | ) i,j=1 ∞ ∼ i−d−0.5 j −d−0.5 Ψijl , i,j=1 i j i jwhere Ψijl = m=1 |rt−m | n=1 |rt+l−n | − m=1 |rt−m | n=1 |rt+l−n | . Whenj < l, Ψijl ≈ 0. When l < j < i + l, we have k 2 2 ≈ kσ 2 ≈ (j − l)σ 2 . Ψijl = Ψi,k+l,l ≈ m=1 |rt−m | − |rt−m | |r| |r| When j > i + l, we have k 2 2 ≈ iσ 2 . Ψijl = Ψi,i+l+k,l ≈ m=1 |rt−m | − |rt−m | |r| Therefore we have ∞ ρl ∼ i−d−0.5 j −d−0.5 Ψijl i,j=1 ∞ ∞ = i−d−0.5 (k + l)−d−0.5 kσ|r| + 2 i−d−0.5 (k + l)−d−0.5 iσ|r| . 2 i>k k>i Replacing the summation with continuous integral, we obtain ∞ ∞ ∞ k ρl ∼ i−d−0.5 k(k + l)−d−0.5 di dk + i−d+0.5 (k + l)−d−0.5 di dk 0 k 0 0 ∞ ∞ 1 d1.5−d 1 k 1.5−d ∼ dk + dk d − 0.5 0 (k + l)d+0.5 1.5 − d 0 (k + l)d+0.5 B(1.5 − d, 2d − 1) 2−2d ∼ l (d − 0.5)(1.5 − d) ∝ l2−2d . Therefore we obtain ρl ∝ l2−2d = lγ1 , where γ1 = 2 − 2d. For autocorrelation insquared returns, we have 2 2 2 2 ρl ∼ (rt − rt )(rt+l − rt+l ) 2 2 2 2 ∼ (σt − σt )(σt+l − σt+l ) . There are two extreme situations here:
  • SUPPLEMENTARY INFORMATION 5 1) If p0 2α Σt , where Σt ≡ M i−d |st −st−i |, representing the fact that trading i=1tendency due to past price fluctuations is much higher than background value of p0 ,we obtain σt+1 ≈ BΣt. Assuming that (st − st−i ) and (st−i − st−j ) are weaklycorrelated, we obtain corr(|st − st−i |, |st − st−j |) ≈ 0. Thus 2 2 σt − σt ∼ 2 (ij)−d (|st − st−i ||st − st−j | − |st − st−i ||st − st−j | ) i≤j ∞ ≈2 i−2d ((st − st−i )2 − (st − st−j )2 ). i=1 With similar treatment to ρl , we obtain ∞ ρl ∼ i−2d j −2d ((st − st−i )2 − (st − st−i ) 2 )((st+l − st+l−j )2 − i,j=1 (st+l − st+l−j ) 2 ) ∼ l4−4d .i.e. ρl ∼ (rt − rt )(rt+l − rt+l ) ∼ lγ2 where γ2 = 4d − 4. For d = 1.12, we have 2 2 2 2γ2 = 0.48. 2) In the case that p0 2α Σt , which is approximately the case of our behavioralmodel, we again have the decay in squared returns as ρl ∼ l2−2d . Therefore, the value of γ2 fluctuates between γ1 and 2γ1 depending on the relativesize of trades triggered by crossing thresholds placed by technical traders. Overall, we obtained the scaling relations γ1 = 2d − 2 2d − 2 ≤ γ2 ≤ 4d − 4 γ1 ≤ γ2 ≤ 2γ1 . 3. Determination of parameters in the stochastic process The ratio of background trading volume p0 against trading volume due to priceimpact αΣt is approximated from empirical daily trading volume data of a stock.Since the market landscape has been changing during the last half a century due tocomputerization in late 90s and the adoption of high-frequency trading in the recentdecade, there have been structural changes in trading volumes. Hence we only focuson the 10 year period 1997-2006 during which high frequency trading has not beenmassively adopted and program trading has already become a norm.
  • 6 SUPPLEMENTARY INFORMATION For stock AA, daily trading volume vi is used from 1997 to 2006 with i ∈ [1, 2516].Since trading volume has increased through the ten-year period, we fit the data of viv.s. i with a linear function yi , and form a new detrended time series of vi = vi /yi . From vi , the average value of the smallest 1% of the data is assumed to be repre-senting p0 , as we know that pt ≥ p0 . The average of the whole time series is assumedto be pt . From our calculation, pt ≈ 3p0 , which means p0 +α Σt ≈ 3p0 . Hence we obtainthe relation p0 ≈ 0.5 α Σt . This indicates trading volume due to price impact istwice of background trading volume p0 . This implies the relation 500 1 1 A = BΣt = B i−d |st − st−i | . 4 4 i=1Therefore we have 500 σt = A + B i−d |st − st−i | i=1 500 5 = B i−d |st − st−i | 4 i=1 500 5 ≈ B i0.5−d |rt | 4 i=1 500 5 = B i0.5−d σt 2/π 4 i=1 500 5 = 2/π i0.5−d B σt . 4 i=1When d = 1.2, we have B ≈ 0.05. The empirical value of σt ≈ 0.01 for S&P500,hence we have A = 1 σt = 0.002. Analysis on other major stocks gives similar re- 5sults. The estimation of A and B implies that the time series has finite unconditionalvariance. 4. Using t-distribution for ηt instead of normal distribution In our stochastic process, rt = σt ηt , ηt is assumed to follow standard normal dis-tribution. This does not reflect the excess kurtosis of the conditional distributiondiscussed above. Hence we use t-distribution of different degrees of freedom to per-form simulation. The degree of freedom is taken to be 6, 8, 10 so that the excess
  • SUPPLEMENTARY INFORMATION 7kurtosis is 3, 1.5, 1. It can be seen from Figure 3 to 5 that the simulation results arestill in agreement with empirical finding with different values of degree of freedom.The real underlying dynamics has a time varying distribution with excess kurtosischanging between 0 and 30 shown earlier. Since we demonstrate that fixed distribu-tions with different excess kurtosis values give the same outcome, we can safely saythe real dynamic process would exhibit the same scaling relations as well. Figure 3. Plots of simulation results using ηt following t- distribution with degree of freedom 6. Left) ACF plot of absolute and squared returns for simulation v.s. S&P500 index. Simulation gives γ1 = 0.38, γ2 = 0.51, which are in agreement with empirical finding. Right) CDF of absolute returns.
  • 8 SUPPLEMENTARY INFORMATION Figure 4. Plots of simulation results using ηt following t- distribution with degree of freedom 8. Left) ACF plot of absolute and squared returns for simulation v.s. S&P500 index. Simulation gives γ1 = 0.31, γ2 = 0.49, which are in agreement with empirical finding. Right) CDF of absolute returns. Figure 5. Plots of simulation results using ηt following t- distribution with degree of freedom 10. Left) ACF plot of absolute and squared returns for simulation v.s. S&P500 index. Simulation gives γ1 = 0.38, γ2 = 0.55, which are in agreement with empirical finding. Right) CDF of absolute returns. 5. Analysis on different ω values in the equation of opinion cluster formation ct+1 = (n0 /|rt |)ω In Eq. (3) of the paper, we define the total number of opinion clusters at timet + 1 as ct+1 , and it is directly determined by the previous price changes as ct+1 =
  • SUPPLEMENTARY INFORMATION 9(n0 /|rt |)ω . Since there is at least one opinion among the agents, and that happenswhen every agent does the same buy/sell action, we have the boundary conditionthat ct+1,min = 1 when |rt |max = n0 ,which fulfills ct+1 = (n0 /|rt |)ω for any value of ω. Since there are n0 agents in the market, there are at most n0 opinion groups inthe market. According to Eq. (3), this occurs when ct+1,max = n0 (n0 /|rt |min )ω = n0 (ω−1)/ω |rt |min = n0 . (ω−1)/ω This means whenever |rt | = |rt |min = n0 , the market would have the maxi-mum of n0 opinions and every agent acts independently. When ω = 1.0, we have |rt |min = 1, and it means when there is exactly one morebuy/sell trade than sell/buy trade in the market in the previous day, the market willhave totally diverse opinions. √ When ω = 0.5, we have |rt |min = n−1 . We have ct+1 = n0 0 ct+1,max = n0(for large n0 ) when |rt | = 1, meaning the market has some convergence in opinionswhen there is exactly one more buy/sell trade than sell/buy trade in the previousday. Hence the agents are more likely to converge in their opinions than the case forω = 1, and return distribution has a fatter tail. √ When ω = 2.0, we have |rt |min = n0 . This means the market would have totally √diverse opinions whenever |rt | is smaller than n0 . Hence the agents are less likelyto converge in their opinions than the case for ω = 1, and return distribution has athinner tail. According to our simulation result, ω = 1 gives the absolute return distributionclosest to empirical findings.
  • 10 SUPPLEMENTARY INFORMATION Figure 6. a. Percentage of outstanding shares held by institutional investors of the 309 companies. Data is from Yahoo! Finance. Ma- jority of the shares are held by institutional owners as the percentage is mostly larger than 70%. b. Estimated results on the average per- centages of shares being held and traded by the two different types of traders – fundamentalists and technical traders. Data used are from Yahoo! Finance and COMPUSTAT. Left: Average percent- age of outstanding shares held by institutional owners and technical traders. The majority stake is held by institutional owners who invest for long-term profits. Right: approximately 80% of trading volume is contributed by technical traders despite a minority holding by them. This number is calculated assuming fundamentalists have an invest- ment horizon of 2.5 years. It is evident that although fundamentalists are holding the majority of the stocks, they only contribute a minority of the trading activity.