Next Article in Journal
A Novel Hybrid Approach for Partial Discharge Signal Detection Based on Complete Ensemble Empirical Mode Decomposition with Adaptive Noise and Approximate Entropy
Next Article in Special Issue
Coupled Criticality Analysis of Inflation and Unemployment
Previous Article in Journal
Analytic Hierarchy Process (AHP)-Based Aggregation Mechanism for Resilience Measurement: NATO Aggregated Resilience Decision Support Model

Market of Stocks during Crisis Looks Like a Flock of Birds

Department of Physics, Iran University of Science and Technology, Tehran 512, Iran
Center for Complex Networks & Social DataScience, Shahid Beheshti University, Tehran 512, Iran
Institute of Information Technology and Data Science, Irkutsk National Research Technical University, 664000 Irkutsk, Russia
Department of Physics, Shahid Beheshti University, Tehran 512, Iran
Department of Network and Data Science, Central European University, 1007 Budapest, Hungary
Author to whom correspondence should be addressed.
Entropy 2020, 22(9), 1038;
Received: 15 July 2020 / Revised: 3 September 2020 / Accepted: 14 September 2020 / Published: 17 September 2020
(This article belongs to the Special Issue Entropy and Social Physics)


A crisis in financial markets can be considered as a collective behaviour phenomenon. The collective behaviour is a complex behaviour which exists among a group of animals. The Vicsek model has been adapted to represent this complexity. A unique phase space has been introduced to represent all possible results of the model. The return of the transaction volumes versus the return of the closed price of each share has been used within the defined phase space. The findings show that the direction of the resultant velocity vectors of all share in this phase space act in the same direction when the financial crisis happens. By monitoring the market’s collective behaviour, it will be possible to gain more knowledge about the condition of the market days in crisis. This research aims to investigate the collective behaviour of stocks using the Vicsek model to study the condition of the market during the days in crisis.
Keywords: collective behavior; Vicsek model; financial crisis collective behavior; Vicsek model; financial crisis

1. Introduction

The emergence of collective behaviour has been observed in many systems, such as schools of fish or flocks of birds. One of these systems’ main properties is that the members move in the same direction without any leadership [1,2,3]. This behaviour exists to increase the chances of survival for the whole system. This behaviour can also be seen in financial stock markets. Independent firms are exposed to more business risk than similar firms that are in a joint group. Independent markets are more vulnerable and have fewer chances of survival in a financial crisis. Despite growing stronger being in a group for each member, it would itself be a major factor to spread a problem of each member within the whole group. One of the most important issues in businesses is the prediction of this significant shift during a financial crisis [4,5,6,7,8]. This has been considered in previous studies with a variety of approaches [9,10]. Computer-aided platforms have been used in the past to facilitate decision-making in financial markets. For example, high-frequency trading is carried out by powerful computers to analyse markets and buy or sell shares within seconds [11]. These platforms assume that the share price changes are fixed across various financial markets. This assumption is not valid if the market copes with financial crises. This is the main motivation of applying collective behaviour of birds and animals to the stock markets [12]. In order to consider the collective behaviour of stock markets, particle swarm optimisation (PSO) has been adapted in [13]. The algorithm was focused on choosing the parameters of trading strategy to predict price trends and to obtain the highest net return. Malekian et al. have shown that PSO and ant colony approaches are more effective than regression to predict financial crashes [14].
Thomas and Francisco [15] applied the collective behaviour of animals to the financial markets and used network theory to show the complexity of their acts. In science, significant efforts have been made to identify and understand the general principles governing collective behaviours [16,17,18]. These efforts have been unsuccessful due to the absence of equilibrium in such systems. The interactions between the particles of these systems are short-range. Therefore, the existing statistical physics techniques used for the long-range interaction of the particles are unable to express the system’s dynamics. The Vicsek model (VM) has been applied to construct a framework for this study. The Vicsek model was first introduced [19] in 1995 to investigate the emergence of self-ordered motion in systems of particles with biologically motivated interaction. This model was further extended in 1999 [20] to demonstrate that a system of self-propelled particles (SPP) exhibits spontaneous symmetry breaking and self-organisation in one dimension. In 2000, Levin et al. proposed a model [21] in which he enhanced the scope of Vicsek by taking into account both attractive and repulsive forces. The Buhl model [22] (2006), which implies a modification of velocity weighting of the particles, approves rapid transition from the disordered movement of individual agents to highly aligned collective motion. In contrast to the formless and point-like particles described within the Vicsek model, Peruani attributed forms and packing coefficients to the agents [23]. There are many more models based upon Vicsek platforms such as Chate [24], Cocker-Smiley [25], Galam [26], and that of the work in [27]. The Vicsek model deals with a system of self-propelled particles. The basic idea in the Vicsek model is that at each time step, a given particle moves with a constant velocity. A new direction is obtained by the average direction of all the neighbourhood particles within a circle of the radius with including a random noise [28]. In other words, all the particles of the system tend to follow their neighbours’ direction. However, the particles might change their directions while following their neighbours’ trajectory, which is considered noise. Vicsek model has been proven to be effective for modelling collective behaviour with the ability to express such systems’ dynamic states. Thus, the Vicsek model has been adopted to build the framework for this research. The dynamics of the stock market is a very complex problem. We used VM to take some snapshots at different times of a market to compare them. Thus, the Vicsek model has been adopted to build the framework for this research. Neither studying dynamics of the Vicsek model nor the stock market dynamics has not been considered.

2. The Validation of the Framework

To validate the proposed framework, the historical data of the S t a n d a r d & P o o r s 500   ( S & P 500 ) companies in the US stock market has been used. The S & P 500 index, an index of the New York Stock Exchange, consists of the 500 largest companies in the US. It is a market value-weighted index (stock price times number of shares outstanding), with each stock’s weight in the index proportionate to its market value. The S & P 500 index is one of the most widely used benchmarks of US equity performance [29]. Our data covers 12 years (from January 2007 to February 2019) with a recording frequency of daily intervals. The data gathered from 465 stocks includes closing prices and transaction volumes.

Prototype Implementation

VM assumes that particles move in a two-dimensional plane with periodic boundary conditions. In this model, each particle’s location is defined by X-Y coordinates, and a vector can obtain its velocity in the plane. The model assumes that the particles move with equal speed and the direction of the velocity vectors of particles changes as a function of time. The direction of each particle’s motion depends on the average velocity, V n ( t ) , of its neighbouring particles within a circle of radius r 0 . The model defines a circular neighbourhood area U n ( r 0 , t ) centered at the n-th particle position r n ( t ) . The number of closed neighbours is shown as K n ( t ) . According to the VM model, no interactions can occur for the n-th particle located outside the U n ( r 0 , t ) . The average velocity of the neighbours of the particle n is calculated by:
V n ( t ) = 1 K n ( t ) j : r j U n ν j ( t ) ,
where ν j ( t ) denotes the velocity of j-th particle inside U n ( r 0 , t ) . The Equation (1) is the sum of the velocities of each particle in the neighbourhood divided by the number of particles in that neighbourhood.
Equation (2) shows the time evolution of the velocity angel of n-th particle,
θ n ( t + Δ t ) = A n g l e [ V n ( t ) ] + η ξ n ( t ) ,
where ξ n ( t ) is a random variable uniformly distributed in the interval [− π , π ], and η is the noise intensity, which is a positive parameter.
Therefore, the velocity of n-th particle can be calculated by Equation (3)
ν n ( t + Δ t ) = ν 0 C o s ( θ n ( t + Δ t ) ) x ^ + ν 0 S i n ( θ n ( t + Δ t ) ) y ^ ,
where x ^ and y ^ denote X and Y direction respectively. Then, the position of n-th particle in the next time step is:
r n ( t + Δ t ) = r n ( t ) + ν n ( t + Δ t ) Δ t .
At any time t, the magnitude of order in a system might be assessed through the order parameter Φ η ( t ) [30,31], which is expressed by:
Φ η ( t ) = 1 N ν 0 n = 1 N ν n ( t ) ,
where the η indicates that the order parameter in the system depends on the noise intensity. Equation (5) is the magnitude of the sum of all the particle’s velocity in the system divided by the total number of particles N by the value of the velocity ν 0 . This parameter must be in the interval [0, 1]; 0 if the velocity vectors are distributed randomly, and 1 if particles line up in the same direction.
To use the Vicsek model, a coordinate system is required to describe the movements of stocks in a market. Thus, X-Y values have been formulated as follows,
X t = P t P t 1 & Y t = T t T t 1 ,
where t takes just discrete values 1 , , t 1 , t , t + 1 , , P t is the closing price, and T t is the transaction volume at time t. The X-axis and the Y-axis of the coordinate system show the daily closed price difference and the difference in transaction volumes for two consecutive days. Based on VM, the density of particles has been considered as the main factor in collective behaviour. This research does not take into account how the market trend changes over a time period. Thus, the effect of the market trend on each stock has been neutralised using the following transformations,
x t = ( X t μ x ) / σ x & y t = ( Y t μ y ) / σ y ,
where μ x : moving average over 20 days, μ y : moving average over 20 days and σ x : moving standard deviation over 20 days and σ x : moving standard deviation over 20 days.
The new phase space can be generated from the above formula. The speed parameter for a daily stock can be calculated as follow,
ν t = ( x t + 1 x t ) s ^ x + ( y t + 1 y t ) s ^ y ,
where s ^ x and s ^ y are unit vectors along X-axis and Y-axis, respectively.

3. Results and Discussion

Figure 1 represents the velocity vectors of all one-day stocks for three critical market days compared to the market’s those of normal functioning of the market. Figure 1 compares the velocity vectors for normal days in the market (non-crisis) versus markets in crisis over three days for 465 stocks. It has been observed that during the non-crisis period, the stocks tend to move randomly. The direction of vectors has been highlighted with different colours in Figure 1. The direction of vectors in Figure 1 for markets in crisis shows the emergence of the collective behaviours.
To differentiate the normal days from the days in crisis in the stock market, a value has been assigned to each day. The following steps are used to calculate this value.
  • Drawing an imaginary circle and lay the start point of the velocity vectors of each share ν i ( t ) on the center of the circle.
  • Dividing the circle into 12 equal slices and assigning a number to each of them, so each velocity vector is located in one slice.
  • Mapping each share to one slice number. For example, the velocity vector of i-th share in the division l is shown as ν l i ( t ) , where t denotes time. l can only accept integer values and it returns the number of the slice that velocity vector is located, and Δ θ is the degree of each slice which in this research assumed 30 degrees.
    l = θ i / Δ θ .
    l equals to the integer part of the right hand side of Equation (9).
  • Coupling the joint shares. For example, if share i is in slice l and share j is in slice m, the return of the joint l-m or m-l will be considered. l-m and m-l are considered as one possible combination of joint shares. Therefore, the joint probability of both i and j to be placed in l and m divisions p ( ν l i ( t ) , ν m j ( t ) ) equals 1.
  • Counting the possible combinations of joint shares C t . For example, 0-0, 0-1, 0-2, ..., 10-11, 11-11. It can be a maximum of 78 combinations of joint shares.
  • The distribution of these possible combinations of joint shares P t ( l , m ) can be obtained using Equation (10). The calculated P t ( l , m ) values for normal days vs. days in crises have been presented in Figure 2C.
    P t ( l , m ) = i , j 1 , , N p ( ν l i ( t ) , ν m j ( t ) ) .
Number of possible combinations of joint shares have been depicted in Figure 2B. The Y-axis values have been calculated using Equation (11).
C t = l , m 0 , 1 , , 11 S i g n ( P t ( l , m ) ) .
In Equation (11), P t ( l , m ) only accepts non-negative values. When P t ( l , m ) equals to zero, S i g n ( P t ( l , m ) ) returns zero. When P t ( l , m ) is greater than 0, S i g n ( P t ( l , m ) ) returns 1. With this arrangement, the number of possible joint shares can be obtained.
On a normal day in the market, 78 possible combinations of joint shares (l, m) can be found. This number can be significantly lower on a day in crisis. When the number is lower than 78, it also indicates that collective behaviour is emerging in the market. It means for some values of l and m, P t ( l , m ) equals zero. For each day, the number of l and m combination where P t ( l , m ) is greater than zero is counted. This number has been estimated for the trades happened all open days of 2018 and shown in the middle chart in Figure 2. We used the reference index of S & P 500 to compare the calculated value from this research with the values listed in normal days in the market. This comparison has been depicted in Figure 2. Moreover, the distribution of possible combinations between joint shares in normal days has been compared with the same distribution during the market crisis (Figure 2, the bottom chart).
Comparing the data from normal days against days in crisis in Figure 2 shows that the numbers of possible combinations for joint shares have decreased significantly during the days in crisis.
This research also illustrates how a time delay in the stock market can affect the emergence of collective behaviour. In Figure 3, the emergence of collective behaviour has been depicted for the duration of 8 days. The delay of one day has been assumed in calculations. To measure the alignment of the two velocity vectors, a value has been defined.
  • The velocity vector of i-th share at time t is shown by ν i ( t ) .
  • The alignment of the velocity vectors of two separate shares can be calculated by Formula (12). The basis of this calculation is the cosine of the angle between the two velocity vectors.
    a i j ( t ) = ν i ( t ) . ν j ( t ) | ν i ( t ) | | ν j ( t ) | .
  • The stocks normally are correlated to each other. Thus, the change in one stock can affect the other stocks. This effect does not happen at once. Thus, we considered a delay for the calculations.
    a ˜ i j ( t ) = M a x ( ν i ( t ) . ν j ( t τ ) | ν i ( t ) | | ν j ( t τ ) | , ν i ( t ) . ν j ( t ) | ν i ( t ) | | ν j ( t ) | , ν i ( t τ ) . ν j ( t ) | ν i ( t τ ) | | ν j ( t ) | ) .
    Equation (13) selects the maximum alignment factor between velocity vectors of two shares for two consecutive days. τ which is the added lag for alignment matrix calculations has been assumed 1 day.
  • The alignment matrix has been constructed using calculated a ˜ i j ( t ) in Equation (13). The alignment matrix has been generated using dendrogram to present the stocks which are grouped together.
According to Figure 3, All stocks in the market are globally aligned and move in the same direction. This pattern did not occur at once. It started on 21 December 2018, spread on 24 December 2018 [32] and all the stocks in the market were involved on this date. On 26 December 2018, the collective behaviour started to disappear. On 27 December 2018, the market shows normal behaviour. This proves that monitoring the collective behaviour in the stock market can be useful. This is mainly because it can warn the traders about the crisis ahead.

4. Conclusions

The results of empirical research show that the stock market during crisis days follows collective behaviour patterns. Days in crisis are affected by the price of shares and transaction volume fluctuations. Thus, it is crucial to define a phase space based on each share price and volume. The direction of the defined velocity vectors within the phase space can be used to identify the days in crisis. This phenomenon can be seen in the behaviour of biological systems, such as groups of animals. The Vicsek model has been used previously to investigate the collective behaviour in these systems. Suggested framework has shown the potential to represent this behaviour in the stock markets as well.
Raw data from S & P 500 have been collected between 2007 and 2019. The collective behaviour has been discovered in some days in crisis. During these days, the direction of velocity vectors has been aligned as it was expected. An order parameter has been defined to compare the collective behaviour of the market during the crisis against normal days in the market. Using the data in S & P 500 , 24th of December 2018 has been identified as a crashed day. It is concluded that by analysing the market data before this date, it will be possible to identify the potential crisis in the days ahead.

Author Contributions

Conceptualization, G.J.; methodology, B.A. and P.H.C.; software, B.A. and P.H.C.; validation, G.J. and A.T.; formal analysis, A.A.K.; investigation, B.A. and P.H.C.; resources, B.A. and P.H.C.; data curation, B.A. and P.H.C.; writing–original draft preparation, B.A. and A.A.K.; writing–review and editing, A.T.; visualization, B.A.; supervision, G.J.; project administration, G.J. All authors have read and agreed to the published version of the manuscript.


This research received no external funding.


We thank Tamas Vicsek for reading and useful discussion.

Conflicts of Interest

The authors declare no conflict of interest.


  1. Lao, P.; Singh, H. Herding behaviour in the Chinese and Indian stock markets. J. Asian Econ. 2011, 22, 495–506. [Google Scholar] [CrossRef]
  2. Giardina, I. Collective behavior in animal groups: Theoretical models and empirical studies. HFSP J. 2008, 2, 205–219. [Google Scholar] [CrossRef] [PubMed]
  3. Lukeman, R.; Li, Y.X.; Edelstein-Keshet, L. Inferring individual rules from collective behavior. Proc. Natl. Acad. Sci. USA 2010, 107, 12576–12580. [Google Scholar] [CrossRef] [PubMed]
  4. Yang, J.; Hsiao, C.; Li, Q.; Wang, Z. The Emerging Market Crisis and Stock Market Linkages: Further Evidence. J. Appl. Econom. 2006, 21, 727–744. [Google Scholar] [CrossRef]
  5. Wang, Z.; Yang, J.; Bessler, D.A. Financial crisis and African stock market integration. Appl. Econ. Lett. 2003, 10, 527–533. [Google Scholar] [CrossRef]
  6. Xu, R.; Chang, J.; Li, C.; Wang, W. Research on the influence of equity pledge on stock price crash risk: Based on financial shock of 2015 stock market crisis. Econ. Political Stud. 2019, 7, 480–505. [Google Scholar] [CrossRef]
  7. Yang, X.; Zhao, X.; Gong, X.; Yang, X.; Huang, C. Systemic Importance of China’s Financial Institutions: A Jump Volatility Spillover Network Review. Entropy 2020, 22, 588. [Google Scholar] [CrossRef]
  8. Memon, B.; Yao, H. Structural Change and Dynamics of Pakistan Stock Market During Crisis: A Complex Network Perspective. Entropy 2019, 21, 248. [Google Scholar] [CrossRef]
  9. Iren, P. Behavior of Foreign Investors in the Malaysian Stock Market in Times of Crisis: A Nonlinear Approach. J. Asian Econ. 2018, 60, 85–100. [Google Scholar] [CrossRef]
  10. Namaki, A.; Shirazi, A.H.; Raei, R.; Jafari, G.R. Network analysis of a financial market based on genuine correlation and threshold method. Phys. A Stat. Mech. Its Appl. 2011, 390, 3835–3841. [Google Scholar] [CrossRef]
  11. Mandes, A. Algorithmic and High-Frequency Trading Strategies: A Literature Review; MAGKS Joint Discussion Paper Series in Economics, No. 25-2016; Philipps-Universität Marburg, Faculty of Business Administration and Economics, Department of Economics: Marburg, Germany, 2016. [Google Scholar]
  12. Gerig, A. High-Frequency Trading Synchronizes Prices in Financial Markets. SSRN Electron. J. 2015. [Google Scholar] [CrossRef]
  13. Crawford, B.; Soto, R.; Martín, M.; de la Fuente-Mella, H.; Castro, C.; Paredes, F. Automatic High-Frequency Trading: An Application to Emerging Chilean Stock Market. Sci. Program. 2018, 1–12. [Google Scholar] [CrossRef]
  14. Malekian, E.; Fakhari, H.; Qasemi, J.; Farzad, S. A Comparative Study of Prediction Stock Crash Risk by using Meta-Heuristic & Regression. Int. J. Financ. Manag. Account. 2018, 3, 63–77. [Google Scholar]
  15. Peron, T.; Rodrigues, F. Collective behavior in financial markets. EPL Europhys. Lett. 2011, 96, 48004. [Google Scholar] [CrossRef]
  16. Toner, J.; Tu, Y. Flocks, herds, and schools: A quantitative theory of flocking. Phys. Rev. E 1998, 58, 4828–4858. [Google Scholar] [CrossRef]
  17. Jung, N.; Kim, P. Marginalized ordering and adaptive reaction time in bird flocks. arXiv 2019, arXiv:1902.09288. [Google Scholar]
  18. Saeedian, M.; Jamali, T.; Kamali, M.Z.; Bayani, H.; Yasseri, T.; Jafari, G.R. Emergence of world-stock-market network. Phys. A Stat. Mech. Its Appl. 2019, 526, 120792. [Google Scholar] [CrossRef]
  19. Vicsek, T.; Czirók, A.; Ben-Jacob, E.; Cohen, I.; Shochet, O. Novel Type of Phase Transition in a System of Self-Driven Particles. Phys. Rev. Lett. 1995, 75, 1226–1229. [Google Scholar] [CrossRef]
  20. Czirók, A.; Barabási, A.L.; Vicsek, T. Collective Motion of Self-Propelled Particles: Kinetic Phase Transition in One Dimension. Phys. Rev. Lett. 1999, 82, 209–212. [Google Scholar] [CrossRef]
  21. Levine, H.; Rappel, W.J.; Cohen, I. Self-organization in systems of self-propelled particles. Phys. Rev. E 2000, 63, 017101. [Google Scholar] [CrossRef]
  22. Buhl, J.; Sumpter, D.J.T.; Couzin, I.D.; Hale, J.J.; Despl, E.; Miller, E.R.; Simpson, S.J. From Disorder to Order in Marching Locusts. Science 2006, 312, 1402–1406. [Google Scholar] [CrossRef] [PubMed]
  23. Peruani, F.; Deutsch, A.; Bär, M. Nonequilibrium clustering of self-propelled rods. Phys. Rev. E 2006, 74, 030904. [Google Scholar] [CrossRef]
  24. Chaté, H.; Ginelli, F.; Montagne, R. Simple Model for Active Nematics: Quasi-Long-Range Order and Giant Fluctuations. Phys. Rev. Lett. 2006, 96, 180602. [Google Scholar] [CrossRef] [PubMed]
  25. Cucker, F.; Smale, S. Emergent Behavior in Flocks. IEEE Trans. Autom. Control 2007, 52, 852–862. [Google Scholar] [CrossRef]
  26. Galam, S. Modelling rumors: The no plane Pentagon French hoax case. Phys. A Stat. Mech. Its Appl. 2003, 320, 571–580. [Google Scholar] [CrossRef]
  27. Chepizhko, A.A.; Kulinskii, V.L. On the relation between Vicsek and Kuramoto models of spontaneous synchronization. Phys. A Stat. Mech. Its Appl. 2010, 389, 5347–5352. [Google Scholar] [CrossRef]
  28. Ginelli, F. The Physics of the Vicsek model. Eur. Phys. J. Spec. Top. 2016, 225, 2099–2117. [Google Scholar] [CrossRef]
  29. Amaral, L.A.N.; Cizeau, P.; Gopikrishnan, P.; Liu, Y.; Meyer, M.; Peng, C.-K.; Stanley, H.E. Econophysics: Can statistical physics contribute to the science of economics? Comput. Phys. Commun. 1999, 121, 145–152. [Google Scholar] [CrossRef]
  30. Aldana, M.; Dossetti, V.; Huepe, C.; Kenkre, V.M.; Larralde, H. Phase Transitions in Systems of Self-Propelled Agents and Related Network Models. Phys. Rev. Lett. 2007, 98, 095702. [Google Scholar] [CrossRef]
  31. Baglietto, G.; Albano, E.V. Nature of the order-disorder transition in the Vicsek model for the collective motion of self-propelled particles. Phys. Rev. E 2009, 80, 050103. [Google Scholar] [CrossRef]
  32. Available online: (accessed on 1 September 2020).
Figure 1. Collective behaviour of stocks in crisis. Comparison of stock movement for three critical days and for those away from crisis. For each share in the stock market, only the direction of the velocity vector has been considered in this research.
Figure 1. Collective behaviour of stocks in crisis. Comparison of stock movement for three critical days and for those away from crisis. For each share in the stock market, only the direction of the velocity vector has been considered in this research.
Entropy 22 01038 g001
Figure 2. Comparing normal day and crisis for S & P 500 including 468 companies. (A) The historical data of S & P 500 for 2018 (all days). (B) The number of possible combinations of joint shares C t in 2018 (normal day vs. days in crisis). (C) Distribution of possible combinations of joint shares P t ( l , m ) in 2018 (normal day vs. days in crisis).
Figure 2. Comparing normal day and crisis for S & P 500 including 468 companies. (A) The historical data of S & P 500 for 2018 (all days). (B) The number of possible combinations of joint shares C t in 2018 (normal day vs. days in crisis). (C) Distribution of possible combinations of joint shares P t ( l , m ) in 2018 (normal day vs. days in crisis).
Entropy 22 01038 g002
Figure 3. The maximal alignment of pairs of stock vectors, when compared on the same day or with a one day lag.This plot has been generated using dendrogram and aligned shares have been grouped together. This graph shows that during the days in crisis one giant group of shares is shaped. This can be shown by a solid red color.
Figure 3. The maximal alignment of pairs of stock vectors, when compared on the same day or with a one day lag.This plot has been generated using dendrogram and aligned shares have been grouped together. This graph shows that during the days in crisis one giant group of shares is shaped. This can be shown by a solid red color.
Entropy 22 01038 g003
Back to TopTop