The Influence of Confidence and Social Networks on an Agent-Based Model of Stock Exchange

This paper aims to investigate the inﬂuence of investors’ conﬁdence in their portfolio holding relative to their social group and of various social network topologies on the dynamics of an artiﬁcial stock exchange. An investor’s conﬁdence depends on the growth rate of his or her wealth relative to his or her social group’s average wealth. If the investor’s conﬁdence is low, the agent will change his or her asset allocation; otherwise, he or she will maintain it. We consider three types of social networks: Barab´asi, small-world, and random. The actual stock markets’ properties are recovered by this model: high excess kurtosis, skewness, volatility clustering, random walk prices, and stationary return rates. The networks’ topologies are found to impact both the structuration of investors in the space of strategies and their performance. Among other characteristics, we ﬁnd that (i) the small-world networks show the highest degree of homophily; (ii) as investors can switch to more proﬁtable strategies, the best approach to make proﬁtable investments is the chartist one in Barab´asi and small-world topologies; and (iii) an unequal distribution and more signiﬁcant relative wealth gains occur in the Barab´asi network.


Introduction
Agent-based models study phenomena that emerge through individual interactions [1]. One branch of this computational economics refers to simulated economic systems on which economic theory can be tested. Such economic "laboratories" occupy a niche between analytical models, theoretical models, and empirical research. Artificial economic systems are typically more complex than analytical theory but simpler than real systems. us, they present the opportunity to verify more realistic theories than analytical models while maintaining the possibility of examining and understanding the resulting behavior. Another branch of agent-based computational economics aims at understanding the emergence of global behaviors based on local interactions. While global behaviors may be observed in empirical data, it is difficult to show why such behaviors occur. If the same behaviors exist in simulated models, then it can be stated that the inclusion of certain actors in the simulation may be sufficient to induce certain observed behaviors.
ese branches of agent-based computational economics are not mutually exclusive.
In standard financial theory, agents are assumed to have rational expectations, and changes in prices mean alterations in fundamentals rather than changes in investor sentiment. However, empirical researches show that psychological factors contribute decisively to investor behavior. One of the phenomena analyzed by the behavioral finance literature refers to overconfidence, revealing that mainstream economic theory's basic assumptions are violated. e agents show much confidence. For instance, a medical study showed that when the doctors were 90% confident in a diagnosis, they were right on average only 50% of the time. Similar results were found in other studies [2]. In short, people often bias in several directions contrary to what the traditional economic theory states.
Networks represent patterns of connections or interactions between the components of a system. A network is a collection of points joined together in pairs by lines. ese points are called vertices or nodes, and the lines that connect them are called edges. Examples of networks include the Internet, computers connected by data connections, and human societies, which are sets of people joined by social interaction. It should be noted that network structure can have a significant impact on system behaviors. Social network connections affect how people learn, form opinions, receive news, or how they invest. Unless we know about these networks' structure, we cannot fully understand such systems.
Many agent-based models (ABMs) include some behavioral aspects. In the following lines, we will briefly present a few of the most important ones. e work of Kim and Markowitz [3] is considered one of the first modern ABMs of the financial market. e backdrop of this model was the crash of the stock market in 1987.
e main objective of this work was to explore the relationship between portfolio insurance strategies and market volatility.
e main finding was that portfolio insurance strategies could destabilize the market due to their procyclical effect when accounting for their market impact, offering a possible explanation for the severity of the stock market crash. Brock and Hommes [4] use bifurcation theory and numerical methods to analyze market dynamics in a discounted value asset pricing model with heterogeneous beliefs. is paper reveals that an increase in the propensity to switch between predictors may lead to instability and complex dynamics for stock prices and returns. Another important work is the model presented by Levy, Levy, and Solomon [5]. When homogenous investors (with identical memory lengths) use past information, the stock market shows cyclic bubbles and crashes. When the memory lengths are heterogeneous across investors, the bubbles and crashes are less predictable and more realistic. Hommes [6] offers an early analysis of complex behavioral models using multiple heuristics and bounded rationality. e author stresses comparatively simple models for which some tractability is achieved by integrating analytical approaches with computational techniques. Chiarella et al. [7] discuss another area of research into boundedly rational heterogeneous financial market agent models, with particular focus on the role of the market-clearing process, investor utility function, price and wealth dynamics relationship, portfolio effects, and market dynamics influence of stochastic elements.
Although many behavioral features that include investor biases have been analyzed in previous works, there are very few papers of agent-based models that explicitly incorporate emotional biases identified by the behavioral finance literature. Among them, one can find the works of Takahashi and Terano [8], Lovric [9], and Bertella et al. [10][11][12]. In Takahashi and Terano [8], two types of biases are studied: overconfidence and loss aversion. When the same number of agents (fundamentalists and chartists) populate the market, the share price coincides with its fundamental value. When the number of chartists is much more significant than the fundamentalists, the price deviates enormously from the fundamental value, and the fundamentalists are eventually eliminated from the market.
ere are also fundamental price deviations when investors are overconfident and when chartist agents act asymmetrically concerning losses and gains. On the other hand, Lovric [9] incorporates overconfidence in agents. is is formalized as an underestimated risk of expected returns. As a result, overconfident investors generate infrequent bubbles and crashes. In another work, Lovric [9] develops a stock exchange model in which agents or part of them are overconfident and maybe optimistic or pessimistic. While optimism or pessimism influences agents' expectations of expected returns, overconfidence relates to those expectations' accuracy. As a result, the author finds that bullish agents generate quite pronounced booms and crashes, while pessimism tends to keep the market close to the stock's fundamental value. On the other hand, overconfidence causes investor sentiment to exacerbate. Bertella et al. [10] built an artificial stock market consisting of fundamentalists and chartists. Agents differ in their strategies for valuing stock prices and exhibit different memory lengths and confidence levels. When the heterogeneity of strategies used by agents is increased, excess volatility and kurtosis are observed. Confidence is also incorporated into the chartist agents, observing a positive correlation between the average confidence and return rate. e introduction of confidence brings even greater volatility to the market, reflecting the negative effect of greater irrationality on market behavior. In Bertella et al. [11], the objective is to verify, through an agent-based model, the stock price dynamics and its return rate in an artificial financial market composed of fundamentalists and chartists with and without confidence. When it is incorporated in the chartist agents, there is a higher price and rate of return volatility to the case without confidence. Besides, kurtosis and skewness are lower than in the case of simulation with no confidence. en, it is observed that the share price and the confidence index, both generated by the model, cointegrate, and there exists a causal relationship of the share price to the confidence index, which does not exist in reverse. e model is then verified with the S&P 500 and Nikkei indices and their respective confidence indices for the stock exchange. For this, cointegration and Granger tests are performed, concluding that both stock exchanges' indices cause confidence, corroborating the model's results. Bertella et al. [12] study the effects of overconfidence and loss aversion in an artificial stock exchange. ey find that the inclusion of confidence in 5% of chartists raises the trading volume as empirical evidence corroborates and price volatility increases considerably. On the other hand, loss aversion in 5% of chartists substantially decreases the trading volume. However, chartist traders now have a higher percentage of stocks in their portfolios, and a buy and hold strategy is adopted to mitigate losses.
If there are few studies relating explicitly to behavioral biases on artificial stock exchanges, there are even fewer studies that explicitly include the structure of behaviorally biased networks on an artificial stock exchange. Although there is a multitude of agent-based models that study the influence of the characteristics of social networks in a stock exchange, as far as we know, there are only the articles by Hoffmann et al. [13] and Hashanah and Alsulaiman [14] that 2 Complexity include agents explicitly with emotional biases in a social network environment. In the first study, different social network topologies (Barabási and Albert network or torus network) and interactions within these networks are used to develop the model. e price series and return rates show some qualitative and quantitative similarities with the Dutch stock exchange's empirical evidence. e second work combines psychological biases in a specific type of social network (Barabási network). Investors have several investment strategies: zero intelligence, fundamentalists, chartists, and agents with adaptive strategies. One of its conclusions refers to the efficient market hypothesis found at the macro level but not at the micro level. Another result refers to volatility and market capitalization. Volatility is more sensitive to model parameters than market capitalization, and the level of volatility does not affect market capitalization.
Our goal is to contribute to this research line by adding confidence, a behavioral variable, into investors within several social networks (Barabási, small-world, and random) to understand how network properties affect the dynamics of both stock prices and return rates. Besides this macro side, our work also intends to explain a few micro issues, such as: what kind of stock exchange emerges-in terms of the degree of homophily, prevailing investment strategy, investment strategy propagation rate, wealth distribution, among others-when distinct social networks are analyzed. In our model, investors' confidence plays a key role since it considers how much their wealth varied in the period and how much their social group's wealth (to which they are linked) changed in the same period. When investors' confidence is low-because their social group made more money than them-they will change their investment strategy to provide more wealth to their social group; otherwise, they will keep it.
Our work is structured as follows. In Section 2, we present the model, the formalization of confidence, and a brief discussion about networks. Section 3 presents the results from the econometric point of view and from where investor profile emerges when various types of networks are incorporated. e final section ends with concluding remarks.

Model
Our model initially follows the equations of Bertella et al. [10]. At a certain point, our work will differ from Bertella et al. [10] with random agents' inclusion of different expectations for chartists and network topology. e present model also has strong similarities with the agent-based model with fundamentalists and noise traders developed by Kaizoji et al. [15] and Westphal and Sornette [16] We consider three classes of investors, referred to broadly as fundamentalists, chartists, and random. Price and dividend expectations are formed depending on whether investors are fundamentalists, chartists, or random.

Strategy of Fundamental Investors.
A total of N fundamental investors decide between two investment options (not mutually exclusive over time): stocks, which pay a stochastic dividend d t , and risk-free bonds that pay a constant interest rate r with an infinitely elastic offer. e dividend d t paid over each time is generated by an exogenous stochastic process, i.e., a first-order regressive process, AR(1), where d is the base dividend (a constant), ϵ t has a normal distribution with zero mean and finite variance σ 2 and −1 < ρ < 1. Fundamentalists predict prices and dividends of the stock based on the stock's dividends, i.e., based on their fundamental values. As they do not have perfect rationality, they estimate the future value of the dividend by applying a simple heuristic as where g is the dividend growth rate given exogenously. e expected value of the stock price is, according to Gordon's model: where k is the future dividend flow discount rate, which is an exogenous constant. ese two equations define E i,t (p t+1 + d t+1 ), which is a critical value of formula (6). e fundamental investors have identical constant absolute risk aversion (CARA), and the utility function of wealth is given by where W i,t is the wealth of agent i at time t and λ is the risk aversion level. Each individual has the same initial wealth value W 0 . For the following period t + 1, the total value of the wealth of agent i is given by the expression as follows: In this model, each agent optimizes its allocation between stocks and fixed income bonds subject to the wealth constraint given by expression (5). Solving the maximization problem, we have the following result: where x i,t is the number of stocks demanded by agent i in t. e perceived variance of the returns, σ 2 i,t,p+d , corresponds to the following expression: where parameter θ determines the weight on recent square errors relative to past square errors.

Strategy of Chartists.
Chartists have price and dividend expectations based on past effective prices and dividends. Our work includes three types of chartists, wherein the Complexity 3 difference between them is due to the different memories of each type of chartist. us, we have chartists with memory m � 1, m � 5, and m � 10, where the m values are time units. e expression of the expected price for the chartist follows the formula of Barberis et al. [17]: where 0 < η < 1 is the weight attributed to the various price differences (dividends) between t − l and t − l − 1. For the dividend, the expression is the same, simply replacing the price with the corresponding dividend.

Random Agents.
Random agents also populate the investor universe. eir price estimate follows a normal distribution with average P t−1 and variance σ 2 r,p , while the expected dividend also follows a normal distribution with average d t−1 and variance σ 2 r,d . e expected price and dividend variances are given exogenously.

Price Dynamic Equation.
e market price is obtained by considering the total demanded (B t ) and offered quantities of the stock (O t ) by all agent types. ese are calculated as follows: where b i,t and o i,t are, respectively, the demanded and offered quantity of agent i in t. us, e share market price in t will be defined as a function of excess demand or supply in a given period, according to the following expression: where β is a parameter to minimize market price fluctuations. Table 1 shows the values of the parameters used in all simulations.

2.5.
Confidence. In this model, each agent checks whether his or her proportional wealth change variation increases or decreases relative to his or her social group. If this rate increases (decreases), his or her confidence also rises (falls). Although the formula below is similar to that in Bertella et al. [12], confidence (C) here is a function of the relative proportional variation rate of wealth (W), as shown in the following: where the coefficients c 1 , c 2 , c 3 , and c 4 change for all types of investors according to the expressions in the following: and C max � 1, maximum confidence value; C n � 0.5, neutral confidence value; and W m � W, value with neutral confidence. In this case, Although confidence rises (falls) as the relative proportional rate of variation of wealth increases (decreases), Figure 1 shows that confidence does not increase at the same rate of relative proportional change of wealth. ere is a range where confidence remains relatively constant.

Description of Investors' Strategy Modulated by
Confidence. After the market price is established, equation (11), each investor checks the rate of proportional change of wealth and calculates his or her confidence index for every period. As there are three kinds of investment strategies (fundamentalist, chartist, and random), the investor may switch his or her strategy among them as follows. After 12 units of time, the investor calculates the confidence index's average and compares them with C n (the neutral confidence index). If the confidence index's average is more significant than C n , her or she maintains his or her investment strategy; otherwise, he or she alters his or her strategy to that which provided the highest rate of wealth growth within the social group. In his or her new strategy (if he or she has changed), he or she makes his or her investments accordingly and calculates his or her confidence index for each period. After 12 units of time, he or she recalculates his or her average confidence index. If it is greater than C n , he or she maintains his or her strategy. Otherwise, he or she will change it to the one that has generated, on average, the highest relative percentage change rate of wealth, which might be his or her previous investment strategy or that of investors close to him or her.

Network Topologies.
e networks in this work (random, small-world, and scale-free or Barabási-both these terms are used interchangeably) are populated by investors (nodes). e links correspond to the interactions between them, and the wealth of each investor is proportional to the connections he or she has. e properties of the networks are described in Table 2.

Complexity
As explained in Section 2.6, agents will compare it with the neutral confidence index and change or not change their behaviors after calculating their average confidence index. If affirmative, they will change it according to the fundamental, chartist, or random agents' expected price and dividend equations, as addressed in Sections 2.1-2.3.
We are interested in the structure of a network largely determined by how the relationship between nodes or vertices is formed. In what follows, we briefly describe the three main models of complex networks (random, small-world, and scalefree) used in this work: (a) Random networks [18][19][20]: in this model, undirected links or edges are randomly included between a fixed N number of nodes. Each edge is represented based on some probability p. e number of edges that connects each node of the network (vertex degree) follows a Poisson distribution with a maximum limit N. e expected degree of any given node is given by equation (14), where k is the total number of edges incident on a given node: is model produces random networks with N vertices and k edges, called random network ER. An example of a random network is shown in Figure 2(a). (b) Small-world networks: many networks are interconnected, forming a small number of connections on each node [21]. In this model, the average distance between two nodes of a network does not exceed a small number of vertices. Hence, the expression is small-world. Such an effect is obtained in networks where most nodes are interconnected through a minimal path, also known as geodesic distance. An example of this type of network may be friends, with some having distant relatives in other parts of the world. Using these local and distant connections within the group, research shows that it is possible to connect any two people on average in just six steps and is called a small-world. Figure 2(b) is an example of a small-world network. (c) Scale-free networks: many networks have some very peculiar characteristics. One of the main features, called the preferred connection, is the tendency for a new node to connect to a network vertex with a high degree of connections. is characteristic means networks with few highly connected vertices, known as hubs, and many nodes with few connections [22]. Networks with these qualities are called scale-free due to the network representation. In other words, this means that scale-free networks are those whose degree distribution follows a power law. Such networks exist in various systems, such as the Internet, the Web, and scientific papers' citation networks. In what follows below, we will distinguish two cases: (a) No network effect: where the expected value of the price and dividend of each agent is fixed throughout the entire simulation (according to the equations determined for each type of agent-fundamentalist, random, and chartist) (b) Network effects: in contrast, the other simulations investigate "network effects," in the sense that each agent can change his or her way of calculating the expected value of price and dividend according to the specified rules, based on the type of the network and the links each agent has in the same network    Figure 3 shows the returns of "no network effect" and "network effects" (small-world, scalefree, or random network included in the agent-based model), considering 60% of fundamentalist agents, 20% chartists, and 20% random. It is noteworthy that the behavior of simulated data using networks presents episodes of increased volatility concentrated in specific periods (volatility clustering), alternating moments of relative stability. is behavior is one of the stylized facts related to the empirical analysis of returns in the time series literature [23,24]. Table 3 shows the descriptive statistics of rates of return for simulated and actual data (Dow Jones between 3/31/2009 and 12/16/2020). e standard deviations of simulated returns with networks indicate greater dispersion than the calculated dispersion for actual data (except for small caps data). Interestingly, the small-world network model showed the three network models' highest standard deviation, although the difference between them is very small. Excess kurtosis of simulated returns with networks indicates heavier tails, consistent with actual data. e observed exception refers to simulated data with no network effects whose kurtosis is very close to 3 (normal distribution value). e Jarque-Bera test rejected the hypothesis of normality for all simulated returns with networks and also for the actual data. e normality hypothesis could not be rejected for simulated returns with no network effect, in line with the kurtosis result presented above. All results point to negative skewness. e magnitude of simulated data with networks is compatible with the actual data. In summary, with any type of network, the kurtosis and skewness (in absolute value) of the return rate are much higher than the model with no network effect and are in line with real stock market data. Table 4 shows the ADF test results for unit root detection according to the specifications with constant and constant and trend terms. In the case of prices, the results indicate that the unit root hypothesis cannot be rejected at the 5% level of statistical significance, except for the simulated price in the model with no network effects and for small caps in the specification with constant and trend (the KPSS with a trend term test rejects the unit root hypothesis for small caps). In the case of returns, the unit root hypothesis is rejected at the level of 1% of statistical significance for all variables.

Econometric Analysis.
ese results are in line with the stylized facts about stock prices and returns: prices generally behave like a nonstationary series (random walk), whereas returns behave like stationary series. e KPSS and Phillips-Perron tests were also performed, and the conclusions remain.
Conditional volatility models (GARCH and its variants) were developed throughout the 1980s (see Engle [25] and Bollerslev [26]. ese models aim to adequately explain a stylized fact related to macroeconomic and financial series, specifically the phenomenon known as volatility clustering, where variations of great magnitude tend to focus on specific periods. Technically, in GARCH models, the goal is to model the second moment of the series under analysis explicitly. Let ε t be the disturbance of a time series. If this follows an ARCH (q) process, it may be represented by where u t ∼ i.i.d. (0, 1), One of the ARCH model (q) problems is the relatively large number of parameters required for proper adjustment.

Complexity
A potentially more parsimonious representation is given by the GARCH (p, q) model, defined by In general, q ARCH > q + p GARCH . For many economic series, the GARCH (1, 1) model provides a good fit: It can be demonstrated that the GARCH model has kurtosis greater than 3 and that the volatility clustering phenomenon is governed by parameter α.
An alternative specification represented by the exponential GARCH (EGARCH) model allows for the incorporation and testing of asymmetric effects in the series, i.e., adverse shocks are followed by more intense volatility increases compared to positive shocks. e EGARCH model (1, 1, 1) is given by It can be demonstrated that if α > 0, the model is compatible with volatility clustering, and if c < 0, the model has an asymmetric effect.
As seen in Tables 5 and 6, the simulated models' magnitude is mostly compatible with the actual data. On the other hand, parameter c is not significant in the simulated models (its signal is correct in three of the four simulations).
Finally, in Table 7, we show the price volatility of several models and the actual data. We reveal that the small-world model presents the highest volatility closely followed by the random model among the models that include networks. However, this volatility is much smaller than the actual data. It is interesting to note that the introduction of networks makes stock prices much more volatile.

Network Analysis.
With the incorporation of networks in the model, some profiles enabled only with the introduction of networks were investigated. e degree of Number of lagged differences determined by Akaike information criteria. e symbols * * * and * * indicate statistical significance at 1% and 5% levels, respectively.  e symbols * * * , * * , and * indicate significance at 1%, 5%, and 10%, respectively. 8 Complexity homophily (or network homogeneity) is one of these characteristics. Homophily (h) of a network tends to connect nodes with the same characteristics. In our model, the characteristic analyzed is the investment strategy: fundamentalist, chartist, and random. Its quantification is made by comparing the number of edges that connect nodes of similar characteristics (Q) with the expected number of these connections if they were perfectly grouped (Q max ), that is, where and A i,j are the elements of the adjacency matrix A that defines a network, x i is the degree of node i, m is the number of edges of the network, and δ i,j is the Kronecker's delta. e closer h is to the unit, the more homogenous the network will be. Figure 4 shows the degree of homophily in the Barabási network, the random network, and the small-world network.
By making a weighted average of the degree of homophily of the three networks, we have Table 8.
As observed, the small-world network has the highest degree of homophily.
is result seems natural since the small-world network has the highest clustering.
Given the possibility of investors switching investment strategies between fundamentalists, chartists, or technical and random, as explained in 1.6 above, we explore the investment strategy dynamics under the three network topologies. Figures 5(a)-5(c) show the changing strategies over time. Each curve corresponds to the percentage fraction of the total of agents that adopt a specific strategy. e winning strategy is considered one in which most agents choose to adopt, that is, the highest percentage. Table 9 summarizes the above results. As seen above, in the Barabási network, investors have mostly become chartists with memory 1, followed by fundamentalists. e winning strategy was the fundamentalist in the random network, while in the small-world network the chartists with memory 10 prevailed. Figure 6 shows the initial (the beginning of the simulation) and final configurations (the end of the simulation) of the distribution of agent types (represented by different colors), where each node size is proportional to its initial wealth (Figures 6(a), 6(c), and 6(e)) and proportional to its average wealth (Figures 6(b), 6(d), and 6(f )) in all the three networks.
We also investigated the cumulative distribution function of the absolute value of normalized returns. e powerlaw's behavior with a network is close to 3, corresponding to one of the stylized facts. e closest value to 3 is obtained with the small-world network. Table 10 summarizes the results.
We also checked the contagion dynamics, i.e., in what type of network the most significant percentage of investors follows the social group's investment strategy with the highest relative percentage gain. Figure 7 shows the answer, and Table 11 summarizes the results. e dynamics are greater in the small-world network, as shown in the figure.
e spread rate λ is defined as the ratio of the number of agents that have changed their initial strategy, N c , to the total number of agents, N t , that is, Its value can vary from 0, the value in which all agents maintain their initial strategies, to 100%, when all agents    changed their initial strategies. When reaching the highest value, or peak value, λ may decrease because several agents resume their initial strategy. As observed, the largest spread occurs in the small-world network followed by the Barabási network, an expected result since the small-world network has the highest clustering.
We also investigated in which network the highest relative percentage gain in wealth occurred. e highest percentage gain is in relation to his or her original investment strategy. Figure 8 shows the percentage gain per agent for each type of network.
As can be seen, the largest percentage gain occurred in the Barabási network, where, for instance, the first agent gained about 13% more than if he or she did nothing (and kept his or her original investment strategy). In contrast, in the small-world network, the largest gain was about 3.5%. Some investors lost money in small-world and random networks. Table 12 summarizes these results.
We also investigated the wealth distribution in all networks analyzed. e Lorenz curves in Figure 9 reveal that the greatest inequality is found in the Barabási network, followed by the random network.
e small-world network shows the lowest wealth inequality. We also calculated the Gini coefficient for all networks, and the results shown in Table 13 corroborate the Lorenz curves.

Sensitivity Analysis.
Sensitivity analysis determines how vulnerable the outputs of a model are to parameter specifications. In other words, it is a look at how changing model parameters affect model findings. We analyze the impacts of  In our model, given its stationarity, we picked the return rate as an output variable to examine its robustness with respect to changes of parameters. e stock price would not be a suitable choice since it is nonstationary. To test the sensitivity of our results, we ran ten simulations for each parameter value, totaling approximately 500 simulations of 1000 time steps. e parameters, the corresponding network, and the output results are described in Table 14.
e range of the first parameters (L, IN, RP, and LP) were selected based on what could be defined using the Network Workbench software for each type of network.
In the above simulations, we vary the parameters (L, IN, RP, and LP) by approximately plus or minus 50% around their central values used in most of the simulations. For example, the value in the paper for parameter L, the number of connections for new nodes in the Barabási network, is 6, so we scan it in the range from 2 to 10. Because the value used in the paper for parameter IN, the number of initial neighbors for the small-world network, is 5, we scan it in the range from 3 to 7. Likewise for the parameters RP, Rewiring Probability, and LP, Linking Probability. e other parameters, r (Interest Rate), β (to lessen market price fluctuations), and λ (risk aversion coefficient), were investigated because of their importance in stock exchange dynamics. For the three types of networks (Barabási, small-world, and random), we evaluated different values for the three parameters (r, β, and λ).
As can be seen from the final three columns of Table 14, the mean and standard deviation of the returns for the    , there is an increasing propagation of strategy from the initial moment of the simulation; that is, the agents are leaving their initial strategies for others, reaching rapidly maximum values from which they decrease until reaching low values (less than 10). is indicates that a significant portion of the agents, after switching to a given strategy, return to their initial strategies. In the small-world network (in green), the maximum values (of the same order as the Barabási network) are reached over a longer time and decrease to values that are not too low, that is, the dynamics of change is such that a larger portion of agents go back to their initial strategy and change again. As for the random network (blue), its maximum value is well below that of the other networks.   Figure 9: Lorenz curves for all networks calculated from the average wealth of each agent throughout the simulations. In the horizontal axis, we value the accumulated proportion of agents (p), and in the vertical axis, the corresponding value of the accumulated proportion of wealth, L (p).

Conclusions
We have presented an agent-based model that includes a behavioral variable (confidence), which changes according to the variation of the investor's wealth compared to other investors' wealth in his or her social network. We have investigated this model's properties on three types of social networks (smallworld, scale-free, and random). e combination of a psychological variable (confidence) with social networks produced results consistent with empirical facts. e incorporation of networks in conjunction with the behavioral variable sheds light on several properties that are little explored in this literature, such as the degree of homophily and the level of wealth inequality within social network topologies of a virtual stock exchange.
It is noteworthy that the behavioral (confidence) variable plays a crucial role within the model, as it determines that the investor-whether fundamentalist, chartist, or random-decides to change or not his or her investment strategy once confidence changes according to his or her wealth growth rate in comparison with the investor's average wealth growth rate in his or her social network. e confidence is not very volatile and is enjoying a large interval of stability. Also, the investor only changes his or her strategy when his or her confidence value reaches below C n , a neutral confidence index. In other words, the fundamentalist, chartist, or random investor will change his or her strategy to a more profitable one whenever he or she has little confidence in his or her current investment strategy. e actual stock exchange data's statistical properties are recovered in our model: high excess kurtosis, skewness, volatility clustering, random walk prices, and stationary return rates. We also investigated several types of networks. For instance, the small-world network has the highest degree of homophily. As the investors can switch to more profitable strategies, we found that the fundamentalist strategy is prevalent only in the random network. In the other networks (Barabási and small-world), the best approach to make profitable investments is the chartist one, which is a surprising outcome since the network models are compatible with the random walk hypothesis. We also investigated the cumulative distribution function of the absolute value of normalized returns. e exponent of the power-law distribution is found close to 3, in agreement with stylized empirical facts. e most extensive spread of social contagion occurs in the small-world network, an expected result since this network topology has the highest clustering. e Barabási network has uneven income distribution and a greater relative gain, followed by the random network. With regard to sensitivity analysis, we showed that the model outputs are robust. In terms of the mean and standard deviation of the stock return rate, changes in the values of various parameters (unique to each social network and general to all networks) yield fairly comparable outcomes. Finally, for future studies, we suggest looking into the effects of social networks on the creation of bubbles and collapses on the stock exchange and determining what type of social network a stock exchange may be characterized into.

Data Availability
e data used to support the study were obtained from Dow Jones historical data (https://finance.yahoo.com/quote/% 5EDJI/history/).

Disclosure
is manuscript was presented in "An Initial Framework Assessing the Safety of Complex Systems. In: CCS2020-Conference on Complex System 2020."