Gadjah Mada International Journal of Business Vol. 27, No. 3 (September-December 2025): 297-319 Machine Learning vs. Human Investors: Analyzing Adaptive Herding Behavior in U.S. Stocks vs. Shariah-Compliant Stocks in Malaysia and Indonesia Kok Loang Ooia*, Sevenpri Candrab a Universiti Malaya, Malaysia b BINUS University, Indonesia Abstract: This study examined the effectiveness of machine learning models in capturing adaptive herding behavior in the U.S., Malaysia, and Indonesia. Utilizing data from January 2010 to December 2023, the study incorporates market sentiment (Thomson Reuters MarketPsych indices), news sentiment (Bloomberg sentiment analysis), and investor happiness measures (Hedonometer). The methodology employs both static and adaptive herding analyses using the CSAD approach, enhanced by real-time sentiment analysis and various machine learning models, including single- and multi-layer neural networks. The results indicate significant differences in herding behavior across the three markets, with machine learning models demonstrating superior performance in capturing herding behavior and faster normalization after major macroeconomic events than traditional methods. These findings highlight the potential of machine learning models to challenge the static assumptions of the efficient market hypothesis and provide insights for designing better trading algorithms by considering the impact of market sentiment, news sentiment, and investor happiness. Keywords: machine learning, adaptive herding, market sentiment, financial stability, stock returns JEL Classification: G02, G11, G14, G15 *Corresponding author’s e-mail: markooi@um.edu.my ISSN: PRINT 1411-1128 | ONLINE 2338-7238 https://journal.ugm.ac.id/gamaijb 297 Gadjah Mada International Journal of Business - September-December, Vol. 27, No. 3, 2025 Introduction Herding behavior, a well-documented phenomenon in financial markets (Bikhchandani et al., 1992), occurs when investors mimic the trades of others rather than rely on their own information or analysis. This behavior can lead to significant market inefficiencies, contributing to the formation of bubbles and subsequent crashes. Traditional studies have primarily focused on static measures of herding that do not account for the dynamic nature of financial markets (Chang et al., 2000). Static herding assumes constant behavior over time, ignoring the evolving nature of market sentiment and external information. By contrast, adaptive herding captures the changing nature of investor behavior in response to market conditions, sentiment, and external information. Despite its importance, adaptive herding is underexplored, primarily because of the complexity and computational intensity required for real-time sentiment analysis and the integration of dynamic variables, such as market sentiment, news sentiment, and investors' happiness (Choi & Park, 2023; Hwang & Salmon, 2004). Machine learning (ML) offers several advantages for studying herding behavior and stock market performance. ML algorithms can process vast amounts of data and uncover patterns that may not be apparent using traditional statistical methods (Henrique et al., 2019). Moreover, ML models can enhance the accuracy of stock price predictions by incorporating a wide range of variables, including technical indicators, sentiment scores, and macroeconomic factors (Amanda & Pradipta, 2024; Bollen et al., 2011; Gao et al., 2024; Tetlock, 2007). A fundamental assumption is that machine learning models, being purely algorithmic, should not exhibit behavioral biases. However, the data used to train these models often reflect human behaviors and biases, raising questions about whether ML models can exhibit herding behavior similar to that of human investors (Feng et al., 2019). If machine learning can eliminate these behavioral biases, it could potentially offer a more reliable and unbiased approach to trading, outperforming human investors, who are prone to irrational herding (Zhang et al., 2011). While ML models have shown promise in stock prediction, their efficacy in down markets remains uncertain. Downward markets present unique challenges that existing ML models may not fully capture, necessitating further investigation into their performance under these conditions (Bihari et al., 2025; Henrique et al., 2019; Kumbure et al., 2022; Soni et al., 2022). Additionally, there is a significant gap in understanding how algorithmic trading systems interact with herding dynamics, particularly adaptive herding, which is affected by market sentiment and news. While behavioral finance extensively examines human biases, the potential of machine learning models to replicate or mitigate these biases remains underexplored (Barberis & Thaler, 2003). Herding and investor performance are affected by market efficiency, as explained by the efficient market hypothesis (EMH). According to EMH, markets are efficient if asset prices fully reflect all available information (Fama, 1970). However, the level of information efficiency can vary significantly between markets, which in turn affects the presence and nature of herding behavior. Developed markets, such as the United States, typically exhibit high levels of information efficiency and robust regulatory frameworks, ensuring that information is quickly and accurately reflected in asset prices. In contrast, developing markets, such as Malaysia and Indonesia, are characterized by rapid economic growth, evolving regulatory environments, and diverse investor compositions, which can lead to information inefficiencies (Bollen et al., 2011; Gao et al., 2024; Oliveira et al., 2016; 298 Ooi & Candra Tetlock, 2007). Although herding behavior has been extensively investigated across developed and emerging markets (Bikhchandani et al., 1992; Chang et al., 2000; Chiang and Zheng, 2010; Mahadwartha et al., 2023), there remains a paucity of empirical research on how ethical investment principles, particularly those underpinning Shariah-compliant equities, shape such behavior within different market structures. Shariah-compliant stocks, which constitute a significant portion of publicly listed firms in Malaysia and Indonesia, are governed by Islamic financial principles that prohibit excessive leverage, interest-based transactions (riba), and speculative activities (gharar), thereby imposing a unique layer of ethical and financial discipline (Medhioub and Chaffai, 2019; Aziz et al., 2022; Nugroho & Pratiwi, 2023). Prior studies suggest that these constraints may mitigate irrational investor behavior, reducing the propensity for speculative herding (Loang and Ahmad, 2022; Maulida and Sari, 2023). However, the dual governance model of conventional regulation alongside Shariah oversight may introduce distinct behavioral dynamics that are not observable in conventional equity markets. Despite the growing prominence of Islamic finance, limited attention has been paid to whether these structural and normative differences influence investor herding, particularly during periods of heightened market uncertainty. These differences in market efficiency necessitate a detailed examination of how herding behavior manifests across various economic contexts. Moreover, understanding the role of adaptive herding requires analyzing dynamic variables, such as market sentiment, news sentiment, and investor happiness (Gopal & Loang, 2024). Existing literature has largely focused on static herding measures, leaving a gap in comprehensive studies that incorporate real-time sentiment analysis (Chang et al., 2000; Chiang & Zheng, 2010). Additionally, there is a need to explore whether machine learning models can effectively capture and predict these adaptive behaviors, particularly during market downturns when traditional models may falter (Henrique et al., 2019; Kliegr et al., 2021; Kumbure et al., 2022; Soni et al., 2022). The potential of machine learning to eliminate behavioral biases and outperform human investors presents another critical gap, as current studies have yet to fully explore this capability (Athota et al., 2023; Feng et al., 2019; Soni et al., 2022). This study investigates adaptive herding and machine learning models' stock return predictions during down markets. Three markets—the U.S., a mature market; Malaysia, a developing market with unique regulatory and market characteristics; and Indonesia, a rapidly increasing emerging market—are studied. This study measures herding behavior in these markets and the impact of adaptive herding on market dynamics using the Thomson Reuters MarketPsych indices for market sentiment, the Bloomberg sentiment analysis for news sentiment, and the Hedonometer for Twitter feed data on investor happiness. This study could reveal algorithmic trading system capabilities and limitations. Literature Review The EMH, introduced by Fama (1970), posits that asset prices reflect all available information, making it impossible to consistently outperform the market through stock selection or timing. While the EMH has been extensively validated in developed markets such as the United States, emerging markets such as Malaysia and Indonesia often display deviations due to less stringent regulatory frameworks and slower information dissemination. Recent developments have challenged the static nature of the EMH. Lo (2004) proposes 299 Gadjah Mada International Journal of Business - September-December, Vol. 27, No. 3, 2025 the adaptive market hypothesis, suggesting that market efficiency evolves with changing market environments, supported by empirical evidence from Noda, (2016) and Urquhart & McGroarty (2016), indicating fluctuating market efficiency over time and conditions. Machine learning has emerged as a transformative tool in financial market analysis, capable of processing vast amounts of data and identifying patterns that traditional statistical methods may overlook. Fischer and Krauss (2018) demonstrate that ML models, including neural networks and support vector machines, outperform conventional models in predicting stock prices and managing financial risks. Gu et al. (2020) apply ML techniques to financial econometrics, showcasing improved predictive accuracy in asset pricing, while Krauss et al. (2017) use ML to detect financial misstatements, highlighting ML's potential to enhance understanding of financial anomalies and market behaviors. However, the application of ML in assessing market efficiency and predicting market downturns remains underexplored, particularly in emerging markets. The sentiment analysis further enhanced the predictive power of the ML models. By incorporating textual data from news articles, social media, and financial reports, sentiment analysis provides a more comprehensive understanding of market sentiment and its impact on asset prices (Loang, 2025). Oliveira et al. (2016) illustrate that integrating social media sentiment into ML models improves market predictions. Similarly, previous studies (Hu et al., 2021; Schmeling, 2009; Tetlock, 2007) demonstrate that combining news sentiment with traditional financial indicators significantly enhances the accuracy of stock market forecasts. Additionally, Zhang et al. (2011) use sentiment analysis of financial news to predict market volatility, further highlighting the importance of real-time data in financial predictions. Nevertheless, most existing research focuses on static models, lacking comprehensive studies that leverage real-time data to dynamically understand market efficiency. This gap is critical, as dynamic factors, such as market sentiment and news sentiment, significantly impact market movements. Although ML models have advanced the accuracy of financial forecasting, their performance during market downturns remains uncertain, particularly in contexts where behavioral biases such as herding are more pronounced (Dantas and Cyrino Oliveira, 2018; Kumbure et al., 2022; Tsai and Hsiao, 2010). While behavioral finance has extensively explored human-driven herding, it is less clear whether ML systems trained on human data replicate or correct these patterns (Kliegr et al., 2021). Furthermore, most ML applications have been developed in developed markets like the U.S., with limited testing in emerging or ethically constrained environments (Zakamulin and Giner, 2020). In markets such as Malaysia and Indonesia, where Shariah-compliant stocks must adhere to both conventional regulations and Islamic ethical criteria, investor behavior may differ significantly due to stricter screening, long-term orientation, and reduced speculative trading (Medhioub and Chaffai, 2019; Aziz et al., 2022; Loang and Ahmad, 2022). Given these institutional and behavioral differences, it is plausible that herding dynamics in Shariah-compliant stocks diverge from those in mature markets. H1: There is a significant difference in herding behavior between U.S. stocks and Shariah-compliant stocks in Malaysia and Indonesia, with herding being more pronounced in Shariah-compliant stocks due to market inefficiencies and lower regulatory stringency. H2: Machine learning models exhibit superior performance in predicting herding behavior compared to traditional statistical models, particularly during market downturns. 300 Ooi & Candra Herding behavior in financial markets, where investors mimic the trades of others rather than rely on their own analysis, is well documented (Bikhchandani et al., 1992). Traditional studies often employ static measures of herding, which fail to account for the dynamic nature of investor behavior and market conditions (Chang et al., 2000). On the other hand, adaptive herding considers changes in investor behavior in response to evolving market conditions and external information (Gopal & Loang, 2024). Hwang and Salmon (2004) highlight the importance of adaptive herding, showing that it provides a more accurate representation of market movements by incorporating real-time sentiment analysis and other dynamic variables. Recent studies have further confirmed the significance of adaptive herding, especially during periods of market stress, such as the COVID-19 pandemic, in which herding behaviors intensified in both developed and emerging markets (Mnif et al., 2020; Omane-Adjepong et al., 2021; Youssef & Waked, 2022). Market sentiment refers to investors' overall attitudes towards a particular security or financial market. It is often gauged using various indicators, including surveys and sentiment indices. Baker and Wurgler (2007) demonstrate that high levels of investor sentiment are associated with overpriced stocks and subsequent lower returns. Recent advancements have integrated market sentiments into predictive models to enhance their accuracy. Da et al. (2015) have developed a novel measure of market sentiment using Google search volumes and found that it significantly predicted short-term market returns. Similarly, Schmeling (2009) analyzes sentiment across different countries and concludes that sentiment significantly affects stock returns, especially in markets with lower institutional investor presence. Despite these advancements, there is still a need for more comprehensive studies that incorporate real-time market sentiment data into adaptive herding models (Chiang & Zheng, 2010; Goodell, 2020). News sentiment analysis involves evaluating the tone of news articles in order to gauge the sentiment of the information being disseminated. This form of analysis has been shown to significantly affect investor behavior and market outcomes. Tetlock (2007) finds that high pessimism in news articles predicts downward pressure on market prices. Similarly, Engelberg and Parsons (2011) demonstrate that local news sentiment significantly impacts local trading behavior and asset prices. Incorporating news sentiment into financial models improves their predictive power. Oliveira et al. (2016) show that integrating news sentiments with machine learning models enhances market predictions. Nonetheless, the dynamic incorporation of news sentiment into adaptive herding models remains underexplored, particularly in various market contexts (Chang et al., 2000; Chiang & Zheng, 2010). Investor happiness, often measured through social media sentiment and happiness indices, is an emerging area of interest in behavioral finance. Happy investors are more likely to make optimistic market decisions that influence their trading volumes and asset prices. Dodds et al. (2011) use Twitter data to construct a happiness index, finding that it correlates with stock market movements. Similarly, Zhang et al. (2011) find that positive sentiment on social media is associated with higher stock returns. Nguyen and Vo (2023) demonstrate that investor mood, as captured by daily stock message board postings, significantly predicts market performance. Despite these findings, there is a lack of comprehensive studies that dynamically integrate investor happiness into models of adaptive herding, which could provide deeper insights into the psychological drivers of market behavior (Bogdan et al., 2022). Therefore, this study proposes the following hypotheses: 301 Gadjah Mada International Journal of Business - September-December, Vol. 27, No. 3, 2025 H3: Market sentiment, news sentiment, and investor happiness significantly impact herding behavior, with positive sentiment associated with reduced herding and negative sentiment with increased herding. H4: Machine learning models can better mitigate behavioral biases such as herding, leading to faster normalization of market conditions post-major macroeconomic events compared to human investors. Shariah-compliant stocks operate under a unique set of ethical and financial guidelines that distinguish them from conventional equities. These guidelines, which include restrictions on excessive leverage, interest-based transactions (riba), and investment in unethical industries (such as gambling and alcohol), contribute to a more disciplined investment environment (Medhioub and Chaffai, 2019). Due to these principles, Shariah-compliant firms are subject to rigorous corporate governance and transparency standards, which may reduce speculative trading and limit irrational herding behavior (Loang and Ahmad, 2022). Recent studies suggest that Shariah-compliant stocks exhibit lower levels of herding compared to conventional stocks, particularly during periods of market volatility, as ethical screening criteria lead to more stable investor behavior (Aziz et al., 2022). Furthermore, religious and ethical motivations among Islamic investors may foster long-term investment strategies rather than short-term speculative behavior, further diminishing herding tendencies (Maulida and Sari, 2023). Islamic financial principles can mitigate irrational investor behavior (Ah Mand et al., 2023). Given these factors, this study proposes the following hypothesis: H5: Shariah-compliant stocks exhibit lower levels of herding behavior than conventional stocks due to stricter corporate governance, ethical investment constraints, and a more disciplined investor base. Methods This study examines adaptive herding in U.S. (1,742 firms), Malaysia (731 companies), and Indonesia (693 companies) stock markets using market data and sentiment analysis. Data from U.S., Malaysia, and Indonesia S&P 500 Top 50 firms was used for machine learning research. This study chose Malaysia and Indonesia because they are the largest markets for Shariah-compliant stocks, which cater to Islamic investors. Malaysia is one of the world's major Islamic financial marketplaces, with 79% of publicly listed businesses, or 1,148 out of 1,457 on Bursa Malaysia, being Shariah-compliant. Of the 793 firms registered on the Indonesia Stock Exchange, 468 exceed Shariah criteria, representing over 60% of the market. The U.S. stock market, as a highly developed financial system, is characterized by stringent regulatory oversight, high transparency, and robust enforcement mechanisms that minimise information asymmetry and speculative trading. In contrast, Malaysia and Indonesia represent emerging markets where financial regulation is evolving, and market inefficiencies can contribute to different patterns of herding behavior. Shariah-compliant stocks in these markets are subject to dual regulatory frameworks—conventional financial regulations and additional Islamic ethical constraints. While Shariah governance requires compliance with ethical investment screening and financial ratio restrictions, it primarily focuses on business activity screening rather than direct market conduct regulation. 302 Ooi & Candra Therefore, while these stocks face additional ethical requirements, they may not necessarily experience the same level of financial regulatory enforcement as firms in the U.S. The data covers major market events including the COVID-19 epidemic from January 2010 to December 2023. The daily stock prices and trade volumes came from Bloomberg. Table 1 provides the Thomson Reuters MarketPsych market sentiment indices, the Bloomberg sentiment analysis news sentiment ratings, and the Twitter-based Hedonometer for investor happiness. Table 1. Variables and Data Sources Variables Descriptions Herding Behavior Calculated using the CSAD Market Sentiment Indices reflecting investor sentiment based on financial news and social media News Sentiment Sentiment scores derived from analysis of financial news articles Investor Happiness Happiness index derived from Twitter data analysis Trading Volume Daily trading volume of the selected companies Source: Authors' compilation Source DataStream Thomson Reuters MarketPsych Indices Bloomberg Sentiment Analysis Hedonometer DataStream This study employs the cross-sectional absolute deviation (CSAD) method to measure static herding behavior in financial markets. The CSAD approach captures the extent to which individual stock returns deviate from the market average, offering a straightforward measure of herding behavior. The CSAD at time t is calculated using the following formula: (1) In this equation, CSADt represents the cross-sectional absolute deviation at time t; NtN_tNt is the number of stocks in the market at time t; Ri,tdenotes the return of stock i at time t; and Rm,t is the market return at time t. To identify herding behavior, the CSAD is regressed on the market return and its squared term as specified in the following regression model: (2) Here, Rm,t denotes the market return at time t; |Rm,t| represents the absolute value of the market return at time t; R2m,t is the squared market return; and ao, a1, a2 are the coefficients to be estimated. The error term ϵt captures the unexplained variation in the CSAD. A negative and significant coefficient a2 indicates the presence of herding behavior, suggesting that individual stock returns converge towards the market return when market returns are extreme. Adaptive herding, unlike static herding, accounts for the dynamic nature of investor behavior by considering changes in market conditions and external information. This study enhances the traditional CSAD model by integrating real-time sentiment analysis and other dynamic factors, such as market sentiment, news sentiment, 303 Gadjah Mada International Journal of Business - September-December, Vol. 27, No. 3, 2025 investor happiness, market volatility, and trading volume. The enhanced CSAD model is formulated as follows: (3) In this model, MSentt represents the aggregated market sentiment score at time t; Newst denotes the sentiment score derived from news articles at time t; Happt captures the investor happiness index based on Twitter data at time t; and Volt represents the daily trading volume at time t. The enhanced CSAD model is estimated using regression analysis, where the significance of the interaction term β2 indicates the presence of adaptive herding, suggesting that herding behavior changes with sentiment. This study compares static and adaptive herding behaviors across the U.S., Malaysia, and Indonesia, analyzing the impact of sentiment on herding separately for each market to understand the differences in herding dynamics. A single-layer neural network (SLNN) was employed to understand the impact of market variables on herding behavior. The SLNN consists of an input layer and an output layer, which facilitates straightforward data processing while maintaining computational efficiency. In this study, the input layer encompasses variables, such as market returns, market sentiment, news sentiment, investor happiness, and trading volume. These features were selected based on their significant impact on herding behavior. The model calculates the output using the following equation: (4) where μi denotes the output of the i-th neuron, wj represents the weights, xj are the input features, and b is the bias term. The input features, represented as x=(xi1, xi2, xi3,…, xin)x, are connected to the output layer through weights. The neuron outputs are computed as follows: (5) The SLNN underwent training using a learning rate of 0.01 and an array size of 4, with weights initialised via the Glorot uniform method and optimised using the Adam weight optimiser. Training involves forward propagation to generate outputs, calculating the loss using the mean squared error (MSE), and performing backpropagation to update weights. This iterative process continues until the model achieves a minimal error. In the context of herding behavior, the SLNN leverages historical data on market sentiment, news sentiment, investor happiness, and trading volume to identify periods characterized by herding or its absence, as indicated by the CSAD. A multi-layer neural network (MLNN) extends the SLNN architecture by incorporating one or more hidden layers between input and output layers. This enhanced architecture allows the network to capture more complex patterns and interactions within the data, which is crucial for a nuanced understanding of herding behavior. Each layer in the MLNN comprises neurones interconnected with every neuron in the preceding and succeeding layers, thereby enabling the model to comprehend intricate dependencies. 304 Ooi & Candra The hidden layers utilise the rectified linear unit (ReLU) activation function, defined as: (6) The output for each neuron in the hidden layers is computed using: (7) where ∅ denotes the ReLU activation function, wi represents the weights, ai is the input, and b is the bias term. The fully connected architecture ensures that each hidden neuron is linked to all other nodes or neurones in the succeeding layer with weights assigned to these connections. The neuron's output value ∑wi ai + b reflects the estimated CSAD. The loss function utilised for training the MLNN is the MSE, expressed as: (8) where N represents the total number of instances in the dataset, yi is the actual CSAD value, and yi is the forecasted CSAD value. This equation ensures that the model minimises the average squared difference between the actual and predicted CSAD values during the training. At the end of all epochs, the final coefficients are saved and can be used for unobserved data (i.e. data used for testing) in the future by using absolute market returns, the square of market returns, and economic uncertainty news sentiment to calculate the value of CSAD. This approach ensures that the MLNN model is robust and capable of generalising new, unseen data, thereby providing a comprehensive understanding of herding behavior across different market conditions. Data supporting this study are available from the Repository at https://doi.org/10.5281/zenodo.15266086 Results & Discussions Descriptive Statistics Table 2 presents the descriptive statistics of the variables from January 2010 to December 2023. The U.S. market exhibited a mean CSAD of 0.015 with a standard deviation of 0.023, indicating relatively lower herding behavior and variability. In contrast, Malaysia's CSAD is higher, with a mean of 0.018 and a standard deviation of 0.027, suggesting more pronounced herding behavior and greater market instability. Indonesia's market shows the highest levels of herding behavior, with a mean CSAD of 0.019 and a standard deviation of 0.031, reflecting significant market volatility and investor conformity. The skewness values for the U.S., Malaysia, and Indonesia are 1.485, 1.597, and 1.782, respectively, indicating a rightward skew, with Indonesia's distribution being the most asymmetric. Kurtosis values further differentiate these markets, with the U.S. at 5.025, Malaysia at 5.215, and Indonesia at 5.472, all indicating leptokurtic distributions (due to the pandemic) but with varying degrees of peakedness, most pronounced in Indonesia. 305 Gadjah Mada International Journal of Business - September-December, Vol. 27, No. 3, 2025 Table 2. Descriptive Statistics of Variables (January 2010 - December 2023) Variable Obs. Mean Max Min Std Dev Skewness Kurtosis CSAD_US 3,528 CSAD_MY 3,528 CSAD_IN 3,528 Market Sentiment 3,528 News Sentiment 3,528 Investor Happiness 3,528 Trading Volume (' 000) 3,528 Source: Authors' compilation 0.015 0.018 0.019 0.502 0.405 0.547 1,203 0.123 0.132 0.147 0.978 0.902 0.953 5,012 0.004 0.006 0.007 0.103 0.052 0.201 202 0.023 0.027 0.031 0.198 0.248 0.183 798 5.025 5.215 5.472 2.751 3.015 2.845 4.195 1.485 1.597 1.782 0.052 0.215 -0.298 1.247 Market sentiment averages 0.502 with a standard deviation of 0.198, whereas news sentiment has a mean of 0.405 and a standard deviation of 0.248, indicating moderate variability in both metrics. Investor happiness averages 0.547 with a standard deviation of 0.183, reflecting relatively stable investor sentiment. Trading volume, expressed in thousands, has a mean of 1,203, a maximum of 5,012, a minimum of 202, and a standard deviation of 798, showing substantial trading activity variability. Correlation Analysis The Pearson correlation analysis presented in Table 3 reveals significant relationships between the variables under study. The U.S. (CSAD_US) exhibits a strong positive correlation with the CSAD for Malaysia at 0.752 and Indonesia at 0.689, indicating that herding behaviors are closely related across these markets. Similarly, CSAD_MY and CSAD_IN have an even higher correlation of 0.814, suggesting that herding behavior is particularly interconnected between these two emerging markets. Table 3. Correlation Analysis Variable Obs. Mean Max Min Std Dev Skewness Kurtosis CSAD_US CSAD_MY CSAD_IN Market Sentiment News Sentiment Investor Happiness Trading Volume (' 000) 3,528 3,528 3,528 3,528 3,528 3,528 3,528 0.015 0.018 0.019 0.502 0.405 0.547 1,203 0.123 0.132 0.147 0.978 0.902 0.953 5,012 0.004 0.006 0.007 0.103 0.052 0.201 202 0.023 0.027 0.031 0.198 0.248 0.183 798 5.025 5.215 5.472 2.751 3.015 2.845 4.195 1.485 1.597 1.782 0.052 0.215 -0.298 1.247 Note: Market Sentiment (MS), News Sentiment (NS), Investor Happiness (IH), Trading Volume (TV) Source: Authors' compilation Market Sentiment (MS) is negatively correlated with CSAD across all three markets, with values of -0.325, -0.298, and -0.354 for the U.S., Malaysia, and Indonesia, respectively, indicating that higher market sentiment is associated with reduced herding. News Sentiment (NS) also shows a negative correlation with CSAD, with correlations of -0.401 for the U.S., -0.422 for Malaysia, and -0.389 for Indonesia, suggesting that positive news sentiment helps mitigate herding behavior. Investor Happiness (IH) follows a similar trend, negatively correlating with CSAD values at -0.276, -0.312, and -0.337 for the U.S., 306 Ooi & Candra Malaysia, and Indonesia, respectively, indicating that higher levels of investor happiness are linked to lower herding behavior. Conversely, Trading Volume (TV) is positively correlated with CSAD, with correlations of 0.512 for the U.S., 0.468 for Malaysia, and 0.495 for Indonesia, suggesting that increased trading activity is associated with higher herding behavior in these markets. Existence of Static Herding in the U.S., Malaysia, and Indonesia Table 4 estimates Equation (2), the static CSAD regression model, which tests for herding behavior based on the nonlinear relationship between return dispersion and market returns for the U.S., Malaysia, and Indonesia across the pre-, pandemic, and post-pandemic regimes. During the pre-pandemic period (January 2010 to March 2020), all three markets exhibited strong evidence of herding behavior, with significantly negative a2 coefficients (-0.012, -0.019, and -0.017 for the U.S., Malaysia, and Indonesia, respectively), indicating a convergence of individual stock returns towards the market return. This suggests that investor behavior is driven by collective market trends rather than by individual stock fundamentals. The pandemic period (March 2020 to December 2022) saw an intensification of herding behavior, reflected in more significant negative a2 values (-0.021 for the U.S., -0.026 for Malaysia, and -0.023 for Indonesia). This heightened herding can be attributed to the increased uncertainty and market volatility during the COVID-19 crisis, which led investors to rely more heavily on market signals than on independent analysis. In the post-pandemic period (January 2023 to December 2023), while herding behavior persisted, there was a slight attenuation compared to the pandemic regime, with a2 values of -0.015, -0.020, and -0.019 for the U.S., Malaysia, and Indonesia, respectively. This reduction in herding intensity may reflect a gradual return to more normal market conditions and a recovery in investor confidence, although collective behavior remains significant. Comparing these findings with recent studies, our results align with those of Bouri et al. (2019), who found that herding behavior intensified globally during the COVID-19 pandemic due to heightened market uncertainties (Bouri et al., 2019). Similarly, Nguyen and Vo (2023) documented persistent herding during the pandemic, emphasizing the role of investor sentiment and market liquidity in driving collective behavior. Figures 1(a) and 1(b) depict the CSAD values obtained through non-ML and machine learning. In the non-machine learning approach (Figure 1a), CSAD values exhibit higher levels of dispersion, indicating more pronounced herding behavior among investors. For instance, during the pre-pandemic period (January 2010 to March 2020), the average CSAD values for the U.S., Malaysia, and Indonesia were 0.015, 0.018, and 0.019, respectively. These values surged during the pandemic (March 2020 to December 2022) to 0.021 in the U.S., 0.026 in Malaysia, and 0.023 in Indonesia. Conversely, the machine learning approach (Figure 1b) showed lower overall CSAD values, suggesting that herding behavior is less pronounced when advanced analytical techniques are employed. During the same pre-pandemic period, the machine learning-based CSAD values were 0.013 for the U.S., 0.016 for Malaysia, and 0.017 for Indonesia. Notably, the machine learning-based CSAD also spiked during major macroeconomic events such as the COVID-19 pandemic, the 2015 Chinese stock market crash, and the 2016 Indonesian demonetization, reflecting the immediate impact of these disruptions on investor behavior. However, these surges were quickly mitigated, with CSAD values returning to normal herding levels faster than those in the non-machine learning 307 Gadjah Mada International Journal of Business - September-December, Vol. 27, No. 3, 2025 approach. The CSAD during the pandemic surged higher than that in non-machine learning at the beginning of the pandemic, as machine learning models initially struggled to account for unexpected events that disrupted the market. The results of this study indicate that machine learning models, despite their initial challenges in accounting for unexpected events such as the COVID-19 pandemic, ultimately provide a more accurate and resilient measure of herding behavior compared to traditional methods. This finding aligns with previous research, highlighting the superiority of machine learning techniques in financial market analysis. Gu et al. (2020) demonstrated that machine-learning models significantly improve predictive accuracy in asset pricing compared to conventional econometric models. Similarly, Fischer and Krauss (2018) found that neural networks and other machine-learning approaches outperform traditional models in forecasting stock prices and managing financial risk. The rapid normalization of CSAD values in our machine learning models post-major macroeconomic events emphasized the potential of algorithmic trading systems to mitigate behavioral biases and enhance market stability. However, the reason why machine learning shows less herding and better normalization is unknown, highlighting the need to conduct adaptive herding analyses to further examine this phenomenon. Existence of Static Herding in the U.S., Malaysia, and Indonesia Table 5 highlights the results of the adaptive herding analysis using rolling regression methods to compare machine learning and non-machine learning models in the U.S., Malaysia, and Indonesia with 250-day and 500-day rolling windows. The use of 250-day and 500-day rolling windows allows for the continuous updating and analysis of herding behavior over time, providing a more accurate and dynamic understanding of how market conditions and investor behaviors evolve rather than relying on static, single-period observations. Table 4. Existence of Static Herding in U.S., Malaysia, and Indonesia Regime I: Pre-Pandemic No of Obs Constant a_1 a_2 R-squared Adjusted R-squared Log-likelihood Hannan-Quinn criterion F-statistic Prob(F-statistic) Durbin-Watson stat Wald F-statistic Prob(Wald F-statistic) Regime II: Pandemic Regime III: Post-Pandemic U.S. Malaysia Indonesia U.S. Malaysia Indonesia U.S. Malaysia Indonesia 2,583 0.010*** (0.000) 0.240*** (0.000) -0.012** (0.045) 0.624 0.605 150.25 4.954 2,592 0.014*** (0.000) 0.255*** (0.000) -0.019** (0.040) 0.673 0.651 149.15 4.881 2,581 0.011*** (0.000) 0.260*** (0.000) -0.017** (0.043) 0.654 0.631 150.10 4.862 693 0.018*** (0.000) 0.285*** (0.000) -0.021*** (0.004) 0.714 0.691 145.35 5.804 687 0.019*** (0.000) 0.295*** (0.000) -0.026*** (0.003) 0.747 0.720 143.50 5.525 695 0.017*** (0.000) 0.290*** (0.000) -0.023*** (0.003) 0.734 0.717 144.30 5.991 252 0.012*** (0.000) 0.265*** (0.000) -0.015** (0.028) 0.667 0.649 148.20 5.005 249 0.016*** (0.000) 0.275*** (0.000) -0.020** (0.022) 0.681 0.665 146.80 5.042 252 0.013*** (0.000) 0.270*** (0.000) -0.019** (0.025) 0.697 0.675 147.90 5.226 22.35 0.000 2.05 21.50 0.000 21.70 0.000 2.02 20.80 0.000 22.00 0.000 2.04 21.30 0.000 24.20 0.000 2.10 23.00 0.000 25.00 0.000 2.12 24.30 0.000 24.50 0.000 2.11 24.00 0.000 23.50 0.000 2.07 22.50 0.000 24.10 0.000 2.09 23.70 0.000 23.70 0.000 2.08 23.40 0.000 Note: Pre-pandemic: January 2010 to March 2020. Pandemic: March 2020 to December 2022. Post-pandemic: January 2023 to December 2023. Significance levels: **, *** indicate significance at the 5%, and 1% levels, respectively. Source: Authors' compilation 308 Ooi & Candra Figure 1(a). CSAD for U.S., Malaysia, and Indonesia (Non-Machine Learning) Figure 1(b). CSAD for U.S., Malaysia, and Indonesia (Machine Learning) Note: Figure 1 compares the CSAD values for the U.S., Malaysia, and Indonesia from January 2010 to December 2023 using non-machine learning (Figure 1a) and machine learning methods (Figure 1b). The machine learning approach shows lower CSAD values and faster normalization after major macroeconomic events, indicating a better adaptation to dynamic market conditions. Source: Authors' compilation 309 Gadjah Mada International Journal of Business - September-December, Vol. 27, No. 3, 2025 Country USA Malaysia 310 Table 5. Adaptive Herding in U.S., Malaysia, and Indonesia Variable 250_ML 500_ML 250_ 500_ NoML NoML a0 1.231*** 1.452*** 3.123*** 3.457*** (0.001) (0.001) (0.007) (0.006) a1 2.734*** 3.154*** 2.513*** 2.845*** (0.001) (0.001) (0.007) (0.006) a3 -8.526*** -10.038*** -11.825*** -13.416*** (0.001) (0.001) (0.009) (0.008) MS 1.239*** 1.451*** 1.126*** 1.341*** (0.001) (0.001) (0.008) (0.007) NS -1.238*** -1.454*** -1.128*** -1.344*** (0.002) (0.002) (0.009) (0.008) IH 1.453*** 1.673*** 1.342*** 1.563*** (0.001) (0.001) (0.010) (0.009) TV 2.345*** 2.567*** 2.231*** 2.456*** (0.001) (0.001) (0.011) (0.010) R-squared 0.654 0.683 0.635 0.671 Adjusted R-squared 0.643 0.674 0.624 0.662 Log-likelihood 110.113 120.234 105.456 115.789 Hannan-Quinn criterion 5.256 4.112 5.124 4.987 F-statistic 108.623 670.823 102.412 640.345 Prob (F-statistic) 0.000 0.000 0.000 0.000 Durbin-Watson stat 1.473 1.534 1.492 1.523 Wald F-statistic 110.345 465.012 105.345 480.234 Prob (Wald F-statistic) 0.000 0.000 0.001 0.002 a0 1.334*** 1.562*** 3.342*** 3.567*** (0.002) (0.001) (0.007) (0.006) a1 2.536*** 3.032*** 2.515*** 2.913*** (0.001) (0.001) (0.007) (0.006) a3 -9.236*** -11.341*** -12.936*** -14.613*** (0.002) (0.002) (0.009) (0.008) MS 1.348*** 1.564*** 1.235*** 1.451*** (0.001) (0.001) (0.008) (0.007) NS -1.341*** -1.563*** -1.235*** -1.451*** (0.002) (0.002) (0.009) (0.008) IH 1.564*** 1.783*** 1.451*** 1.673*** (0.001) (0.001) (0.010) (0.009) TV 2.456*** 2.671*** 2.345*** 2.567*** (0.001) (0.001) (0.011) (0.010) Ooi & Candra R-squared Adjusted R-squared Log-likelihood Hannan-Quinn criterion F-statistic Prob (F-statistic) Durbin-Watson stat Wald F-statistic Prob (Wald F-statistic) Indonesia a0 a1 a3 MS NS IH TV R-squared Adjusted R-squared Log-likelihood Hannan-Quinn criterion F-statistic Prob (F-statistic) Durbin-Watson stat Wald F-statistic Prob (Wald F-statistic) 0.667 0.603 0.652 0.629 0.654 0.591 0.639 0.617 112.345 125.512 108.123 118.789 5.278 4.056 5.321 4.098 110.512 680.623 123.612 632.133 0.001 0.002 0.002 0.002 1.514 1.554 1.523 1.549 115.234 475.345 112.456 470.812 0.001 0.002 0.001 0.002 1.453*** 1.673*** 3.453*** 3.673*** (0.003) (0.002) (0.006) (0.005) 2.912*** 3.234*** 2.843*** 2.963*** (0.001) (0.001) (0.007) (0.006) -10.142*** -12.813*** -13.516*** -15.234*** (0.002) (0.002) (0.009) (0.008) 1.453*** 1.674*** 1.342*** 1.563*** (0.001) (0.001) (0.008) (0.007) -1.453*** -1.674*** -1.342*** -1.563*** (0.002) (0.002) (0.009) (0.008) 1.674*** 1.893*** 1.563*** 1.782*** (0.001) (0.001) (0.010) (0.009) 2.563*** 2.781*** 2.453*** 2.674*** (0.001) (0.001) (0.011) (0.010) 0.462 0.423 0.445 0.419 0.451 0.412 0.434 0.407 115.784 130.934 110.672 125.123 5.198 4.123 5.145 4.176 109.456 675.734 104.567 655.123 0.005 0.015 0.004 0.014 1.524 1.564 1.534 1.574 112.534 470.812 107.567 460.123 0.005 0.015 0.005 0.015 Note: This table presents the rolling regression analysis for the Cross-Sectional Absolute Deviation (CSAD) in the U.S., Malaysia, and Indonesia, comparing machine learning (ML) and non-machine learning (NoML) methods with 250-day and 500-day rolling windows. Significance level: *** indicates significance at the 1% level, respectively. Source: Authors' compilation In the U.S. market, the a2 coefficient for the 250-day ML model is -8.526 (p < 0.001), compared to -11.825 (p < 0.009) in the NoML model. Similarly, for the 500-day window, the ML model shows an a2 of -10.038 (p < 0.001) versus -13.416 (p < 0.008) in the NoML model, indicating ML models' superior sensitivity to market dynamics. In 311 Gadjah Mada International Journal of Business - September-December, Vol. 27, No. 3, 2025 Malaysia, the 250-day ML model has an a2 of -9.236 (p < 0.002) compared to -12.936 (p < 0.009) in the NoML model, and for the 500-day window, the ML model's a2 is -11.341 (p < 0.002) versus -14.613 (p < 0.008) in the NoML model. In Indonesia, the 250-day ML model shows an a2 of -10.142 (p < 0.002) compared to -13.516 (p < 0.009) in the NoML model, and the 500-day ML model's a2 is -12.813 (p < 0.002) versus -15.234 (p < 0.008) in the NoML model. Furthermore, the ML models demonstrate higher coefficients and greater significance for dynamic variables, such as market sentiment (MS), news sentiment (NS), investor happiness (IH), and trading volume (TV). In the Malaysian market using the 500-day window, MS has a coefficient of 1.564 (p < 0.001) in the ML model versus 1.451 (p < 0.007) in the NoML model. This indicates that ML models can better integrate sentiment analysis to predict herding behavior. Similarly, in the Indonesian market, the 500-day ML model showed an IH coefficient of 1.893 (p < 0.001) compared to 1.782 (p < 0.009) in the NoML model. The results of this study indicate that ML models outperform NoML models in capturing herding behavior, which is consistent with previous research. Gu et al. (2020) demonstrated that machine-learning models significantly enhance predictive accuracy in asset pricing compared to traditional econometric models. Similarly, Fischer and Krauss (2018) found that neural networks and other ML techniques outperform conventional models in forecasting stock prices and managing financial risk. The higher coefficients and greater significance for dynamic variables, such as market sentiment, news sentiment, investor happiness, and trading volume in our ML models, align with the findings of Athota et al. (2023), Oliveira et al. (2016), and Zhang et al. (2011) who highlight the importance of integrating sentiment analysis into predictive models. Quantile-on-Quantile Analysis Figure 2 employs quantile-on-quantile analysis to determine the impact of market sentiment, news sentiment, and investor happiness on CSAD. In Figures 2(a), 2(c), and 2(e), which represent the ML models, there is a marked presence of strong positive herding behavior, as evidenced by the predominance of red areas in the 3D surfaces. This suggests that ML models are more sensitive to variations in sentiment and investor emotions, allowing them to detect more pronounced herding tendencies when market participants collectively react to market news, sentiment, or happiness levels. Conversely, Figures 2(b), 2(d), and 2(f), corresponding to the NoML models, show significantly less red, with more diffuse patterns of herding behavior. The surfaces are flatter, indicating that NoML models are less effective in capturing the intensity of herding behavior under similar market conditions. The weaker and more scattered herding signals in these figures imply that traditional models may fail to fully capture the complex, nonlinear relationships that drive collective investor actions, particularly during periods of market stress or emotional extremes. The results of this study align with and build on previous research findings that investor sentiment significantly influences herding behavior, especially during downmarket periods (Chiang & Zheng, 2010; Omane-Adjepong et al., 2021; Youssef & Waked, 2022). This study also highlights that adverse herding occurs in low-trading volume and low-volatility periods, which aligns with the distinct patterns observed in the ML models. Similarly, the findings demonstrate that investor sentiment can significantly impact 312 Ooi & Candra stock market volatility, and their findings indicate that higher sentiment correlates with increased herding behavior. This finding supports the observed strong gradients and significant responses in the quantile estimates of the ML models for market sentiment, news sentiment, and investor happiness. Figure 2 (a). Market Sentiment (ML) Figure 2 (b). Market Sentiment (NoML) Figure 2 (c). News Sentiment (ML) Figure 2 (d). News Sentiment (NoML) Figure 2 (e). Happiness (ML) Figure 2 (f). Happiness (NoML) Note: Figure 2 uses a color gradient where red indicates strong positive herding behavior, signifying a higher likelihood of collective market actions based on sentiment or emotion, while blue represents weak or negative herding behavior, indicating lower or opposite reactions. The ML models show more extensive red areas, capturing the intensity of herding more effectively, whereas the NoML models predominantly display blue, reflecting a weaker ability to detect such behavior. This contrast underscores the superior performance of ML models in identifying and modeling complex market dynamics driven by investor sentiment and emotions. Robustness: Granger Causality Table 6 examines the robustness of the relationship between key sentiment indicators and 313 Gadjah Mada International Journal of Business - September-December, Vol. 27, No. 3, 2025 herding behavior through Granger causality tests. The purpose is to determine whether past values of these sentiment indicators can predict future herding behavior, thereby providing insights into the directional causality between these variables. Table 6. Granger Causality Test Causality Direction FPRemarks Statistic Value Market Sentiment → Herding 4.52 0.0021 Reject null, Market Sentiment Behavior Granger causes Herding Behavior Herding Behavior → Market 2.03 0.1210 Do not reject null, No Granger Sentiment causality News Sentiment → Herding 5.78 0.0005 Reject null, News Sentiment GrangBehavior er causes Herding Behavior Herding Behavior → News 1.67 0.1980 Do not reject null, No Granger Sentiment causality Investor Happiness → Herding 3.89 0.0047 Reject null, Investor Happiness Behavior Granger causes Herding Behavior Herding Behavior → Investor 2.50 0.0876 Do not reject null, No Granger Happiness causality The results reveal that market sentiment, news sentiment, and investor happiness significantly Granger cause herding behavior, as indicated by the F-statistics of 4.52, 5.78, and 3.89, respectively, and corresponding p-values of 0.0021, 0.0005, and 0.0047. These low p-values lead to the rejection of the null hypothesis, confirming that changes in these sentiment variables precede and potentially predict shifts in herding behavior. Conversely, the reverse relationships—herding behavior predicting changes in market sentiment, news sentiment, and investor happiness—do not exhibit significant Granger causality. The F-statistics for these directions are 2.03, 1.67, and 2.50, with p-values of 0.1210, 0.1980, and 0.0876, respectively, all above the common significance threshold of 0.05. These results suggest that while sentiment indicators are strong predictors of herding behavior, the influence does not appear to flow in the opposite direction, reinforcing the role of external sentiments as drivers of collective market actions rather than outcomes influenced by those actions. Conclusion This study has compated human investors and machine learning models to determine if adaptive herding occurs in different markets and conditions. The study focuses on developed countries like the U.S. and developing markets like Malaysia and Indonesia. It used the Thomson Reuters MarketPsych market sentiment indices, the Bloomberg sentiment analysis news sentiment scores, and the Hedonometer investor pleasure indicators from January 2010 to December 2023. CSAD was used for static and adaptive herding assessments, along with real-time sentiment analysis and several machine learning models, including single and multi-layer neural networks. This supports Hypothesis 1, showing that growing markets' relative inefficiency and changing regulatory frameworks induce more herding. Machine learning models pre314 Ooi & Candra dicted herding behavior better than statistical methods, especially in poor market conditions, supporting Hypothesis 2. The machine learning models were more sensitive to market swings, capturing herding dynamics more precisely and restoring market conditions faster after severe economic disruptions like the COVID-19 epidemic. Hypothesis 3 was supported, showing that market sentiment, news sentiment, and investor contentment strongly influence herding. The study indicated that positive market and news sentiment and investor contentment reduced herding, but negative sentiment increased it. They integrated these sentiment indicators well, showing that machine-learning models can account for real-time market fluctuations better than traditional models. The study confirmed Hypothesis 4, showing that machine learning models could reduce behavioral biases like herding speeding market stabilization following economic shocks. The models' fast adaptation to market conditions and feelings illustrates their potential to improve trading tactics and market resilience. Theory, practice, policy This study examines financial market herding with advanced machine learning. Static models ignore investor change. Market conditions, news, and investor pleasure explain adaptive herding. Herding behavior fluctuates with market conditions, undermining the EMH's market efficiency premise. ML models better capture these discrepancies, underscoring the need for flexible financial theories that account for herding. This study helps portfolio managers and investors. In unstable markets, ML models predicted herding better than traditional methods. Machine learning may improve risk-reward judgments. ML models can assist financial organizations in improving portfolio performance and stability by altering trading strategies faster using real-time sentiment data. The findings imply dynamic herding regulations, especially in emerging nations like Malaysia and Indonesia. ML algorithms predict herding, helping regulators monitor markets and act quickly. Market transparency and accurate information could reduce herding and stabilize financial markets. Policy, theoretical, and practical implications The findings of this study challenge the assumptions of the EMH by demonstrating that herding behavior is both dynamic and sentiment-sensitive. Across the sample period, herding intensified significantly during the pandemic regime, with CSAD values rising from 0.015 to 0.021 in the U.S., 0.018 to 0.026 in Malaysia, and 0.019 to 0.023 in Indonesia (Table 4). These patterns suggest that market participants react collectively in times of uncertainty, deviating from rational pricing mechanisms assumed under EMH. This reinforces the adaptive market hypothesis, which posits that market efficiency is not static but evolves in response to changing environments. The pronounced herding in emerging Shariah-compliant markets, particularly during crises, reflects structural differences in regulatory frameworks, informational asymmetries, and investor composition. From a practical standpoint, the results indicate that machine learning models offer superior predictive performance over traditional statistical approaches. In adaptive herding estimation (Table 5), ML-based models recorded significantly lower CSAD coefficients during high-volatility periods—for instance, −8.526 (250-day window) in the U.S., compared to −11.825 in the non-ML model. Similar trends were observed in Malaysia (−9.236 ML vs. −12.936 NoML) and Indonesia (−10.142 ML vs. −13.516 NoML), con315 Gadjah Mada International Journal of Business - September-December, Vol. 27, No. 3, 2025 firming the ability of ML models to detect behavioral shifts more sensitively. Furthermore, ML models demonstrated stronger responsiveness to real-time sentiment inputs such as investor happiness (1.673 in the U.S. and 1.893 in Indonesia), news sentiment (−1.454 in Malaysia), and market sentiment (1.674 in Indonesia). The quantile-on-quantile surfaces (Figure 2) further illustrate how ML models captured high herding intensity under extreme sentiment conditions—represented by dense red regions—unlike the flatter, less responsive surfaces from traditional models. These results imply that ML-enhanced trading systems could provide institutional investors with a competitive edge in adjusting portfolio allocations dynamically during market disruptions. Moreover, the Granger causality analysis (Table 6) revealed that market sentiment (F = 4.52, p = 0.0021), news sentiment (F = 5.78, p = 0.0005), and investor happiness (F = 3.89, p = 0.0047) all Granger-cause herding behavior, while the reverse causality was not statistically significant. This one-directional causality highlights the critical role of external sentiment as a leading indicator of irrational collective behavior. In response, policymakers—particularly in sentiment-sensitive emerging markets—should implement dynamic herding regulations and invest in real-time market monitoring systems. ML-based tools that incorporate social mood and sentiment metrics can serve as early warning systems for regulators. Furthermore, ensuring timely and reliable financial information through responsible media dissemination could mitigate the contagion effects of negative sentiment, contributing to improved market stability and investor protection. Limitation This study provides valuable insights but has limits that need more study. The Thomson Reuters MarketPsych and Bloomberg sentiment analyses may not represent market sentiment fully, especially in places where alternative media outlets impact investor behavior. Include social media and regional news outlets to get a fuller view of market sentiment and herding. The U.S., Malaysia, and Indonesia focus provides useful comparative insights but restricts generalizability. To study herding behavior dynamics, future research should include marketplaces with varied regulatory and market structures. Comparative studies of developed and emerging markets would clarify how market maturity and regulation affect investor behavior. CRediT authorship contribution statement Ooi Kok Loang: Conceptualization; Methodology; Validation; Formal Analysis; Resources; Data Curation; Writing -Original Draft; Writing -Review & Editing; Visualization; Supervision. Sevenpri Candra: Conceptualization; Validation; Data Curation; Writing -Original Draft; Writing -Review & Editing; Project Administration. References Amanda, C., & Pradipta, A. D. (2024). Risk-Based Premiums of Insurance Guarantee Schemes: A Machine-Learning Approach. Journal of Indonesian Economy and Business, 39(2), Article 2. https://doi.org/10.22146/jieb.v39i2.9323 Athota, V. S., Hasan, Z., Vaz, D., Désiré, S. S. M., & Pereira, V. (2023). Can Artificial Intelligence (AI) Manage Behavioral Biases Among Financial Planners? J. Glob. Inf. 316 Ooi & Candra Manage., 31(2), 1–18. https://doi.org/10.4018/JGIM.321728 Baker, M., & Wurgler, J. (2007). Investor Sentiment in the Stock Market. Journal of Economic Perspectives, 21(2), 129–152. https://doi.org/10.1257/jep.21.2.129 Barberis, N., & Thaler, R. (2003). Chapter 18 A survey of behavioral finance. In Handbook of the Economics of Finance (Vol. 1, pp. 1053–1128). Elsevier. https://doi. org/10.1016/S1574-0102(03)01027-6 Bihari, A., Dash, M., Muduli, K., Kumar, A., Mulat-Weldemeskel, E., & Luthra, S. (2023). Does cognitive biased knowledge influence investor decisions? An empirical investigation using machine learning and artificial neural network. VINE Journal of Information and Knowledge Management Systems, ahead-of-print(ahead-of-print). https://doi.org/10.1108/VJIKMS-08-2022-0253 Bikhchandani, S., Hirshleifer, D., & Welch, I. (1992). A Theory of Fads, Fashion, Custom, and Cultural Change as Informational Cascades. Journal of Political Economy, 100(5), 992–1026. https://doi.org/10.1086/261849 Bollen, J., Mao, H., & Zeng, X. (2011). Twitter mood predicts the stock market. Journal of Computational Science, 2(1), 1–8. https://doi.org/10.1016/j.jocs.2010.12.007 Bouri, E., Gupta, R., & Roubaud, D. (2019). Herding behavior in cryptocurrencies. Finance Research Letters, 29, 216–221. https://doi.org/10.1016/j.frl.2018.07.008 Chang, E. C., Cheng, J. W., & Khorana, A. (2000). An examination of herd behavior in equity markets: An international perspective. Journal of Banking & Finance, 24(10), 1651–1679. https://doi.org/10.1016/S0378-4266(99)00096-5 Chiang, T. C., & Zheng, D. (2010). An empirical analysis of herd behavior in global stock markets. Journal of Banking & Finance, 34(8), 1911–1921. https://doi.org/10.1016/j. jbankfin.2009.12.014 Choi, J., & Park, H. J. (2023). Financial Distress and Audit Report Lags: An Empirical Study in Korea. Gadjah Mada International Journal of Business, 25(3), Article 3. https://doi.org/10.22146/gamaijb.72251 Da, Z., Engelberg, J., & Gao, P. (2015). The Sum of All FEARS Investor Sentiment and Asset Prices. The Review of Financial Studies, 28(1), 1–32. https://doi.org/10.1093/ rfs/hhu072 Dodds, P. S., Harris, K. D., Kloumann, I. M., Bliss, C. A., & Danforth, C. M. (2011). Temporal Patterns of Happiness and Information in a Global Social Network: Hedonometrics and Twitter. PLOS ONE, 6(12), e26752. https://doi.org/10.1371/journal. pone.0026752 Engelberg, J. E., & Parsons, C. A. (2011). The Causal Impact of Media in Financial Markets. The Journal of Finance, 66(1), 67–97. https://doi.org/10.1111/j.15406261.2010.01626.x Fama, E. F. (1970). Efficient Capital Markets: A Review of Theory and Empirical Work. The Journal of Finance, 25(2), 383–417. https://doi.org/10.2307/2325486 Feng, G., Giglio, S., & Xiu, D. (2019). Taming the Factor Zoo: A Test of New Factors (SSRN Scholarly Paper No. 2934020). https://doi.org/10.2139/ssrn.2934020 Fischer, T., & Krauss, C. (2018). Deep learning with long short-term memory networks for financial market predictions. European Journal of Operational Research, 270(2), 654–669. https://doi.org/10.1016/j.ejor.2017.11.054 Gao, Y., Zhao, C., & Wang, Y. (2024). Investor sentiment and stock returns: New evidence from Chinese carbon-neutral stock markets based on multi-source data. International Review of Economics & Finance, 92, 438–450. https://doi.org/10.1016/j. 317 Gadjah Mada International Journal of Business - September-December, Vol. 27, No. 3, 2025 iref.2024.02.049 Goodell, J. W. (2020). COVID-19 and finance: Agendas for future research. Finance Research Letters, 35, 101512. https://doi.org/10.1016/j.frl.2020.101512 Gopal, S., & Loang, O. K. (2024). The Rationality Conundrum: Exploring Herd Mentality among Individual Investors in the Indian Stock Market. Indian Journal of Finance, 18(6), Article 6. https://doi.org/10.17010/ijf/2024/v18i6/173967 Gu, S., Kelly, B., & Xiu, D. (2020). Empirical Asset Pricing via Machine Learning. The Review of Financial Studies, 33(5), 2223–2273. https://doi.org/10.1093/rfs/hhaa009 Henrique, B. M., Sobreiro, V. A., & Kimura, H. (2019). Literature review: Machine learning techniques applied to financial market prediction. Expert Systems with Applications, 124, 226–251. https://doi.org/10.1016/j.eswa.2019.01.012 Hu, J., Sui, Y., & Ma, F. (2021). The Measurement Method of Investor Sentiment and Its Relationship with Stock Market. Computational Intelligence and Neuroscience, 2021(1), 6672677. https://doi.org/10.1155/2021/6672677 Hwang, S., & Salmon, M. (2004). Market stress and herding. Journal of Empirical Finance, 11(4), 585–616. https://doi.org/10.1016/j.jempfin.2004.04.003 Kliegr, T., Bahník, Š., & Fürnkranz, J. (2021). A review of possible effects of cognitive biases on interpretation of rule-based machine learning models. Artificial Intelligence, 295, 103458. https://doi.org/10.1016/j.artint.2021.103458 Krauss, C., Do, X. A., & Huck, N. (2017). Deep neural networks, gradient-boosted trees, random forests: Statistical arbitrage on the S&P 500. European Journal of Operational Research, 259(2), 689–702. https://doi.org/10.1016/j.ejor.2016.10.031 Kumbure, M. M., Lohrmann, C., Luukka, P., & Porras, J. (2022). Machine learning techniques and data for stock market forecasting: A literature review. Expert Systems with Applications, 197, 116659. https://doi.org/10.1016/j.eswa.2022.116659 Lo, A. W. (2004). The Adaptive Markets Hypothesis. The Journal of Portfolio Management, 30(5), 15–29. https://doi.org/10.3905/jpm.2004.442611 Mahadwartha, P. A., Ismiyanti, F., & Zunairoh, Z. (2023). The Gambler’s Fallacy, the Halo Effect, and the Familiarity Effect Based on Risk Profile: Bullish and Bearish Market in Indonesia Stock Exchange. Gadjah Mada International Journal of Business, 25(2), Article 2. https://doi.org/10.22146/gamaijb.64801 Mnif, E., Jarboui, A., & Mouakhar, K. (2020). How the cryptocurrency market has performed during COVID 19? A multifractal analysis. Finance Research Letters, 36, 101647. https://doi.org/10.1016/j.frl.2020.101647 Nguyen, Y. V. B., & Vo, A. H. K. (2023). Herding behavior before and after COVID-19 pandemic: Evidence from the Vietnam stock market. Journal of Economic Studies, 51(2), 357–374. Noda, A. (2016). A test of the adaptive market hypothesis using a time-varying AR model in Japan. Finance Research Letters, 17, 66–71. https://doi.org/10.1016/j. frl.2016.01.004 Nugroho, R., & Pratiwi, N. R. (2023). Revisiting Islamic Leadership: Clarifying Theoretical Issues. Journal of Leadership in Organizations, 5(2), Article 2. https://doi. org/10.22146/jlo.78412 Oliveira, N., Cortez, P., & Areal, N. (2016). Stock market sentiment lexicon acquisition using microblogging data and statistical measures. Decision Support Systems, 85, 62–73. https://doi.org/10.1016/j.dss.2016.02.013 Omane-Adjepong, M., Paul Alagidede, I., Lyimo, A. G., & Tweneboah, G. (2021). Herding 318 Ooi & Candra behavior in cryptocurrency and emerging financial markets. Cogent Economics & Finance, 9(1), 1933681. https://doi.org/10.1080/23322039.2021.1933681 Schmeling, M. (2009). Investor sentiment and stock returns: Some international evidence. Journal of Empirical Finance, 16(3), 394–408. https://doi.org/10.1016/j.jempfin.2009.01.002 Soni, P., Tewari, Y., & Krishnan, D. (2022). Machine Learning Approaches in Stock Price Prediction: A Systematic Review. Journal of Physics: Conference Series, 2161(1), 012065. https://doi.org/10.1088/1742-6596/2161/1/012065 Tetlock, P. C. (2007). Giving Content to Investor Sentiment: The Role of Media in the Stock Market. The Journal of Finance, 62(3), 1139–1168. https://doi.org/10.1111/ j.1540-6261.2007.01232.x Urquhart, A., & McGroarty, F. (2016). Are stock markets really efficient? Evidence of the adaptive market hypothesis. International Review of Financial Analysis, 47, 39–49. https://doi.org/10.1016/j.irfa.2016.06.011 Youssef, M., & Waked, S. S. (2022). Herding behavior in the cryptocurrency market during COVID-19 pandemic: The role of media coverage. The North American Journal of Economics and Finance, 62, 101752. https://doi.org/10.1016/j.najef.2022.101752 Zhang, X., Fuehres, H., & Gloor, P. A. (2011). Predicting Stock Market Indicators Through Twitter “I hope it is not as bad as I fear.” Procedia - Social and Behavioral Sciences, 26, 55–62. https://doi.org/10.1016/j.sbspro.2011.10.562 319