Next Article in Journal
Uncovering Key Factors That Drive the Impressions of Online Emerging Technology Narratives
Previous Article in Journal
Exploring Sentiment Analysis for the Indonesian Presidential Election Through Online Reviews Using Multi-Label Classification with a Deep Learning Algorithm
Previous Article in Special Issue
Balancing Risk and Profit: Predicting the Performance of Potential New Customers in the Insurance Industry
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Is the Taiwan Stock Market (Swarm) Intelligent?

1
Gabelli School of Business, Fordham University, 113 W 60th Street, New York, NY 10023, USA
2
College of Management, Chang Gung University, 259, Wenhua 1st Rd., Guishan Dist., Taoyuan City 33302, Taiwan
Information 2024, 15(11), 707; https://doi.org/10.3390/info15110707
Submission received: 23 August 2024 / Revised: 26 October 2024 / Accepted: 29 October 2024 / Published: 5 November 2024
(This article belongs to the Special Issue Artificial Intelligence (AI) for Economics and Business Management)

Abstract

:
It is well-believed that most trading activities tend to herd. Herding is an important topic in finance. It implies a violation of efficient markets and hence, suggests possibly predictable trading profits. However, it is hard to test such a hypothesis using aggregated data (as in the literature). In this paper, we obtain a proprietary data set that contains detailed trading information, and as a result, for the first time it allows us to validate this hypothesis. The data set contains all trades transacted in 2019 by all the brokers/dealers across all locations in Taiwan of all the equities (stocks, warrants, and ETFs). Given such data, in this paper, we use swarm intelligence to identify such herding behavior. In particular, we use two versions of swarm intelligence—Boids and PSO (particle swarm optimization)—to study the herding behavior. Our results indicate weak swarm among brokers/dealers.

1. Introduction

It is well-believed that most trading activities tend to herd. Herding is an important topic in finance (see a recent work by Mavruk [1], who adopts various machine learning algorithms). Ukpong, Tan, and Yarovaya [2] and Rahayu et al. [3] provide an excellent review of herding in the financial markets (An earlier review can be found in Bikhchandani and Sharma [4]). However, it is hard to test such a hypothesis using aggregated data (as in the literature). In this paper, we obtain a propriety data set that contains detailed trading information of herding, and as a result, for the first time it allows us to validate this hypothesis. The data set contains all trades transacted by all the brokers/dealers across all locations in Taiwan of all the equities (stocks, warrants, and ETFs).
Technical analysts follow patterns drawn from prices and volume and develop various trading indices. Other than the popular indices like 50-day and 200-day moving averages, there are also sophisticated ones like on-balance volume, stochastic oscillator, and relative strength index, among numerous others. No matter what indices these analysts follow, they are not based upon any fundamental information of the companies. Instead, they are based upon behaviors of the market participants—known as herding.
For pretty much the entire history of studying stock returns, such indices have been ridiculed and looked down upon by economists. Traditional economists criticize such trading indicators as being lacking theory, completely ad-hoc, and highly judgmental (i.e., different analysts can come to different conclusions from the same data) … until now. However, we believe that all those technical indicators, although not supported by any economic theory, are supported by psychological behaviors of market participants—herding.
Not just in stock markets, people in general herd. Often, we vote for a political candidate not because how much we know about this person, or how much we are familiar with his past record, but because our friends vote for him. We listen to our friends’ suggestions to make decisions all the time, without doing actual research ourselves. This is herding.
Not only humans herd, but animals herd as well. Ants and bees rely on one another to find food and avoid prey. Computer scientists observe this and translate their behavior into an algorithm so that we can solve complex problems related to herding—swarm intelligence.
In this paper, we use swarm intelligence to study the herding behavior in stock markets. This is the first time an artificial intelligence model is applied to herding in financial markets. Swarm intelligence is perfectly suitable for herding in that herding is regarded as a psychological behavior that is unrelated to firms’ fundamentals. In order to test if herding exists, we estimate the hyperparameters in the swarm model. Closed-form solutions are derived for special cases, while the general case can be solved numerically.
The rest of the paper is organized as follows. In the next section, we discuss the basic idea and math of swarm intelligence. In Section 3, we also derive the closed-form formulas for the parameters in swarm. We then do not need to numerically solve for the parameters, as many machine learning models do. Section 4 is the main section of the paper. We present data and empirical results. In Section 5, we discuss the major shortcoming of this paper—noise, insufficient granularity, and length of data. And the paper is concluded.

2. A Quick Glance on Herding

Herding is the behavior of individuals in a group acting collectively without centralized direction. Herding is originally observed in animals in herds, packs, bird flocks, fish schools, and so on, as well as in humans. Shiller [5] seems to be the first author who studied herding in the financial market. He describes investors influenced by their peers in making investment decisions as follows:
“Investing in speculative assets is a social activity. Investors spend a substantial part of their leisure time discussing investments, reading about investments, or gossiping about others’ successes or failures in investing. It is thus plausible that investors’ behavior (and hence, prices of speculative assets) would be influenced by social movements.”
As we can all agree, although humans are highly intelligent, they can behave foolishly when they are in a crowd. Hence, with no surprise, the literature has predominantly regarded herding as an irrational behavior. This is because herding does not generate better returns (see Mavruk [1] for a review of such results). The literature documents the following reasons for herding, all of which demonstrate a certain behavioral bias (See Mavruk [1] for further details):
  • fads
  • fear
  • greed
  • reputation
  • noise
All of the above causes can easily result in market disturbances and destabilization. Hence, herding can move the market away from its fundamentals. The conclusion that herding is irrational is consistent with the common wisdom raised by Shiller [5].
As a result, it can be expected that herding is not persistent. It happens sometimes, ceases to happen sometimes, and furthermore contradicts itself sometimes. This is extremely similar to the performances of technical analyses that herding is time-varying and situation-dependent. For this reason, a major effort in the literature is to identify the determinants of herding. Summarized nicely by Rahayu et al. [3], herding is stronger (Please see the citations of relevant papers in Rahayu [3]):
  • when volatility is higher
  • in a crisis
  • for small stocks
  • when there are large price movements
  • in a declining market
  • when rates rise
  • in a poor information environment
It is obvious that such situations are not sustainable situations. They happen only temporarily and are naturally not persistent.
Herding is in general classified as stock herding or investor herding. As their names suggest, the former refers to how investors rush in and out of a stock, and the latter refers to how investors follow their peers. Understandably, the methodology to study both types of herding is the same, while the difference is in data. For stock herding, the data are usually more price related (i.e., in order to measure trading profits) and more frequent, while for investor herding, the data are more shares related (i.e., investors’ holdings) and less frequent.
The measures of herding vary. Yet they can be traced back to Lakonishok, Shleifer, and Vishney [6], who define herding as the difference between the actual change in “purchase intensity” and the expected change of “purchase intensity” (For other measures of herding, see Bikhchandani and Sharma [4] and Mavruk [1] for their surveys):
p t + 1 p t E p t + 1 p t
where p t is purchase intensity. While this definition reflects common wisdom, finding a good proxy for purchase intensity is a challenge. Various authors, given data availability and research focus, use different proxies. Lakonishok, Shleifer, and Vishney [6] use changes in share holdings. While this is a sensible proxy for purchase intensity, such data are only available at the institutional level and only four times a year (i.e., quarterly). As a result, not only does it fail to measure more frequent herding, which is how herding can meaningfully impact trading profits, it also fails to measure retail trading, which is believed to be more interesting (because it is more tightly related to trading profits). In other words, their results are limited to fund managers and are in low frequency. Strictly speaking, it is a result of how information is transferred among fund managers, not herding, which is more understood as trading related.
The other extreme is to use very frequent data (daily), and yet the quality of the proxy is lowered. For example, Ukpong et al. [2] use excess returns (the difference between a stock’s return and the market return) as the proxy. Contrary to Lakonishok, Shleifer, and Vishny [6], they capture the dynamics of herding more perfectly and yet the measurement errors in their results are larger. Using swarm, we are free of the above criticisms in that we directly measure how individual investors follow or not their peers.
A small portion of the literature argues that herding can be rational, mainly caused by information asymmetry. Some individuals in a group have superior information than others. As one can understand, such evidence can only exist in investor herding (not stock herding) and is only limited to institutional investors. These institutions mimic one another due to information asymmetry, which is distinctly different from and hard to reconcile with the aforementioned reasoning of herding. In swarm intelligence, however, these two types of herding can be easily integrated. The former is the usual notion of swarm via separation, alignment, and cohesion (see the next section for details), and the latter is leader following (either via a landscape or a predefined leader or a group of leaders).
Evidence on herding also indicates anti-herding—known as contrarian. Similar to the standard contrarian notion, anti-herding refers to a situation where certain investors tend to diverge from the rest of the group. Again, this can be captured more faithfully by swarm intelligence via alignment, cohesion, and separation.
Some researchers relate herding to momentum (The pioneering academic research on momentum investing can be traced back to Jegadeesh and Titman [7]. They documented how strategies of buying recent stock winners and selling recent losers generated significantly higher near-term returns than the U.S. market overall from 1965 to 1989. They established the basic time frame for momentum-investing success as a 3-to-12-month window on either side. Since then, it has been booming into one of the largest research areas in finance. Recently, they (Jegadeesh and Titman [8]) wrote an excellent review piece of the past 30 years of momentum research). As the first authors systemically documenting herding, Grinblatt, itman, and Wermers [9] define herding as how a group of investors move in and out of the market simultaneously—like a herd. They do not study why they herd. Recently, Demirer, Lien, and Zhang [10] evaluate the impact of industry herding on return momentum. They find that the profitability of industry momentum strategies depends on the level of herding in an industry. Lin, Wu, and Zhang [11] investigate the impact of herding behavior on the momentum effect. Using a new firm-level herding measurement, they find that investors require higher returns in high herding stocks, and they require even higher returns in high herding stocks among previous losers, indicating that investors herd against the previous losers while they herd toward the winners. Chen [12], using intra-day volume data of 2016 over 62 countries, finds that uninformed country-level herding is highly related to momentum (Note that although the data used by Chen (2021) are intra-day, he aggregates information to daily).
Finally, herding is observed internationally. Besides Chen’s work on 62 countries, Rahayu et al. [3] provide an excellent review of literature. They have documented strong evidence of herding internationally (over 20 nations).

3. Swarm Intelligence

Wikipedia describes swarm intelligence as “the collective behavior of decentralized, self-organized systems”. The basic idea of swarm intelligence is derived from those animals (such as birds, ants, bees, and fish) that rely on group effort to achieve their basic survival needs—seek food and avoid prey. The intelligence behind this collective behavior is how they communicate among one another.
There are two versions of swarm intelligence. They are related and yet applied differently on different problems. The first is Boids, and the second is particle swarm optimization. In an Appendix A, we provide a simple numerical, step-by-step example with five fish and two dimensions. The example demonstrates how migration of fish in each iteration is calculated.

3.1. Boids

Reynolds [13] was the first to “artificialize” such natural intelligence and create a computer algorithm named Boids (for bird-oid object). Reynolds’ algorithm is amazingly simple. For any given bird, Reynolds devises a set of linear equations (vectors) combining which determines how the bird should fly to its next destination.
The factors that determine how various vectors are combined are: separation, alignment, and cohesion. As their names suggest, “separation” is to avoid collision with other birds, “alignment” decides how a particular bird should fly in a direction by referencing to its fellow birds, and “cohesion” decides how fast (speed) a particular bird should fly to the center of its fellow birds.
There are countless versions of Boids. One can add obstacles. One can add an objective destination (swim to target). One can do Boids in a maze. The basic Boids as described in Figure 1 can be described by the following algorithm.
In the swarm model, let i = 1 , , m be firm (bird) and j = 1 , , n be stock (dimension). At each given point in time, a map of the locations of bird is taken. The map is a 15-dimensional hypercube image with each axis bounded between 0 and 1.
In the swarm model, let x t ( i ) be a vector of n coordinates (dimensions) where x j , t ( i ) and j = 1 , , n is an element. In other words, x t ( i ) is the position of bird i at time t . For the sake of completeness, define F as a flock of birds { f ( 1 ) , , f ( m ) } whose positions at time t are collected in set X t = { x t ( 1 ) , , x t ( m ) } . In other words, X t is an n × m matrix. The velocity of each bird is defined as a weighted average of various forces:
v t ( i ) = w A v A , t ( i ) + w C v C , t ( i ) + w S v S , t ( i )
where weights sum to 1 and
v A , t ( i ) = avg v t 1 ( j i ) | f ( j ) F v t 1 ( i ) v C , t ( i ) = avg x t 1 ( j i ) | f ( j ) F x t 1 ( i ) v S , t ( i ) = max x t ( i ) x t 1 ( i ) , ε
representing alignment, cohesion, and separation respectively.
The update of position is:
x t ( i ) = x t 1 ( i ) + v t ( i )
In terms of data, each position is a snapshot of the locations of all birds at a given time. From one snapshot to another, it represents a migration (i.e., velocity).
As it can be easily seen, the main purpose of the swarm here is to describe how birds move. For example, if cohesion is dominant, then eventually all birds will line up in a straight line. Similarly, if alignment is dominant, then they all want to move in the same direction parallelly. Finally, if separation is dominant, then they all move randomly. Since there is no stopping time, these birds will keep moving indefinitely.

3.2. Particle Swarm Optimization

Particle swarm optimization (PSO), from its name, is an optimization tool using swarm (See Eberhart and Kennedy [14] and Shi and Eberhart [15]). In PSO, an objective function (or penalty function) is given so birds can all reach the optimal location. The communication mechanism among the birds is the same as Boids, and yet how they move is different.
One can think of PSO is swarm with a landscape (i.e., the objective function). Birds now will try to reach either the peak or bottom (i.e., global optimum) of the landscape. In this case, they will stop moving once their objective is met.
In order to achieve convergence, the velocity of a PSO is given as:
v t ( i ) = w t v t 1 ( i ) + c 1 r 1 ( p t 1 ( i ) x t 1 ( i ) ) + c 2 r 2 ( g t 1 x t 1 ( i ) )
where w t < 1 is a decaying weight (e.g., we can let w t = δ t and δ < 1 ), c 1 and c 2 are two constants, r 1 and r 2 are two random variables, and
p t ( i ) = x τ t ( i ) | max τ ϕ ( x τ ( i ) ) where   ϕ ( ) is the fitness function .
is the personal best and g t = max i p t ( i ) is the global best.
In (4), c 1 and c 2 are learning rates. These are standard parameters in artificial intelligence to attain most effective learning. The two random variables r 1 and r 2 are “exploration”, meaning that the birds do not follow what they “learn” exactly. This is key to artificial intelligence to avoid local optima. Finally, birds follow the instruction from g t 1 x t 1 ( i ) and p t 1 ( i ) x t 1 ( i ) which are regarded as “exploitation” since they would like to learn from given information.
The update of position is the same as (3) and repeated here:
x t ( i ) = x t 1 ( i ) + v t ( i )
A graphical depiction of the particle swarm optimization is given in Figure 2 (with the replacement of p t ( i ) by x ^ i ( t ) ).
Note that swarm is very flexible, and we can put exploration separately (i.e., not mingled with exploitation). In this paper, we alter (4) as follows:
v t ( i ) = w L v L , t ( i ) + w P v P , t ( i )
where w P , t + w L , t = 1 and
v P , t ( i ) = ( 1 α P ( i ) ) u t ( i ) + α P ( i ) ( p t 1 ( i ) x t 1 ( i ) )
and
v L , t ( i ) = α L ( g t 1 x t 1 ( i ) ) or = α L ( i ) ( g t 1 x t 1 ( i ) )
Note that in this paper, we do not have a landscape. The global best (which is the best position of the landscape) is replaced by a “leader”, who is the one with the position g t . As a result, there is no convergence or stopping time in our empirical work.

3.3. Swarm Intelligence and Herding

Swarm intelligence is particularly suitable for studying human herding in that humans, although highly intelligent, behave rather foolishly (i.e., by instinct) when they are in a group. They tend to follow their peers in taking certain actions as opposed to relying on their own intelligence (which includes independent research, judgment, and analyses). In trading stocks, the finance literature has long documented herding in human behavior. It is rather obvious if we just look around how people choose their investment targets. Very few actually use their intelligence but rather make hasty decisions based upon the suggestions of their peers. It is not just trading; we also observe a similar phenomenon in political elections. Reference groups are essential to how people vote. It is this observation that motivates this research. As a result, instead of using the traditional methods (i.e., statistical methods), which mainly rely upon covariances to study herding (Regressions in the herding literature are based upon covariances (between dependent and explanatory variables)), it is more natural and common-sense to use swarm to study herding. In swarm, herding is not determined by covariances of the performances of stocks. Rather, it detects if a trader actually follows the other traders.
As seen in the above subsections, the hyperparameters of a swarm determine its behavior (and in turn, determines the performance of the market). In a Boid, alignment, cohesion, and separation (and leader-following) are the main parameters. Alignment is how an investor follows the same trend of his peers, cohesion is how an investor would like to hold the same position of stocks as his peers, and finally, separation is how an investor would like to be a contrarian (anti-herding). Although one can add other behavioral parameters (e.g., leader-following, or grouping), Reynolds [13] argues that these are the main parameters that a swarm needs. Indeed, the “social movements” recognized by Shiller [5] are quite consistent with Reynolds’ design of swarm. Any individual either wants to “keep up with the Joneses” (i.e., cohesion), takes a successful story and learns from it (i.e., follows its path, alignment), or takes a failure story and avoids its path (i.e., separation). In other words, Reynolds’ swarm is a direct model for an individual who wants to herd. The statistical methods used in herding are at best an indirect detection of herding, while swarm intelligence is a direct recognition of herding.
Swarm intelligence has been widely used in scientific research (which is not relevant to this paper). (Note that there is a wide variety of different swarm models (in both boids and particle swarm optimization)). In finance, unfortunately, there have been very limited number of applications. Recent work includes Chen [16] on stock picking, Chen and Behrndt [17] on commodity options, Chen et al. [18] on stock options, Chen, Huang, and Yeh [19] on portfolio construction, and Chen, Miller and Toh [20,21] on firm search (See Huang [22] for a survey).

4. Empirical Methodology

We can estimate the parameters of swarm (Equation (1)) using data. Empirical (i.e., data) positions can be labeled as ξ t ( i ) and velocity as ν t ( i ) (to substitute for x t ( i ) and v t ( i ) in (3)). Hence, similar to (3):
ν t ( i ) = ξ t ( i ) ξ t 1 ( i )
Our objective function is to minimize the sum of squared errors between ν t ( i ) and v t ( i ) :
min α P , t ( i ) ( v t ( i ) ν t ( i ) ) ( v t ( i ) ν t ( i ) ) = min α P , t ( i ) j = 1 n ( v j , t ( i ) ν j , t ( i ) ) 2
Taking partial derivative and setting it to 0:
( v j , t ( i ) ν j , t ( i ) ) v j , t ( i ) θ = 0
where θ is a chosen parameter.
Clearly, (11) in general has no closed-form solution and needs to be solved numerically. However, if we focus on one parameter at a time (i.e., holding other parameters constant), then there is a closed-form solution, which is what we implement in the empirical section.

4.1. Boids

Rewrite (1) slightly as follows:
v t ( i ) = w A , t ( i ) v A , t ( i ) + w C , t ( i ) v C , t ( i ) + ( 1 w A , t ( i ) w C , t ( i ) ) v S , t ( i )    = w A , t ( i ) v A , t ( i ) v S , t ( i ) + w C , t ( i ) v C , t ( i ) v S , t ( i ) + v S , t ( i )    = w A , t ( i ) A t ( i ) + w C , t ( i ) C t ( i ) + S t ( i )
Then we follow (11) and take partial derivatives with respect to alignment w A and cohesion w C parameters, respectively. This leads to a simultaneous equation system (the derivation is in Appendix C), and the solution is:
w A , t ( i ) w C , t ( i ) = 1 x 11 x 22 x 12 2 x 22 x 12 x 12 x 11 y 1 y 2
where (note that i, j, and t are dropped from x for easy expression)
x A C = j = 1 n A j , t ( i ) C j , t ( i ) ,
y X = j = 1 n ν j , t ( i ) X j , t ( i ) j = 1 n X j , t ( i ) S j , t ( i ) (in which X is either A or C),
And finally, ν j , t ( i ) = ξ j , t ( i ) ξ j , t 1 ( i ) is velocity computed from data.
For the reason that is clear later, we also run the estimation without separation. In that case, (1) can be rewritten as:
v t ( i ) = w t ( i ) v A , t ( i ) + ( 1 w t ( i ) ) v C , t ( i )
Similar to the process in solving (12), we can solve for the weight (details in Appendix C) as follows:
w t ( i ) = j = 1 n ( ν j , t ( i ) v C , j , t ( i ) ) ( v A , j , t ( i ) v C , j , t ( i ) ) j = 1 n ( v A , j , t ( i ) v C , j , t ( i ) ) 2
Note that in this case, we force the brokers/dealers to swarm. If in reality brokers/dealers do not swarm, then the weight should be random and present no patterns.

4.2. Particle Swarm Optimization

We have several tests (for our hypotheses). The first is to see if a broker/dealer explores. In this test, we rewrite (7) as follows ( w P = 1 ):
v t ( i ) = v P , t ( i )    = ( 1 α P ( i ) ) u t ( i ) + α P ( i ) ( p t ( i ) x t ( i ) )
From the Appendix, we solve the coefficient analytically as:
α P , t ( i ) = j = 1 n ( ν j , t ( i ) u j , t ( i ) ) ( p j , t ( i ) x j , t ( i ) u j , t ( i ) ) j = 1 n ( p j , t ( i ) x j , t ( i ) u j , t ( i ) ) 2
Alternatively, we could let w L = 1 and
v L , t ( i ) = α L , t ( i ) ( g t 1 x t 1 ( i ) ) v L , t ( i ) = α L , t ( g t 1 x t 1 ( i ) )
where the former is each firm has its own α L , t ( i ) and the latter is all firms share the same α L , t . The solution (see Appendix B) is:
α L , t ( i ) = j = 1 n ν j , t ( i ) ( g j , t x j , t ( i ) ) j = 1 n ( g j , t x j , t ( i ) ) 2
and the average across individual brokers/dealers is:
α ¯ L , t = 1 m i = 1 m α L , t ( i )     = 1 m i = 1 m j = 1 n ν j , t ( i ) ( g j , t x j , t ( i ) ) j = 1 n ( g j , t x j , t ( i ) ) 2
This can be compared to the other solutions where all firms adopt the exact same parameter value, which is:
α L , t = i = 1 m j = 1 n ν j , t ( i ) ( g j , t x j , t ( i ) ) i = 1 m j = 1 n ( g j , t x j , t ( i ) ) 2
Finally, we can estimate both parameters jointly (see Appendix B).
v t ( i ) = w t ( i ) v P , t ( i ) + ( 1 w t ( i ) ) v L , t ( i )
However, we end up with three simultaneous equations:
j = 1 n w t ( i ) u j , t ( i ) z j , t ( i ) + w t α P , t ( i ) ( z j , t ( i ) ) 2 + ( 1 w t ( i ) ) v L , j , t ( i ) z j , t ( i ) ν j , t z j , t ( i ) = 0 j = 1 n [ w t ( i ) v P , j , t ( i ) + ( 1 w t ( i ) ) α L , t ( i ) ( g j , t 1 x j , t 1 ( i ) ) ν j , t ] [ g j , t 1 x j , t 1 ( i ) ] = 0 j = 1 n ( v t 1 ( i ) ν t 1 ( i ) ) { ( u t 1 ( i ) + α P , t ( i ) ( p t 1 ( i ) x t 1 ( i ) u t 1 ( i ) ) ) α L , t ( i ) ( g j , t x t 1 ( i ) ) } = 0
Instead of solving the system of simultaneous equations, in the empirical work, we simplify the problem by holding the weight constant (0.5 and 0.6) and then solve for α L , t ( i ) and α P , t ( i ) respectively. See Appendix B for details.

5. Empirical Findings

As mentioned in the introduction, herding is widely observed in financial markets, yet it has been only studied with low-frequency data. Furthermore, such empirical evidence is indirect and could be subject to large measurement errors (due to proxies for herding). In this study, a benefit from a proprietary data set, we are for the first time able to examine at the broker/dealer level the herding behavior. We use two swarm intelligence models to examine such a behavior.

5.1. Data

We use a proprietary data obtained from HiHedge. (We are highly grateful for the CEO of HiHedge, Dr. Gu Jiaqi, for generously providing the data at no cost). The data contain the whole year of 2019 of all the trading activities (prices and volumes of buy, sell, and trade) of all the locations of all the securities firms in Taiwan. The data therefore include all (80) broker/dealer trades in all (294) locations in Taiwan. Consequently, the data contain a total 205,678,058 transactions. To my knowledge, such granularity of data has not been possible in the literature of swarm intelligence.
Each transaction is labeled as buy or sell, its price (NT$), and its volume (shares). The data do not contain time stamps, and hence, they are aggregated within a day. In 2019, there are a total of 223 trading days. In other words, for the same broker/dealer and location, all buy transactions and sell transactions (separately) are summed up into one transaction within a day.
The data include stocks, warrants, and ETFs. In this study, we limit our focus on only TSE (967) stocks. In particular, we first focus on only the top 20 stocks, which account for 50% of the market size in TSE (Note that TSMC (#2330) alone accounts for over 25% of the TSE). The distribution is given in Figure 3.
As we can see, the size of companies becomes exponentially smaller. For this reason, in our empirical work, we study swarm using all stocks as well as the top 20 stocks.
The top 20 stocks are listed in Table 1. These companies allocate across 11 industries (financial 6, semi-conductor 4, plastic 2, auto 1, energy 1, telecom 1, steel 1, electronic parts 1, computer 1, food 1, other electronics 1.
As we can see, TSMC has the most share trading volume (5.31%), and yet Hon Hai Precision has the most dollar trading volume (0.72%). However, Hon Hai Precision is ranked #3 in share volume (1.98%), which is only one-third of TSMC.
Both TSMC and Hon Hai Precision are Taiwan’s most valuable companies (TSMC (ADR) is also traded on the NYSE under the ticker TSM. The market cap as of May 24 is $826 billion. In 2019, the market cap of TSM was roughly $220 billion). TSMC is the world’s largest chip manufacturer (According to SemiWiki, TSMC occupies 28% of the chip market, followed by Samsung of 10%), and Hon Hai Precision (who owns Foxconn in China), is the most important manufacturer for Apple’s iPhones. Hence, we also provide the list of the top 20 stocks by market capitalization in Table 2.
Now we can see that TSMC has a dominant market share in TSE of 26.58%, with Hon Hai Precision being the second of 2.83% (not counting Foxconn in China). For our study, we use Table 1 for our top 20 firms, so we are internally consistent.
Among the total of 80 brokers/dealers, three brokers/dealers are data error (i.e., no such brokers/dealers in Taiwan), and two brokers/dealers trade only futures and options but are mistakenly listed as stockbrokers/dealers. They are removed from our study. As a result, we are left with 75 stockbrokers/dealers, which are given in Table 3.
In our empirical work, we use volume data to detect swarm. There are both share volume and dollar volume (shares multiplied by price) bought and sold. To have a quick glance of such data, we plot them in Figure 4. In Figure 4, we plot daily trading volumes of all the stocks in 2019. They are shares bought and dollar volumes bought.
It is clear that volume data are noisy, and hence, difficult to see patterns. Overall, dollar and share volumes are similar, indicating that the variability of shares dominates that of prices.
The average share trading volume is 5.22 billion shares per day and NT$15.3 trillion (about $5 billion). Hence, the average price per share is NT$29.28 (about 97 cents). (Note that the largest stock in Taiwan—Taiwan Semi-conductor Manufacturing Company, or TSMC (ticker = 2330), shows an average price of NT$263.5 (about $8.5) in the data. TSMC closed at NT$867 (about $28.5) as of 24 May 2024).
We also note that there is no growth in share volume (a linear regression fit has a slightly negative slope near 0 R2) and yet a noticeable 3.12% growth in dollar volume (R2 is 11%). Clearly, the visible growth in dollar volume is a result of price growth in 2019 of the overall stock market in Taiwan.
The data have the following shortcomings:
  • It is a one-time collection. The data are proprietary, and hence, there is no subsequent effort of such data collection. The year 2019 is not chosen for any particular reason.
  • It does not have time stamps, which makes it impossible to study intraday swarm, which is believed to be more evident.

5.2. Boids Results

We present two estimation results in this subsection. One is a joint estimation of all three hyperparameters: alignment, cohesion, and separation. The other is an estimation of only alignment and cohesion. The purpose of eliminating separation is to directly compare the relative strengths of alignment and cohesion, given that separation dominates.

5.2.1. Joint Estimation of Alignment, Cohesion, and Separation

The first set of results using (12) refer to Boids and are plotted in Figure 5. In Figure 5, we set v S , t ( i ) = 0 . Note that the idea behind separation is a random move (similar to exploration), and as a result of that, its velocity v S , t ( i ) is a random number. This would unpleasantly cause the solution to the weights w A , t ( i ) and w C , t ( i ) to be random. In such a case, we must take expected values. If the effect of Jensen’s inequality is small, the expected values of w A , t ( i ) and w C , t ( i ) would be similar to (12) when the expected value of v S , t ( i ) is 0. E [ v S , t ( i ) ] = 0 is not a bad assumption because it is a white-noise move, and it is reasonable for its expected value to be 0. In other words, by assuming E [ v S , t ( i ) ] = 0 , we only suffer from the bias of Jensen’s inequality.
We plot both alignment and cohesion weights in Figure 5. We fit the model (12) to shares bought, shares sold, dollar volume bought, and dollar volume sold. These values are median values across all 75 brokers/dealers. While not reported here, mean values across 75 brokers/dealers are way more volatile. For instance, the maximum w A , t ( i ) is 6241.57 and the minimum is −4744.30 using shares bought. Similarly, using shares bought, the maximum w C , t ( i ) is 650,133.46 and the minimum is −186,886.23.
We first observe that, in all four cases, cohesion weight w C , t (median across brokers/dealers, hence, superscript ( i ) disappears) is higher than alignment weight w A , t . Furthermore, while w C , t is mostly positive, w A ( i ) is mostly negative. Secondly, there is higher volatility of w C , t than of w A , t . The median of medians for alignment weight is around −0.6 in all four cases, and for cohesion it is 0 in all four cases. This implies that separation is around 1.6, given that the three parameters must sum to 1 by construction.
The above result indicates that there is not much swarm (or anti-swarm) among these firms. Note that 0 cohesion represents that firms do not move towards the positions of other firms, and negative alignment represents that firms move in an opposite direction of other firms. However, these median values are not significant (although there is no formal statistical test, we can see that the standard deviation is over 10 times of the median).

5.2.2. Joint Estimation of Alignment and Cohesion Only (Without Separation)

In lieu of the above result, we remove separation and only compare cohesion against alignment. In other words, we solve for the alignment weight in (14). The results are presented in Figure 6.
The purpose to remove separation and only concentrate on alignment and cohesion is to distinguish the relative strengths of the two swarm behaviors. In estimating (12), we do not constrain on alignment or cohesion. Here, we constrain that w A , t ( i ) + w C , t ( i ) = 1 . Similar to Figure 5, Figure 6 also contains four time series plots. Both means and medians of w A , t ( i ) across 75 brokers/dealers are plotted in Figure 6. w C , t ( i ) is simply 1 w A , t ( i ) .
Now, we find that the means and medians are closer to each other, indicating no extreme values (across 75 brokers/dealers). A quick glance of Figure 6 leads to a general observation that cohesion is stronger than alignment. Buy share volume has an overall median of 0.1507 (i.e., average of medians while the median of medians is 0.1324), and sell share volume average of medians is 0.1053 and median of medians is 0.0882. This indicates that, overall, brokers/dealers have a much weaker alignment than cohesion, since sum of the two weights is 1.
This result confirms the relative magnitude of the two parameters, that cohesion has a higher value than alignment. However, the interpretation of the result is quite different. Since now both are positive (since we remove separation, hence anti-swarm), we can more easily see that firms tend to move toward the positions of their competitors rather than follow where they want to go.
Dollar volumes tell the same story. The median of medians for the buy volume is 0.1689 and for the sell volume is 0.1604 (while the averages of the median are 0.1776 and 0.1900, respectively). The average (i.e., average of averages) buy dollar volume yields an even more negligent alignment of −0.0220, and the dollar sell volume yields similarly of 0.0184. This is even a stronger cohesion tendency than share volumes.
Secondly, it is clear that alignment (hence cohesion) is volatile, for both median and mean. This prevents us from identifying a time series pattern of swarming by Taiwanese brokers/dealers (at least in our sample period 2019). There are some possible explanations. The most obvious one is that the volume data are known to be extremely noisy. As a result, it is translated to model parameters—cohesion and alignment. In such a case, the remedy is usually to take moving average. However, given that we have only a very short time series (and worse, the data are daily), taking moving averages is no more insightful than simply looking at the overall averages.
To see that, we calculate a series of correlation coefficients and report them in Table 4. Table 4 reports correlation coefficients between alignment and cohesion weights and volume data plotted in Figure 4.
We can see that in general, the correlation values are quite substantial. The cohesion weight has over 22% correlation with volume data in all four categories. The alignment weight can be as highly correlated with shares sold as almost 25% (although with shares bought, the correlation values are low). This confirms the suspicion above that noisy data impacts the estimates of parameters. With this observation in mind, we can roughly conclude that the brokers/dealers in the Taiwan stock market present a weak but non-trivial swarm behavior.
The only outlier is how alignment is correlated with dollar volume bought (1.30%). Also note that the second lowest correlation is between alignment and share volume bought (12.30%), although it is barely significant at the 10% level. Both of these low correlation results indicate that buy volumes do not significantly impact alignment of brokers/dealers. In contrast, cohesion seems to reflect more closely of data (correlation is consistently at −22~23%). If we look at the equation that computes the alignment parameter, it is clear that it is dominated by how alignment velocity is different from the cohesion velocity. It is the randomness in this quantity that results in low correlation between alignment buy volume data.

5.2.3. Who Swarms?

As in Lakonishok, Shleifer, and Vishny [6], we study investor herding as opposed to stock herding. Yet more insightful than Lakonishok, Shleifer, and Vishny [6], the swarm result can identify the tendency of herding of each individual firm. This is the key advantage of using swarm intelligence as a traditional statistical method.
In this subsection, we examine which brokers/dealers are the strongest followers in the swarm. The results are plotted in Figure 7. Like previous figures, we present the results in four volume panels. We sort these brokers/dealers by w A , t ( i ) the alignment weight (y-axis). Note that the cohesion weight is w C , t ( i ) = 1 w A , t ( i ) . The x-axis is dealer/broker (by their numbers listed in Table 3).
Except for the buy dollar volume, the other three panels have no higher than one alignment weight. In the case of share volumes (buy and sell), the value of w A , t (average across brokers/dealers and hence, subscript ( i ) disappears) is 0.7 and −0.4. The decrease of w A , t is roughly linear, indicating that there are no particular outliers (however, we do notice two outliers in buy dollar volume and one outlier in sell dollar volume).
We selectively look at the top 20 brokers/dealers who show strong w A ( i ) (average across time and hence, subscript t disappears). Their names are given in Table 5. There are 32 non-repeating names in Table 5.
In Table 5, we first observe that there are six brokers/dealers who are on the list of all four panels: #16 (First Financial), #19 (I Win Securities), #30 (Reliance Securities), # 33 (Z Ho Securities), #35 (Bridge Stone Securities), and #56 (Union Bank). There is no coincidence that these are all small brokers/dealers. Small firms follow large firms in that they do not have the same research capabilities as well as market power to lead the market. They are more of a follower as a result. For the remaining 26 firms, 12 of which are on three of the four panels. This indicates that regardless which volume measure is used, a follower in one tends to be also a follower in another.

5.3. PSO Results

In addition to estimating the Boids swarm model, we also estimate the particle swarm optimization model. Particle swarm optimization (PSO) is a swarm model but is mainly used to seek the optimum of an objective function (known as landscape). As a result, PSO can be regarded as a heuristic search (or smart grid search). Boids now are assigned a target to meet.
Because of this particular purpose, while the intelligence of swarm is reserved, the information sought by these birds is different. Now they look for a leader to follow. Hence, instead of following the whole crowd (i.e., align with the crowd in directions or seek to move to toward the crowd), now each bird will identify who the leader (which is the one closest to the target) is and move toward the leader (known as “exploitation”), but at the same time, it is necessary for each bird to “explore” its current neighborhood to see if the true optimum is simply just nearby. Note that there are a number of ways to structure exploration. Equation (4) is the most common expression where exploitation and exploration are intertwined. However, this is not necessarily the case. For the purpose of our empirical work, we follow a modified PSO as in (4a).
We first, as in the previous section, use only the top 20 stocks (listed in Table 2) to fit a PSO model. Then, as a robust check, we use the entire stock market in TSE, which has 967 stocks in total. A flow chart is provided in Figure 8.
In Figure 8, the relationships of various tests are provided. From Figure 8, one can see how parameters can differ if a different setup of swarm is used. As we can see, we fit the swarm model to the entire data set (976 stocks) and also the top stocks (20 stocks). We also fit the model to share volume (both buy volume and sell volume) as well as dollar volume. We experiment various possibilities such as net buy (which is buy volume subtracting sell volume) and net sell (which is sell volume subtracting buy volume). As a result, there are a large number of pair comparisons. To conserve space, we only represent those pairs that show a substantial difference. Other results are available upon request.
It seems that the swarm behaviors between different volume measures and different sample sizes matter the most. And between the two, sample size matters more than volume measure. As a result, we select four comparisons (other results are available on request) in Figure 9:
(1)-(5) share volume versus dollar volume under all (967) stocks.
(2)-(6) share volume versus dollar volume under top (20) stocks
(5)-(4) all (967) stocks versus top (20) stock under dollar volume
(3)-(2) all (967) stocks versus top (20) stock under share volume
Figure 9 plots a joint estimate of exploitation (leader-following) α L ( i ) and exploration (personal-freedom) α P ( i ) in panels (A) and (B), respectively. Along the x-axis are 75 brokers/dealers ( i = 1 , , 75 and the names of the brokers/dealers are given in Table 3). Each α L ( i ) value is an average across time, and hence, subscript t drops out) for each broker/dealer.
The first comparison, (1)-(5), is share volume versus dollar volume, where the leader is defined as holding the highest net buy position and all 976 stocks are considered. α L ( i ) in both cases are largely negative but less negative for share volume than for dollar volume. Furthermore, the two sets of estimates are marginally similar to each other. The correlation between them is 23.77% (significant at the 6.5% level).
We do observe some exceptionally large positive values but only very few. The grand averages are still negative even with these exceptionally large positive values. They are −0.39 and −0.51, respectively. (The medians are −0.61 and −0.53, respectively).
In contrast, (2)-(6), is the same comparison (share volume versus dollar volume), but only the top 20 stocks are considered (hence, a much smaller sample). Similar to the case (1)-(5), both sets of α L ( i ) values are similar to each other. However, they are much more similar than the case (1)-(5). The correlation now is much higher 82.60% (significant at the 0.5% level).
This indicates that in a smaller sample, we observe less difference between share volume and dollar volume. Note that the smaller sample is also more dominant in that the top 20 stocks account for a large portion of the market. In other words, except for the top stocks, the majority of the stocks in TSE provide a lot of noise trading.
Now we turn to comparing directly whole same (967 stocks) and subsample (20 stocks). We first compare the two under the share volume, i.e., (3)-(2). In comparison (3)-(2), we observe drastic differences. α L ( i ) values are substantially less negative in the case of 20 stocks than in the case of all stocks. The averages are −0.50 and −0.04, respectively, for all stocks and 20 stocks. The correlation is −27.31% (significant at the 5% level), implying that the two set of estimates are rather opposite of each other. This indicates that not only the top 20 stocks do not dominate the market, but the other stocks also move in an opposite direction from the top 20 stocks.
In contrast, the dollar volume comparison (5)-(4) presents a different result from which of (3)-(2). The grand averages are −0.39 and −0.08, respectively, for all stocks and 20 stocks. The correlation is only −8.36% (insignificant). This indicates that the effect that the other stocks move against the top 20 stocks is significantly less. Again, this is due to the price impact. Alternatively speaking, the general price trend negates the negative correlation between the whole market and the top submarket.
The same set of graphs for α P ( i ) is provided in Panel (B) of Figure 9. They are quite different from the results of following the leader α L ( i ) . Except that the values of α P ( i ) are mostly negative, similar to the values of α L ( i ) , the difference between whole market and submarket (i.e., (3)-(2) for share volume, and (5)-(4) for dollar volume) is less substantial. Now the two markets both show positive correlation (25.12% and 8.35%, respectively).
In terms of difference between share and dollar volumes (i.e., (1)-(5) for all stocks and (2)-(6) for 20 stocks), the α P ( i ) values are very similar (between −0.4 and −0.6). The correlation is 40.51% and 42.49%, respectively (significant at 2% level). This is different from the case of α L ( i ) (see above).
To further investigate the difference, we turn to the raw data (that are used to compute α L ( i ) and α P ( i ) ) of all 967 stocks and only the top 20 stocks. We compute the daily net shares bought and net dollars bought of all stocks and the top 20 stocks. To conserve space, these results are available on request. The correlation between the two of share volume is 2.82% and the correlation of dollar volume is 46.48%. It is clear that high correlation in price movements boosts the correlation of the two-dollar volume measurements.
Note that the net dollar volume of the stock is the net purchase of the stock. Hence, it is reasonable to assume that a broker/dealer will swarm according to the net purchases of other brokers/dealers. As a result, this is a more reliable metric to measure how brokers/dealers swarm.
To grasp a general sense of the magnitudes of the results, we report their summary statistics in Table 6. In Table 6, the columns correspond to Figure 8. However, different from Figure 9 that show swarm by brokers/dealers (i.e., taking averages over time for each broker/dealer), Table 6 first takes averages across brokers/dealers, and then the summary statistics are taken over 223 days.
We can see that while various versions of PSO show differences in how brokers/dealers swarm in Figure 9, the overall averages are quite similar. Regardless of different versions of PSO, they are all negative and roughly at a level about −0.4 (with cases #2, #4, and #6 at about −0.07). We notice that the minimum and maximum values are mild, mainly due to each day there is already an average taken across all brokers/dealers. We also notice that the difference between α L (average over both brokers/dealers and time, and hence ( i ) and t both drop out) and α P is much smaller, although α P is slightly more negative than α L . Besides, α P is more uniform across different versions of PSO, ranging from −0.43 to −0.74.
The next empirical work is to estimate α L , t ( i ) and α P , t ( i ) by themselves separately (not jointly). We obtain the same number of results for α L , t ( i ) and α P , t ( i ) estimated separately on their own. To conserve space, we only choose a few to compare to the results that they are estimated jointly. The results are reported in Figure 10.
The first is to use case #6 where all (967) stocks and dollar volume are used to estimate α L , t ( i ) and α P , t ( i ) , as seen in the Panel (A) of Figure 10. On the left, we compare α L ( i ) (average across time, and hence, subscript t drops out) when it is estimated on its own and with α P ( i ) . As we can see, the two results are similar in direction and yet different in magnitude. The correlation between the two is 40.64%, which is significant. Interestingly the magnitude (and also variation) of α L ( i ) estimated jointly is so much larger than if estimated in separation.
In the middle of Panel (A) is the same comparison for α P ( i ) (average across time, and hence, subscript t drops out). We do see that when α P ( i ) has a larger magnitude when it is estimated jointly with α L ( i ) than by itself. This is similar to the result of α L ( i ) . Also similar is the high correlation between the two, which is 41.92%.
While α L ( i ) and α P ( i ) (average across time, and hence, subscript t drops out) both have higher magnitudes when they are estimated together jointly, they tend to compensate each other. To see that, we plot the two on the right of Panel (A). Now, it is clear that α L ( i ) and α P ( i ) move in exactly the opposite direction. This is expected in that they split the total velocity. The correlation here is –95.36%.
Now we turn to compare α L ( i ) and α P ( i ) (average across time, and hence, subscript t drops out) in Panel (B) when they are estimated on their own separately. For the first comparisons, we choose the case of the top (20) stocks. On the very left of Panel (B) is dollar volume, and in the middle of Panel (B) is share volume. As we can see, the two results have very similar conclusions. α L ( i ) and α P ( i ) move in the same direction in both cases. The correlation is about 12%, which is not as high as those in Panel (A) and yet is still quite noticeable, especially for those last several brokers/dealers. Also, we observe that α P ( i ) has a much larger magnitude than α L ( i ) . This is expected as the former contains a random number in each iteration.
Lastly, we examine the similarity between α L ( i ) and α P ( i ) (average across time, and hence, subscript t drops out) when they are estimated jointly. This is analogous to the right-most case in Panel (A). The difference is here we have dollar volume and in Panel (A) it is share volume. We see that some brokers/dealers are similar, but some others are different. For example, we can see that the last few brokers/dealers whose α L ( i ) and α P ( i ) move in oppose directions in both cases. Yet, those brokers/dealers in the middle tend to move in opposite directions in Panel (A) but in the same direction in Panel (B). There are two possible sources that can cause such a result. First is the number of stocks considered. In Panel (B), only 20 stocks are used as opposed to all 967 stocks in Panel (A). Furthermore, dollar volume has a price influence. As prices move higher as a general trend, it will cause positive correlation (or negate negative correlation).
To grasp a general sense of the magnitude of the results, we report their summary statistics in Table 7. Columns of Table 7 correspond to Figure 8, reflecting different versions of PSO.
The values of α L and α P (average across both brokers/dealers and time, and hence, ( i ) and t drop out) in Table 7 are quite similar to those in Table 6. The averages of α L and α P in particular are similar to those in Table 6. However, the standard deviations are smaller. In the case of α L , they are at the magnitudes of 0.1 and 0.2 now as opposed to 0.3 and 0.4 in Table 6. This is same in the case of α P . Minimum and maximum values are also milder when they are estimated separately than jointly.

6. Limitations of Data (We Thank an Anonymous Referee for His/er Excellent Insight and Suggestions Toward This Limitation of This Paper)

There are two major limitations of the data used in this study. The first is its lack of intraday time stamps. The second is the noisy nature of volume data (compared to institutional holdings).

6.1. Lack of Time Stamps

The proprietary data given by HiHedge contain intraday trading by all brokers/dealers across all locations in Taiwan. Theoretically, this would be an ideal data set for studying swarm. Unfortunately, these trades lack time stamps during the day. As a result, we must aggregate the trades into daily volumes. In a swarm, each fish is moving according to its neighbor fish. With time stamps, each broker/dealer then can observe, at every moment, all the other brokers/dealers’ tractions and decide if it wants to align with them, cohere to the same holdings as them, or separate from them. With estimation Equations (14)~(17), we can then use data to back out what a particular movement of a particular broker/dealer means. Does he align, cohere, or separate (or follow a leader). This is superior to using an indirect proxy to measure herding and a linear regression model to determine its determinants.
Unfortunately, without time stamps, we cannot actually detect such swarm. Instead, we can only observe between each day how holdings of each broker/dealer change. This is similar to Lakonish, Shleifer, and Vishney [6], yet we do have one advantage—daily as opposed to quarterly.
Not only do we lose information by aggregating, we also mitigate the effects of swarm due to not able to precisely observe the time of the movements. In daily data, we implicitly assume that the movement of today is based upon the movement of others of yesterday. As we clearly see, this is not accurate at all if the true swarm is based upon intra-day reactions. For example, a trade in the middle of day is based upon the movements of the others on the same day, not the previous day.

6.2. Volume Too Noisy

While the deficiency of intra-day information is data collection limitation, the volume data themselves are simply noisy (even noisier for intra-day). It is natural that noisy volume data can result in noisy parameter estimates. Such a limitation cannot be fixed via better data collection methods. It must be handled via noise reduction methods.
Fortunately there are many powerful noise-reduction (smoothing) methods in statistics such as Kalman filter or Savitzky-Golay filter. One can also employ image processing techniques for pattern recognition to screen out noise. Although we can use these techniques on our volume data (in fact, we did play with Savitzky-Golay filter), simple eye-balling the data clearly reveals that the data presents no pattern. This is because we have too few points (232 only) to show any pattern. A longer dataset (either via a higher frequency such as intra-day or a longer time period such as multi-year) is necessary.
However, unfortunately, with just one year of data (our major empirical limitation), we would not be able to fully benefit from a filter. Without a visible pattern or trend, filtered data would generate result very similar to just a simple average of current estimates. (Imagine an extreme case where raw data contain only noise but no pattern or trend. Then a filter will simply produce a straight line as the result—at the average). Waggle and Agrrawal [23], when discussion the “sell-in-May” anomaly, study the seasonal effects in trading profits. When such an effect (or any patterns) is observed, it is possible that swarm is existent. Then filters like Kalman or Savitzky-Golay would then be helpful in reducing the noise in raw data.

7. Conclusions and Future Research

In this paper, we examine if the stock brokers/dealers in Taiwan swarm. The contributions of this paper are as follows: (i) It is the first paper to use swarm intelligence to model herding. Swarm is a perfect choice for herding in that it describes a group behavior. The goal-seeking incentive (e.g. bees seeking honey) that underlies swarm is the same as profit-seeking investors. (ii) We explicitly estimate hyper-parameters of swarm (via a set of closed-form solutions derived in this paper) which allow readers (different from all previous herding research) to see the exact behavior of herding. (iii) We luckily acquired a proprietary dataset from HiHedge. The data contain all transactions happened in all the branches of all the brokers/dealers in Taiwan in 2019. Without such data the swarm model could not be estimated.
Two swarm models are employed in the study. One is Boids which describes how birds swarm and the other is particle swarm optimization (PSO) which use swarm to find the global optimum. We adapt both models to fit in our situation here. In particular, we modify the PSO algorithm to capture if there is a leader that all firms follow.
The results show a weak swarm behavior in Taiwan’s stock market in 2019. The PSO result is slightly stronger than the Boids result. This weak result can be largely attributed to noisy volume data in the first place. Noisy data translate naturally to noisy parameter estimates. We find high co-movements between parameter estimates and raw volume data. For future research, we must reduce noise in the volume data.
Not only do we detect swarm in Taiwan’s stock market, we also observe some econometric issues. For example, we find that parameters in swarm tend to offset each other. This is frequently observed in financial studies as models are forced to fit data.
Finally, as mentioned earlier, Mavruk [1] uses various machine learning algorithms to retrieve features that explain herding. However, his study separates stock herding from investor herding. Using swarm, we jointly study which investor herds which stock. As a result, we can fully benefit his feature-selection algorithms in improving the current paper (provided that better data (i.e., longer and more granular) can be accessible).
There are limitations to this study. First, there is no time stamp attached to each transaction. As a result, although there are over 200 million transactions, they are aggregated to less than a million observations on a daily basis. Such a loss of information drastically reduces the validity of the result. One obvious problem, as mentioned above, is how information is transmitted in a swarm. Note that in a swarm, each fish examines where other fish are located and how they want to move, and then decides how it will make its own move. Such an assumption requires at any time s on day t, positions of all fish at time s − 1 on day t are known. Without intraday time stamps, each fish makes its move at time s (e.g., 10:30 a.m.) on day t (e.g., 2 June 2019) based upon information on day t − 1 (i.e., 1 June 2019), as opposed to time s − 1 (i.e., 10:30 a.m.) on day t (i.e., 2 June 2019). This clearly defeats the validity of the result. Another problem is the noisy nature of the volume data. With a long enough time series of data, one can adopt various statistical tools, such as filters and pattern-recognition tools in image processing to reduce noises. Due to the aggregation of intraday data into daily data, we lose a large majority of data. This prohibits us from identifying any pattern in the volume data. This is clearly present in Figure 4 in which it is indistinguishable between herding and noise.
For future research, the methodologies proposed in this paper can be applied when more granular data are available in order to obtain more insightful results. Furthermore, one can utilize textual data to obtain insightful results. This is because herding is often triggered by news. The development of models used to retrieve information from textual data has been exploding, most notably “generative pre-trained transformers” (or GPT). The methodologies proposed in this paper can be applied to these transformers to obtain more insightful results.

Funding

This research received no external funding.

Institutional Review Board Statement

The study did not require ethical approval.

Informed Consent Statement

Not applicable.

Data Availability Statement

Data is unavailable due to privacy restrictions.

Acknowledgments

We are grateful for HiHedge for the proprietary data.

Conflicts of Interest

The author declares no conflicts of interest.

Appendix A

This appendix provides an example of a simple swarm algorithm with five fish in two dimensions. We first randomly set the initial positions of the five fish in a unit square (i.e., between 0 and 1) and also initial velocity (between 0 and 1), as follows:
position velocity
x1x2v1v2
10.20380.67600.58240.6446
20.17870.48140.69430.0557
30.71320.86290.03720.9300
40.28380.23290.99470.3429
50.72710.24680.86900.6400
From the position values, we can calculate cohesion. From the velocity values, we can calculate alignment. Finally, we can add separation by prohibiting fish from colliding into one another. Note that each fish has a tendency to swim toward the center of other fish. Hence, for each fish, we need to calculate the averages of the coordinates of other fish (i.e., center). For example, for fish 1, the center of the other 4 fish (fish 2, 3, 4, and 5) is, following Equation (2):
x1-axis: 0.1787 + 0.7132 + 0.2838 + 0.7271 = 0.4757
x2-axis: 0.4814 + 0.8629 + 0.2329 + 0.2468 = 0.4560
The distance of fish 1 from this center is simply to subtract the position of fish 1 from the position of the center:
x1-axis: 0.4757 − 0.2038 = 0.2719
x2-axis: 0.4560 − 0.6760 = −0.2200
This is cohesion. Fish 1 will take a portion of this to make its next move (weighted by a fraction). Now, one can repeat the same process for other fish, and the final result is given below:
Cohesion
x1x2
10.2719−0.2200
20.30330.0232
3−0.3649−0.4536
40.17190.3339
5−0.38220.3164
The alignment is calculated the same way. Instead of position center, now we need to find the center of velocity for every fish. Again, for fish 1, we need to calculate the averages of the coordinates of the other four fish (fish 2~fish 5):
x1-axis: 0.6943 + 0.0372 + 0.9947 + 0.8690 = 0.6488
x2-axis: 0.0557 + 0.9300 + 0.3429 + 0.6400 = 0.4921
and then similarly calculate the difference of the velocity of fish 1 and this center in order to obtain alignment.
x1-axis: 0.6488 − 0.5824 = 0.0664
x2-axis: 0.4921 − 0.6446 = −0.1524
Now we simply repeat the process to calculate the alignment amounts for the other fish, shown in the table below:
Alignment
x1x2
10.0664−0.1524
2−0.07340.5837
30.7479−0.5092
4−0.44900.2247
5−0.2919−0.1467
The last step is the weighted sum up of the two forces to arrive at the total velocity as in Equation (1): v t ( i ) = w A v A , t ( i ) + w C v C , t ( i ) . With the hyperparameters for alignment and cohesion to be 1.5 and 0.8, respectively.
x1-axis: 1.5 × 0.0664 + 0.8 × 0.2719 = 0.3170
x2-axis: 1.5 × (−0.1524) + 0.8 × 0.2200 = −0.4046
Now, we simply repeat the same process for all the other fish and obtain the velocity for all the fish as in Equation (2), listed as follows:
total velocity
x1x2
10.3170−0.4046
20.13250.8941
30.8299−1.1268
4−0.53590.6042
5−0.74360.0331
Adding the velocity to the current position, we obtain the position of the next iteration, as in Equation (3) x t ( i ) = x t 1 ( i ) + v t ( i ) , shown as follows:
position in the next iteration
x1x2
10.52090.2713
20.31121.3755
31.5431−0.2639
4−0.25220.8370
5−0.01650.2800
In our empirical study, we do not use Equation (1) v t ( i ) = w A v A , t ( i ) + w C v C , t ( i ) + w S v S , t ( i ) but rather calculate separation separately. Note that Equation (1) does not guarantee the minimum distance. It is merely a way to incorporate a certain degree of separation. In a Boids example, this is fine. And yet in our work, we do not use actual fish to collide with one another. Separation is activated if a fish is too close to any other fish; otherwise, separation is ignored. We implement separation in the order of fish numbers. That is, we examine if separation is needed for fish 1, then fish 2, and so on. Certainly, if we use a different order, the result will be different. For example, we can randomly select fish for separation (e.g., 3, 4, 2, 1, 5 as opposed to 1, 2, 3, 4, 5).

Appendix B

This appendix derives separate estimation of α P and α L .
Note that, for α P only
v t ( i ) = v P , t ( i )
where
v P , t ( i ) = ( 1 α P , t ( i ) ) u t ( i ) + α P , t ( i ) ( p t ( i ) x t ( i ) ) = u t ( i ) + α P , t ( i ) p t ( i ) x t ( i ) u t ( i )
where p t ( i ) is bird i ’s personal best and g t 1 is the global best. Taking derivative w.r.t. α P ( i ) :
v P , j , t ( i ) α P ( i ) = p j , t ( i ) x j , t ( i ) u j , t ( i )
The objective is to solve for cohesion across all stocks:
α P , t ( i ) j = 1 n ( v j , t ( i ) ν j , t ( i ) ) 2 = j = 1 n 2 ( v j , t ( i ) ν j , t ( i ) ) v j , t ( i ) α P , t ( i ) = 0
Hence, the solution to α P , t ( i ) is:
0 = j = 1 n ( v j , t ( i ) ν j , t ( i ) ) ( p j , t ( i ) x j , t ( i ) u j , t ( i ) ) j = 1 n v j , t ( i ) ( p j , t ( i ) x j , t ( i ) u j , t ( i ) ) = j = 1 n ν j , t ( i ) ( p j , t ( i ) x j , t ( i ) u j , t ( i ) ) j = 1 n ( u j , t ( i ) + α P , t ( i ) ( p j , t ( i ) x j , t ( i ) u j , t ( i ) ) ) ( p j , t ( i ) x j , t ( i ) u j , t ( i ) ) = j = 1 n ν j , t ( i ) ( p j , t ( i ) x j , t ( i ) u j , t ( i ) ) α P , t ( i ) j = 1 n ( p j , t ( i ) x j , t ( i ) u j , t ( i ) ) ( p j , t ( i ) x j , t ( i ) ) = j = 1 n ( ν j , t ( i ) u j , t ( i ) ) ( p j , t ( i ) x j , t ( i ) u j , t ( i ) ) α P , t ( i ) = j = 1 n ( ν j , t ( i ) u j , t ( i ) ) ( p j , t ( i ) x j , t ( i ) u j , t ( i ) ) j = 1 n ( p j , t ( i ) x j , t ( i ) u j , t ( i ) ) 2
Because u j , t ( i ) is random, α P , t ( i ) is random. To calculate E [ α P , t ( i ) ] , we must simulate u j , t ( i ) a number of times.
To estimate α L only,
v t ( i ) = v L , t ( i ) v L , t
where the former is each firm has its own α L , t ( i ) and the latter is all firms share the same α L , t .
In the first case, α L , t ( i ) . Taking derivative w.r.t. α L , t ( i ) :
v j , t ( i ) α L , t ( i ) = g j , t ( i ) x j , t ( i )
Differentiate the objective function with respect to α L , t ( i ) :
α L , t ( i ) j = 1 n ( v j , t ( i ) ν j , t ( i ) ) 2 = j = 1 n 2 ( v j , t ( i ) ν j , t ( i ) ) v j , t ( i ) α L , t ( i ) = 0
The solution to α L , t ( i ) is:
0 = j = 1 n 2 ( v j , t ( i ) ν j , t ( i ) ) ( g j , t 1 x j , t 1 ( i ) ) j = 1 n v j , t ( i ) ( g j , t 1 x j , t 1 ( i ) ) = j = 1 n ν j , t ( i ) ( g j , t 1 x j , t 1 ( i ) ) j = 1 n α L , t ( i ) ( g j , t 1 x j , t 1 ( i ) ) ( g j , t 1 x j , t 1 ( i ) ) = j = 1 n ν j , t 1 ( i ) ( g j , t 1 x j , t 1 ( i ) ) α L , t ( i ) = j = 1 n ν j , t ( i ) ( g j , t 1 x j , t 1 ( i ) ) j = 1 n ( g j , t 1 x j , t 1 ( i ) ) 2
In the second case α L , t .
0 = i = 1 m j = 1 n ( v j , t ( i ) ν j , t ( i ) ) v j , t α L , t i = 1 m j = 1 n v j , t ( i ) v j , t α L , t = i = 1 m j = 1 n ν j , t ( i ) v j , t α L , t i = 1 m j = 1 n α L , t ( g j , t 1 x j , t 1 ( i ) ) ( g j , t 1 x j , t 1 ( i ) ) = i = 1 m j = 1 n ν j , t ( i ) ( g j , t 1 x j , t 1 ( i ) ) α L , t = i = 1 m j = 1 n ν j , t ( i ) ( g j , t 1 x j , t 1 ( i ) ) i = 1 m j = 1 n ( g j , t 1 x j , t 1 ( i ) ) 2
Compare to the average of α L , t ( i ) .

Appendix C

This appendix derives joint estimation of α P and α L .
Now,
v t ( i ) = w v P , t ( i ) + ( 1 w ) v L , t ( i ) α P v t ( i ) = 0 α L v t ( i ) = 0
We have α L
v L , t ( i ) = α L , t ( i ) ( g t 1 x t 1 ( i ) ) v P , t ( i ) = u t ( i ) + α P ( i ) ( p t ( i ) x t 1 ( i ) u t ( i ) ) v P , j , t ( i ) α P , t ( i ) = p j , t ( i ) x j , t ( i ) u j , t ( i ) ; v L , j , t ( i ) α P , t ( i ) = 0
and then α P
v L , t ( i ) = α L , t ( i ) ( g t 1 x t 1 ( i ) ) v P , t ( i ) = u t ( i ) + α P ( i ) ( p t ( i ) x t 1 ( i ) u t ( i ) ) v L , j , t ( i ) α L , t ( i ) = g j , t 1 x j , t 1 ( i ) ; v P , j , t ( i ) α L , t ( i ) = 0
Solving the equation leads to:
α P , t ( i ) j = 1 n [ w v P , j , t ( i ) + ( 1 w ) v L , j , t ( i ) ν j , t ] 2 = j = 1 n 2 [ w v P , j , t ( i ) + ( 1 w ) v L , j , t ( i ) ν j , t ] v P , j , t ( i ) α P , t ( i ) = j = 1 n 2 [ w v P , j , t ( i ) + ( 1 w ) v L , j , t ( i ) ν j , t ] [ p j , t ( i ) x j , t ( i ) u j , t ( i ) ] = 0
and
α L , t ( i ) j = 1 n [ w v P , j , t ( i ) + ( 1 w ) v L , j , t ( i ) ν j , t ] 2 = j = 1 n 2 [ w v P , j , t ( i ) + ( 1 w ) v L , j , t ( i ) ν j , t ] v L , j , t ( i ) α L , t ( i ) = j = 1 n 2 [ w v P , j , t ( i ) + ( 1 w ) v L , j , t ( i ) ν j , t ] [ g j , t 1 x j , t 1 ( i ) ] = 0
Let z j , t ( i ) = p j , t ( i ) x j , t ( i ) u j , t ( i ) (to simplify notation). Then, we can set up the first equation as:
( 1 ) j = 1 n w u j , t ( i ) z j , t ( i ) + w α P , t ( i ) ( z j , t ( i ) ) 2 + ( 1 w ) v L , j , t ( i ) z j , t ( i ) ν j , t z j , t ( i ) = 0
Expanding the equation, we have:
w α P , t ( i ) j = 1 n ( z j , t ( i ) ) 2 = j = 1 n ν j , t z j , t ( i ) w u j , t ( i ) z j , t ( i ) ( 1 w ) v L , j , t ( i ) z j , t ( i )
From which we can then solve for the parameter α P , t ( i ) as follows:
α P , t ( i ) = j = 1 n ν j , t z j , t ( i ) w u j , t ( i ) z j , t ( i ) ( 1 w ) v L , j , t ( i ) z j , t ( i ) w j = 1 n ( z j , t ( i ) ) 2
where
z j , t ( i ) = p j , t ( i ) x j , t ( i ) u j , t ( i )
Now, we can set up the second equation as follows:
( 2 ) j = 1 n [ w v P , j , t ( i ) + ( 1 w ) α L , t ( i ) ( g t 1 x t 1 ( i ) ) ν j , t ] ( g j , t 1 x j , t 1 ( i ) ) = 0
Similarly, we can expand it and get:
j = 1 n ( 1 w ) α L , t ( i ) ( g j , t 1 x j , t 1 ( i ) ) ( g j , t 1 x j , t 1 ( i ) ) = j = 1 n [ ν j , t w v P , j , t ( i ) ] ( g j , t 1 x j , t 1 ( i ) )
Solving for α L , t ( i ) to get:
α L , t ( i ) = j = 1 n ( ν j , t w ( u j , t ( i ) + α P ( i ) ( p j , t ( i ) x j , t ( i ) u j , t ( i ) ) ) ) ( g j , t 1 x j , t 1 ( i ) ) ( 1 w ) j = 1 n ( g t 1 x t 1 ( i ) ) 2
Putting (1) and (2) together, we then solve for both parameters simultaneously as follows:
α P , t ( i ) = j = 1 n ν j , t ( p j , t ( i ) x j , t ( i ) ) ( 1 w ) α L , t ( i ) ( g j , t 1 x j , t 1 ( i ) ) ( p j , t ( i ) x j , t ( i ) ) w j = 1 n ( z j , t ( i ) ) 2     = j = 1 n ν j , t ( p j , t ( i ) x j , t ( i ) ) w j = 1 n ( p j , t ( i ) x j , t ( i ) ) 2 α L , t ( i ) ( 1 w ) j = 1 n ( g j , t 1 x j , t 1 ( i ) ) ( p j , t ( i ) x j , t ( i ) ) w j = 1 n ( p j , t ( i ) x j , t ( i ) ) 2     = π 1 π 2 α L , t ( i )
and
α L , t ( i ) = j = 1 n ( ν j , t w α P ( i ) ( p j , t ( i ) x j , t ( i ) ) ) ( g j , t 1 x j , t 1 ( i ) ) ( 1 w ) j = 1 n ( g j , t 1 x j , t 1 ( i ) ) 2     = j = 1 n ν j , t ( g j , t 1 x j , t 1 ( i ) ) ( 1 w ) j = 1 n ( g j , t 1 x j , t 1 ( i ) ) 2 α P ( i ) w j = 1 n ( p j , t ( i ) x j , t ( i ) ) ( g j , t 1 x j , t 1 ( i ) ) ( 1 w ) j = 1 n ( g j , t 1 x j , t 1 ( i ) ) 2     = ρ 1 ρ 2 α P ( i )
Finally,
α L , t ( i ) = ρ 1 ρ 2 π 1 1 ρ 2 π 2 α P , t ( i ) = π 1 π 2 ρ 1 1 π 2 ρ 2

Appendix D

This appendix derives estimation of alignment, cohesion and separation. Rewrite (1) slightly as follows
v t ( i ) = w A , t v A , t ( i ) + w C , t v C , t ( i ) + ( 1 w A , t w C , t ) v S , t ( i )     = w A , t v A , t ( i ) v S , t ( i ) + w C , t v C , t ( i ) v S , t ( i ) + v S , t ( i )       = w A , t A t ( i ) + w C , t C t ( i ) + S t ( i )
Then we follow (11) and take partial derivatives with respect to alignment w A and cohesion w C parameters respectively.
j = 1 n 2 ( v j , t ( i ) ν j , t ( i ) ) v A , j , t ( i ) w A , t = 0 j = 1 n 2 ( v j , t ( i ) ν j , t ( i ) ) v C , j , t ( i ) w C , t = 0
This leads to the following simultaneous equation system:
j = 1 n A j , t ( i ) 2 j = 1 n A j , t ( i ) C j , t ( i ) j = 1 n A j , t ( i ) C j , t ( i ) j = 1 n C j , t ( i ) 2 w A , t w C , t = j = 1 n ν j , t ( i ) A j , t ( i ) j = 1 n A j , t ( i ) S j , t ( i ) j = 1 n ν j , t ( i ) C j , t ( i ) j = 1 n A j , t ( i ) S j , t ( i )
and the solution is:
w A , t w C , t = j = 1 n A j , t ( i ) 2 j = 1 n A j , t ( i ) C j , t ( i ) j = 1 n A j , t ( i ) C j , t ( i ) j = 1 n C j , t ( i ) 2 1 j = 1 n ν j , t ( i ) A j , t ( i ) j = 1 n A j , t ( i ) S j , t ( i ) j = 1 n ν j , t ( i ) C j , t ( i ) j = 1 n A j , t ( i ) S j , t ( i ) = x 11 x 12 x 12 x 22 1 y 1 y 2 = 1 x 11 x 22 x 12 2 x 22 x 12 x 12 x 11 y 1 y 2
We also estimate another setup of the model where both alignment and cohesion weights are equal, i.e., w A , t ( i ) = w C , t ( i ) = w t ( i ) , as follows:
min j = 1 n ( v j , t ( i ) ν j , t ( i ) ) 2 j = 1 n 2 ( v j , t ( i ) ν j , t ( i ) ) v j , t ( i ) w t = 0 j = 1 n v j , t ( i ) v j , t ( i ) w t = ν j , t ( i ) v j , t ( i ) w t j = 1 n ( w t ( v S , j , t ( i ) v A , j , t ( i ) v C , j , t ( i ) ) + v A , j , t ( i ) + v C , j , t ( i ) ) ( v S , j , t ( i ) v A , j , t ( i ) v C , j , t ( i ) ) = j = 1 n ν j , t ( i ) ( v S , j , t ( i ) v A , j , t ( i ) v C , j , t ( i ) ) w t ( i ) j = 1 n ( v S , j , t ( i ) v A , j , t ( i ) v C , j , t ( i ) ) ( v S , j , t ( i ) v A , j , t ( i ) v C , j , t ( i ) ) = j = 1 n ( ν j , t ( i ) v A , j , t ( i ) v C , j , t ( i ) ) ( v S , j , t ( i ) v A , j , t ( i ) v C , j , t ( i ) ) w t ( i ) = j = 1 n ( ν j , t ( i ) v A , j , t ( i ) v C , j , t ( i ) ) ( v S , j , t ( i ) v A , j , t ( i ) v C , j , t ( i ) ) j = 1 n ( v S , j , t ( i ) v A , j , t ( i ) v C , j , t ( i ) ) 2
Since v S , j , t ( i ) is random, w t ( i ) is random. Take expectation
E [ w t ] j = 1 n ( ν j , t ( i ) v A , j , t ( i ) v C , j , t ( i ) ) ( c v A , j , t ( i ) v C , j , t ( i ) ) j = 1 n ( c v A , j , t ( i ) v C , j , t ( i ) ) 2 = j = 1 n ( ν j , t ( i ) v A , j , t ( i ) v C , j , t ( i ) ) ( v A , j , t ( i ) v C , j , t ( i ) ) j = 1 n ( v A , j , t ( i ) v C , j , t ( i ) ) 2
Lastly (This result is not presented in the paper but can be available upon request), we can estimate alignment and cohesion without separation as follows:
v t ( i ) = w t ( i ) v A , t ( i ) + ( 1 w t ( i ) ) v C , t ( i )
The solution is:
j = 1 n 2 ( v j , t ( i ) ν j , t ( i ) ) v j , t ( i ) w t = 0 j = 1 n v j , t ( i ) v j , t ( i ) w t = ν j , t ( i ) v j , t ( i ) w t j = 1 n ( w t ( v A , j , t ( i ) v C , j , t ( i ) ) + v C , j , t ( i ) ) ( v A , j , t ( i ) v C , j , t ( i ) ) = j = 1 n ν j , t ( i ) ( v A , j , t ( i ) v C , j , t ( i ) ) 0.3 w t ( i ) j = 1 n ( v A , j , t ( i ) C , j , t ( i ) ) ( v A , j , t ( i ) v C , j , t ( i ) ) = j = 1 n ( ν j , t ( i ) C , j , t ( i ) ) ( v A , j , t ( i ) v C , j , t ( i ) ) w t ( i ) = j = 1 n ( ν j , t ( i ) v C , j , t ( i ) ) ( v A , j , t ( i ) v C , j , t ( i ) ) j = 1 n ( v A , j , t ( i ) v C , j , t ( i ) ) 2

References

  1. Mavruk, T. Analysis of Herding Behavior in Individual Investor Portfolios using Machine Learning Algorithms. Res. Int. Bus. Financ. 2022, 62, 101740. [Google Scholar] [CrossRef]
  2. Ukpong, I.; Tan, H.; Yarovaya, L. Determinants of industry herding in the US stock market. Financ. Res. Lett. 2021, 43, 101953. [Google Scholar] [CrossRef]
  3. Rahayu, A.D.; Putra, A.; Oktaverina, C.; Ningtyas, R.A. Herding Behavior in The Stock Market: A Literature Review. Int. J. Soc. Sci. Rev. 2020, 1, 8–25. [Google Scholar]
  4. Bikhchandani, S.; Sunil, S. Herd Behavior in Financial Markets. IMF Staff. Pap. 2001, 47, 279–310. [Google Scholar] [CrossRef]
  5. Shiller, R. Stock Prices and Social Dynamics. Brook. Pap. Econ. Act. 1984, 15, 457–510. [Google Scholar] [CrossRef]
  6. Lakonishok, J.; Shleifer, A.; Vishny, R.W. The Impact of Institutional Trading on Stock Prices. J. Financ. Econ. 1992, 32, 23–43. [Google Scholar] [CrossRef]
  7. Jegadeesh, N.; Titman, S. Returns to Buying Winners and Selling Losers: Implications for Stock Market Efficiency. J. Financ. 1993, 48, 65–91. [Google Scholar] [CrossRef]
  8. Jegadeesh, N.; Titman, S. Momentum: Evidence and insights 30 years later. Pac.-Basin Financ. J. 2023, 82, 102202. [Google Scholar] [CrossRef]
  9. Grinblatt, M.; Titman, S.; Wermers, R. Momentum investment strategies, portfolio performance, and herding: A study of mutual fund behavior. Am. Econ. Rev. 1995, 85, 1088–1105. [Google Scholar]
  10. Demirer, R.; Lien, D.; Zhang, H. Industry herding and momentum strategies. Pac.-Basin Financ. J. 2015, 32, 95–110. [Google Scholar] [CrossRef]
  11. Lin, Z.; Wu, W.; Zhang, H. Momentum, Information, and Herding. J. Behav. Financ. 2023, 24, 219–237. [Google Scholar] [CrossRef]
  12. Chen, T. Does Country Matter to Investor Herding? Evidence from an Intraday Analysis. J. Behav. Financ. 2020, 22, 56–64. [Google Scholar] [CrossRef]
  13. Reynolds, C. Flocks, herds and schools: A distributed behavioral model. In Proceedings of the 14th Annual Conference on Computer Graphics and Interactive Techniques, Association for Computing Machinery, Anaheim, CA, USA, 27–31 July 1987; pp. 25–34. [Google Scholar]
  14. Eberhart, R.C.; Kennedy, J. A New Optimizer Using Particle Swarm Theory. In Proceedings of the Sixth International Symposium on Micro Machine and Human Science, Nagoya, Japan, 4–6 December 1995. [Google Scholar]
  15. Shi, Y.; Eberhart, R.C. A Modified Particle Swarm Optimizer. In Proceedings of the IEEE International Conference on Evolutionary Computation, Anchorage, AK, USA, 4–9 May 1998; pp. 69–73. [Google Scholar]
  16. Chen, R.-R. Index Tracking: A Stock Selection Model using Particle Swarm Optimization. J. Investig. 2023, 32, 53–73. [Google Scholar] [CrossRef]
  17. Chen, R.-R.; Miller, C.D.; Toh, P.K. Modeling Firm Search and Innovation Trajectory Using Swarm Intelligence. Algorithms 2023, 16, 72. [Google Scholar] [CrossRef]
  18. Chen, R.-R.; Miller, C.; Toh, P.K. Search on a NK Landscape with Swarm Intelligence: Limitations and Future Research Opportunities. Algorithms 2023, 16, 527. [Google Scholar] [CrossRef]
  19. Chen, R.-R.; Huang, K.; Yeh, S.-K. Particle Swarm Optimization Approach to Portfolio Construction. Intell. Syst. Account. Financ. Manag. 2021, 28, 182–194. [Google Scholar] [CrossRef]
  20. Chen, R.-R.; Behrndt, T. A New Look at the Swing Contract: From Linear Programming to Particle Swarm Optimization. J. Risk Financ. Manag. 2022, 15, 246. [Google Scholar]
  21. Chen, R.-R.; Huang, W.; Huang, J.; Yu, R. An Artificial Intelligence Approach to the Valuation of American-style Derivatives: A Use of Particle Swarm Optimization. J. Risk Financ. Manag. 2021, 14, 57. [Google Scholar] [CrossRef]
  22. Huang, K. Particle Swarm Optimization Central Mass on Portfolio Construction; Gabelli School of Business, Fordham University: Bronx, NY, USA, 2019. [Google Scholar]
  23. Waggle, D.; Agrrawal, P. Is the “sell in May and go away” adage the result of an election-year effect? Manag. Financ. 2018, 44, 1070–1082. [Google Scholar] [CrossRef]
Figure 1. Swarm Intelligence (source: https://en.wikipedia.org/wiki/Boids, accessed on 28 October 2024). The green triangle is the target fish, while the blue triangles are its neighbors. The circle defines how far the target fish makes its references. Lines (within the circle) show how the target fish is connected to its neighbors. The red arrow then is the final vector the target fish will move.
Figure 1. Swarm Intelligence (source: https://en.wikipedia.org/wiki/Boids, accessed on 28 October 2024). The green triangle is the target fish, while the blue triangles are its neighbors. The circle defines how far the target fish makes its references. Lines (within the circle) show how the target fish is connected to its neighbors. The red arrow then is the final vector the target fish will move.
Information 15 00707 g001
Figure 3. Stock Weights (excluding TSMC #2330).
Figure 3. Stock Weights (excluding TSMC #2330).
Information 15 00707 g003
Figure 4. Daily Trading Share and Dollar Volumes of 2019 (223 days).
Figure 4. Daily Trading Share and Dollar Volumes of 2019 (223 days).
Information 15 00707 g004
Figure 5. Time Series of Alignment and Cohesion weights (median).
Figure 5. Time Series of Alignment and Cohesion weights (median).
Information 15 00707 g005aInformation 15 00707 g005b
Figure 6. Time Series of Alignment Weights w A (note: Each result is the mean/median across 75 brokers/dealers).
Figure 6. Time Series of Alignment Weights w A (note: Each result is the mean/median across 75 brokers/dealers).
Information 15 00707 g006aInformation 15 00707 g006b
Figure 7. Alignment Weight w A of 75 Brokers/Dealers.
Figure 7. Alignment Weight w A of 75 Brokers/Dealers.
Information 15 00707 g007aInformation 15 00707 g007b
Figure 8. Flow Chart of Various Tests of PSO.
Figure 8. Flow Chart of Various Tests of PSO.
Information 15 00707 g008
Figure 9. Joint α L and α P Estimates w α L + ( 1 w ) α P (average across time).
Figure 9. Joint α L and α P Estimates w α L + ( 1 w ) α P (average across time).
Information 15 00707 g009aInformation 15 00707 g009b
Figure 10. Swarm Intelligence (source: https://en.wikipedia.org/wiki/Boids).
Figure 10. Swarm Intelligence (source: https://en.wikipedia.org/wiki/Boids).
Information 15 00707 g010aInformation 15 00707 g010bInformation 15 00707 g010c
Table 1. Trading Volume of the Top 20 Firms in TSE.
Table 1. Trading Volume of the Top 20 Firms in TSE.
RankTickerNameNameShare wtDollar wtIndustryIndustry
12330台積電TSMC5.31%0.59%semi-conductor半導體
23406玉晶光Genius Electronic Optical2.70%0.20%photoelectric光電
32317鴻海Hon Hai Precision1.98%0.72%other electronics其他電子
42327國巨Yageo Electronics1.95%0.18%electronics電子零組件
53008大立光Largan Precision1.90%0.01%photoelectric光電
62454聯發科MediaTek1.75%0.15%semi-conductor半導體
73150穩懋WIN Semiconductors1.70%0.22%semi-conductor半導體
82492華新科Walsin Technology1.66%2.92%electronic parts電子零組件
96488環球晶Global Wafer Corporation1.50%0.24%semi-conductor半導體
102337旺宏Macronix1.45%0.13%semi-conductor半導體
116462神盾Egis Technology1.03%1.07%semi-conductor半導體
122023欣興Unimicron1.02%0.13%electronic parts電子零組件
133034聯詠Novatek Microelectronics0.99%0.80%semi-conductor半導體
142474可成Catcher Technology0.88%0.14%other electronics其他電子
152408南亞科Nanya Technology0.84%0.10%semi-conductor半導體
163324雙鴻Auras Technology0.81%0.55%other electronics其他電子
172308台達電Delta Electronics0.79%0.34%electronic parts電子零組件
182345智邦Accton Technology0.76%0.14%Telecommunication通信網路
192313華通Compeq Manufacturing0.65%0.13%electronic parts電子零組件
202379瑞昱Realtek0.64%0.13%semi-conductor半導體
Table 2. Market Caps of the Top 20 Firms in TSE.
Table 2. Market Caps of the Top 20 Firms in TSE.
RankTickerNameNameWeightIndustryIndustry
12330台積電TSMC26.58%semi-conductor半導體
22317鴻海Hon Hai Precision2.83%other electronics其他電子
32454聯發科MediaTek2.30%semi-conductor半導體
42382廣達Quanta Group1.81%computer電腦週邊
52412中華電China Telecom1.76%telecom通訊網路
62308台達電Delta Electronics1.65%electronic parts電子零組件
72881富邦金Fubon Financial1.55%financial金融業
86505台塑化Formosa Petrochemical1.50%energy油電燃氣
92882國泰金Cathay Financial1.28%financial金融業
102303聯電United Microelectronics1.11%semi-conductor半導體
112886兆豐金Mega Financial1.04%financial金融業
121303南亞Nan Ya Plastics1.04%plastic塑膠
131301台塑Formosa Plastics1.00%plastic塑膠
142891中信金China Trust0.94%financial金融業
153711日月光投控ASE Technology0.94%semi-conductor半導體
161216統一Uni-President Enterprises0.78%food食品
172002中鋼China Steel0.78%steel鋼鐵
182884玉山金E.sun Financial0.74%financial金融業
195880合庫金Taiwan Cooperative Financial0.74%financial金融業
202207和泰車Hotai Motor0.72%auto汽車
Table 3. List of all Brokers/Dealers in Taiwan.
Table 3. List of all Brokers/Dealers in Taiwan.
1合庫Taiwan Coop Bank26新百王NHK Securities51華南永昌Hua Nan Sec’s
2土銀Land Bank27光和Kuanz Ho Sec’s52富邦Fuban Bank
3臺銀證券Bank Taiwan Sec’s28永全Yun Chuan Sec’s *53元大Yuanta Comm Bank
4臺銀Bank of Taiwan29大昌Dah Chang Sec’s54永豐金SinoPac Sec’s
5台灣企銀Taiwan Bsns Bank30德信Reliance Sec’s55日進J Zin Sec’s
6臺灣企銀Taiwan Bsns Bank31福勝Fushan Sec’s56聯邦商銀Union Bank
7日盛Jih Sun Bank32兆豐Mega Int’l Bank57奔亞證券Primasia Sec’s
8彰銀Chang Hwa Bank33致和Z Ho Securities *58台灣匯立Hui Li Sec’s *
9宏遠Horizon Securities34豐農Feng Nun Sec’s *59美林Merrill Lynch
10港商麥格理Macquarie Group35石橋Bridge Stone Sec’s *60港商野村Nomura Sec’s
11台灣摩根士丹利Morgan Stanley36金港Kovack Securities61富隆Fullong Sec’s
12亞東Oriental Securities37北城Pei Cheng Sec’s62寶盛Monex Boom Sec’s
13大展Tachan Securities38國票Waterland Sec’s63福邦Grand Fortune Sec’s
14大慶Ta Ching Sec’s39台新Taishin Int’l Bank64萬泰KGI Bank
15高橋Mizuho Securities40安泰Entie Comm Bank65中農Chung Nourn Sec’s
16第一金First Financial41摩根大通JP Morgan66全泰Chuan Tai Sec’s *
17永興YS Securities42康和Concord Int’l Sec’s67瑞士信貸Credit Swiss
18統一President Sec’s43新光Shin Kong Bank68大鼎Da-Din Securities
19盈溢I Win Securities44聯邦Union Securities69美商高盛Goldman Sachs
20光隆Kuang Long Sec’s45陽信Sunny Securities70港商德意志Dueche Bank
21元富Masterlink Sec’s46玉山E.SUN Comm Bank71港商法國興業Société Générale
22日茂Jee Mach Sec’s47國泰Cathay Securities72花旗環球Citi Bank
23奔亞Primasia Sec’s48大和國泰Daiwa Cathay Sec’s73新加坡商瑞銀Swiss Bank
24台中銀Taichung Comm Bank49群益金鼎Capital Sec’s74法銀巴黎Bank
25中國信託China Trust50凱基KGI Securities75香港上海匯豐HSBC
* translated (phonetically) by author.
Table 4. Correlation Between Alignment, Cohesion and General Volume.
Table 4. Correlation Between Alignment, Cohesion and General Volume.
Buy
Share
Sell
Share
Buy
Dollar
Sell
Dollar
alignment12.30%24.93%1.30%25.82%
p value0.10270.03070.43200.0287
cohesion−23.27%−22.92%−22.75%−22.36%
p value0.03510.03610.03660.0378
Table 5. Top 20 Highest Cohesion Brokers/Dealers.
Table 5. Top 20 Highest Cohesion Brokers/Dealers.
Share BoughtShare SoldDollar BoughtDollar Sold
16163934
56564256
35342219
3436816
36357233
18317017
719120
65651418
1918196
33175136
2333365
2021314
31207372
5471631
1754357
3012430
12715650
7130212
5165251
14503035
Table 6. Summary Statistics of Swarm Parameters.
Table 6. Summary Statistics of Swarm Parameters.
(A) α L , t ( i )
(5)(1)(4)(7)(3)(2)(6)
min−1.1039−6.2376−0.4679−1.1039−6.2376−0.4633−0.4679
max2.07281.64161.23202.07281.64160.03791.2320
avg−0.4001−0.6777−0.0739−0.4001−0.6777−0.0568−0.0739
std0.39360.49200.17920.39360.49200.06420.1792
med−0.4573−0.6897−0.0968−0.4573−0.6897−0.0428−0.0968
(B) α P , t ( i )
(5)(1)(4)(7)(3)(2)(6)
min−2.4921−2.0772−2.0000−2.4921−2.0772−3.3800−2.0000
max0.00000.00005.59250.00000.00002.51149.5754
avg−0.6893−0.4554−0.6372−0.6893−0.4554−0.6572−0.5466
std0.28970.19920.73220.28970.19920.52871.0786
med−0.6413−0.4340−0.7388−0.6413−0.4340−0.7256−0.7542
Table 7. Separation Estimation of α L , t ( i ) and α P , t ( i ) .
Table 7. Separation Estimation of α L , t ( i ) and α P , t ( i ) .
(A) α L , t ( i ) 75 Brokers Under Various Scenarios ( α L only)
(5)(1)(4)(7)(3)(2)(6)
min−0.7659−0.7500−0.4550−0.7659−0.7500−0.3874−0.2692
max0.71990.33770.27410.71990.33770.00540.0471
avg−0.4598−0.5109−0.0940−0.4598−0.5109−0.0391−0.0106
std0.21060.15710.15330.21060.15710.08600.0444
med−0.5148−0.5266−0.0121−0.5148−0.5266−0.00170.0000
(B) α P , t ( i ) 75 Brokers Under Various Scenarios ( α L only)
(5)(1)(4)(7)(3)(2)(6)
min−0.7022−0.6947−0.8377−0.7022−0.6947−0.9061−0.8377
max−0.1680−0.02720.7602−0.1680−0.0272−0.05990.7602
avg−0.4603−0.4213−0.3849−0.4603−0.4213−0.3822−0.3849
std0.11960.13350.23760.11960.13350.15940.2376
med−0.4799−0.4422−0.3979−0.4799−0.4422−0.3932−0.3979
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Chen, R.-R. Is the Taiwan Stock Market (Swarm) Intelligent? Information 2024, 15, 707. https://doi.org/10.3390/info15110707

AMA Style

Chen R-R. Is the Taiwan Stock Market (Swarm) Intelligent? Information. 2024; 15(11):707. https://doi.org/10.3390/info15110707

Chicago/Turabian Style

Chen, Ren-Raw. 2024. "Is the Taiwan Stock Market (Swarm) Intelligent?" Information 15, no. 11: 707. https://doi.org/10.3390/info15110707

APA Style

Chen, R. -R. (2024). Is the Taiwan Stock Market (Swarm) Intelligent? Information, 15(11), 707. https://doi.org/10.3390/info15110707

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop