Phase Transition in the Social Impact Model of Opinion Formation in Log-Normal Networks

People may change their opinions as a consequence of interacting with others. In the literature, this phenomenon is expressed as opinion formation and has a wide range of applications, including predicting social movements, predicting political voting results, and marketing. The interactions could be face-to-face or via online social networks. The social opinion phases are categorized into consensus, majority, and non-majority. In this research, we study phase transitions due to interactions between connected people with various noise levels using agent-based modeling and a computational social science approach. Two essential factors affect opinion formations: the opinion formation model and the network topology. We assumed the social impact model of opinion formation, a discrete binary opinion model, appropriate for both face-to-face and online interactions for opinion formation. For the network topology, scale-free networks have been widely used in many studies to model real social networks, while recent studies have revealed that most social networks fit log-normal distributions, which we considered in this study. Therefore, the main contribution of this study is to consider the log-normal distribution network topology in phase transitions in the social impact model of opinion formation. The results reveal that two parameters affect the phase transition: noise level and segregation. A non-majority phase happens in equilibrium in high enough noise level, regardless of the network topology, and a majority phase happens in equilibrium in lower noise levels. However, the segregation, which depends on the network topology, affects opinion groups‟ population. A comparison with the scale-free network topology shows that in the scale-free network, which have a more segregated topology, resistance of segregated opinion groups against opinion change causes a slightly different phase transition at low noise levels. EI (External-Internal) index has been used to measure segregations, which is based on the difference between between-group (External) links and within-group (Internal) links.

to the phases in physics" magnetization field, an opinion formed in the social level could be described as phases, including majority and non-majority phases at the highest level [12,13]. Very analogous to the continuous (or second order) phase transition in magnetization [14], phase transition in opinion formation describes conditions where opinion phases may transfer to each other. One of the key parameters in opinion formation is network topology [15]. Scale-free network with power-law node degree distributed network topology [16] has been widely used for modeling real time networks, including networks for opinion formation [17]. However, recent studies reveal that strongly scale-free structures are empirically rare, while for most social networks, log-normal distributions fit the data better than power-law distributions [18,19]. In this research, we consider phase transitions in opinion formation using the social impact model in log-normal distribution networks. We have used agent-based modeling and simulation approach for this study. We have organized the remainder of this paper as follows: first, we briefly review the related background in Section 2; then we explain the research method in Section 3; subsequently, we present the results in Section 4 and discuss the results in Section 5; and finally, we conclude the paper in Section 6.

2-Background
In this section, the main concepts of this study are briefly overviewed.

2-1-Analytical Sociology and Social Simulation
As a traditional discipline of social sciences, sociology studies all forms of human and social dynamics and organization at all levels of analysis, including cognition, decision making, behavior, groups, organizations, societies, and the world system [20]. Analytical sociology aims to explain complex social processes by dissecting them, focusing on their most important constituent components, and constructing appropriate models that help us understand why we observe what we observe [21]. Mathematics has sometimes been used as a means of modeling and formalization in the social sciences but has never become widespread. However, there are some reasons why simulation is more appropriate for modeling social science theories: simulation programming languages are more expressive and less abstract than most mathematical techniques; simulation programs can be modular so that major changes can be made in one part without changing other parts of the program; and simulation systems could include heterogeneous agents, while it is usually relatively difficult using mathematics [22]. Therefore, analytical sociology benefits widely from agent-based simulations as computational tools [2], and many researchers have used agent-based modeling approaches to study sociology phenomena, including opinion formation [23][24][25]. Over the last decade, the number of papers on using agent-based models to describe how opinions emerge in a group of people has grown at an overall annual rate of 16%, though not continually [3].

2-2-Opinion Formation Models
People may change their opinions due to their interactions with others. Therefore, opinions can be formed and revised through social influence. Opinion formation models describe opinion dynamics and deal with how opinions may be formed and evolved in a social network. Many researchers in social psychology, statistical physics, mathematics, and computer science have focused on the opinion formation models as an interesting challenge in the last few decades [26]. The French opinion formation model introduced in 1956 by French, the psychologist, is the first opinion formation model [6]. After French"s model, some other opinion formation models have been introduced. Two main characteristics of every opinion formation model are the opinion space and time model. In the discrete opinion space, opinion values are from a set of discrete values, while in the continuous opinion space, opinion values are from a range of real values. Time modeling also includes continuous time and discrete time. In the continuous time models, time is considered a continuous range, and the opinion formation model is usually presented using a differential equation. While in the discrete time models, time is considered some (equal or non-equal) steps. The discrete time models are more suitable for simulation, including agent-based modeling and simulation; furthermore, difference equations are used instead of differential equations for mathematical representations. The most famous opinion formation models are summarized in Table 1, including their opinion space, time modeling, the main points(s) of opinion dynamics, publication year, and the reference(s). Each opinion formation model"s opinion dynamics specify how interacting individuals/agents influence each other"s opinions.

2-3-The Social Impact Model of Opinion Formation
In this research, we have used the social impact model of opinion formation [7], a discrete opinion model, with binary value for opinion, e.g., agree/disagree or yes/no. The model is also suitable for modeling opinion formation in online social networks and online communities in which a topic is raised, and users discuss for or against it.  [40][41][42] The social impact model of opinion formation [7] is based on the social impact theory formulated by Latané [8].
According to this theory, the impacts on individuals are exerted by the real, implied, or imagined presence or actions of one or more people or even groups. The impact of source individuals on a subject individual depends on three factors: 1) the (spatial, closeness, time, or abstraction) distance of the source individuals from the subject individual, 2) the source individuals" strength of persuasion, and 3) the number of source individuals. The social impact model of opinion formation consists of N individuals or agents. Any agent i (i=1, 2, . . , N) is assigned one of two possible opinion values, -1 or +1 at any time step, o i =1. Moreover, any agent i is characterized by two strengths: persuasiveness strength (p i ) and supportiveness (s i ) strength. The p i is the capability to persuade another agent with the opposite opinion to change its current opinion, and the s i is the capability to persuade another agent with the same opinion to stay on its current opinion. Any agent i experiences total impact I i from other interacting agents, js, formulated as (1), in which d ij denotes the distance between two individuals i and j, and  determines how fast the impact decreases with the distance d ij . The social impact between any two interacting agents is similar to the physical force that governs gravity between any two objects by Newton"s law, F=G(m 1 m 2 )/r 2 , in which G is the universal gravitation constant, m 1 and m 2 are masses of two objects (similar to persuasion strengths p j and s j in (1)), r is the separation between the objects (similar to d ij in (1)). The power of 2 of d in Newton"s law is similar to the parameter  in (1).
Some implementations of (1) [43][44][45] have also assumed =2. (1) The summations at the right-hand side of (1) calculate the impact of interacting agents trying to persuade agent i to change its opinion and the impact of interacting agents on agent i to persist in its current opinion, respectively. Thus, the overall impact on agent i to change (or persist on) its current opinion is calculated by (1). Eq. (1) expresses the deterministic part of interacting agents" social impact on agent i, while there is a nondeterministic part affecting agent i, called noise, h i . This non-deterministic part is initiated from the environment (e.g., public media) and the individuals' characteristics that determine how every individual is influenced by others (depending on many psychological factors). Thus, the social impact model of opinion formation formulates the opinion dynamics as (2), indicating the opinion of agent i at time step t+1 regarding the impact from interacting agents at time step t and all other non-deterministic factors summarized in noise parameter h i . The non-deterministic part of the model usually has no bias toward any opinion. Therefore, h i is usually regarded as white noise and is implemented as a random variable from a uniform distribution with a mean value equal to zero. The sign function in (2) maps negative values to -1 and positive values to +1.

2-4-Log-Normal Distributed Network
Scientists from different fields are trying to understand the structure and properties of real-world networks. A new branch of mathematics called random graph theory focusses on the probabilistic methods to model real-world networks. In many scientific domains of networks, it is claimed that most of the real-world networks are scalefree, varying in some details, and generally, a network is scale-free if the fraction of nodes with degree k follows a power-law distribution k - , where >1 [18]. However, scale-free networks" universality is controversial, and some recent studies reveal that log-normals often fit degree distribution as well or better than power-laws [18,46,47].

2-5-Phase Transition
The term phase transition was initially used by physicists to describe a change from one behavior to another in the thermodynamic or macroscopic limit [11]. Changing the values of a set of parameters, e.g., the temperature in physical systems may cause a transition from one phase to another. For example, changing between solid, liquid, and gaseous state of matter [48], or temperature may cause a change in the ferromagnetic state in materials such as iron, nickel, or cobalt [49]. Similarly, the phase transition is used in other sciences, including social systems [50,51]. In this research, we consider the social phases from opinion formation viewpoint very similar to those defined in [12], as follows:  Majority phase: population of agents with each opinion are not equal and could be recognized as a majority opinion and (probably) a minority opinion: -Consensus: All of the agents have the same opinion.
-Frozen majority: continuing time steps cause no change in opinion of any agent. -Orderly fluctuated majority: some agents change their opinion in every time steps (and other agents do not change their opinion). Fig. 1 illustrates how this fluctuation may happen in a network of agents following the social impact model with the same persuasiveness and supportiveness strengths. -Non-orderly fluctuated majority: at least some agents change their opinions with no specific pattern.  Non-majority phase: populations of agents with each opinion are (roughly) equal, such that no opinion could be recognized as the majority opinion of society. Very similar to the defined majority phase, the following three states may occur in this case: -Frozen non-majority, -Orderly fluctuated non-majority, -Non-orderly fluctuated non-majority.

2-6-Segregation and Measuring using EI Index
One of the phenomena affecting opinion formation is segregation. Segregation is defined as "the degree to which two or more groups live separately from one another" [52]. Segregation depends on the network structure. In a highly segregated network with two opinion groups, there are two sub-network. All of the nodes (individuals/ agents) of each sub-network have the same opinion. There are some links between nodes of the same group and no link between nodes from different groups. Therefore, no opinion will change due to interaction with a node from the other opinion group.
There are various approaches to measuring segregation in social networks [52]. In this research, we have used the EI (External-Internal) index, which determines a value for the whole network based on the number of links between nodes from different groups, or external links (EL) and the number of links between nodes of the same groups, or internal links (IL), according to (3): (3) Indeed, the EI index is defined as the difference between between-group links and within-group links, divided by the total number of links for normalization. EI takes a value between -1 (all links are within-group links, thoroughly segregated) and +1 (all links are betweengroup links, not segregated).

2-7-Noise in opinion formation models
The complex human being in various behaviors, including opinion formation, could not be represented by a simple deterministic model. Therefore, to be more realistic, almost opinion formation models have a non-deterministic or stochastic part. In the language of statistical mechanics, the stochastic component is called noise, which is added to the deterministic dynamics of an opinion formation model [10]. Some studies on the effect of noise in various opinion formation models have been published, mainly focusing on the effect of noise on phase transitions, e.g., [12,53] for the social impact model, [10,[54][55][56][57] for the Deffuant model [35], [58] for the Sznajd model [59], and [60][61][62] for the HK model [38].

3-Method
To study phase transitions in opinion formation according to the social impact model in log-normal distributed random networks, we implemented an agent-based model. Some details of the method are described in this section.

3-1-Generating Log-Normal Random Networks
To generate random networks with N nodes and lognormal node degree distribution, we have used the Bianconi-Barabási algorithm [63], an algorithm using growth and preferential attachment mechanisms. The growth mechanism means that the network continuously expands gradually by adding new nodes to the network, attaching to the current nodes in the network, and preferential attachment means that a new node links with higher probability to the nodes with higher degrees. In the Bianconi-Barabási algorithm, m 0 and m determine the number of initial nodes and the number of edges added with any newly added node, respectively. By setting the algorithm's fitness parameter, the generated network's node degree distribution fits the desired distribution, including the log-normal distribution we used in this research. The generate_BB function from PAFit package [64], implemented in R has been used to generate networks in this research. Since the simulation has been considered for 1000 agents (N=1000) and every agent is assigned to one of the generated random network nodes, network size As shown in Table 2, In this research, we assumed m 0 =2 and m=2.

3-2-Implementation of the Simulation
Eq. (1) and Eq. (2) for the social impact model contain some parameters. In this subsection, value assignments to those parameters are described. The persuasiveness and supportiveness parameters, p i and s i in Eq. (1), for each agent are assigned using a uniform random variable in the range (0..P max ) and (0.. S max ), respectively. We assumed both P max and S max are equal to 100. In this research, the distance between any two connected agents i and j, d ij in Eq. (1), equals 1. Therefore, regardless of the value of , d ij  =1 for any connected agents i and j. Since some random variables play important roles in the simulation, the simulation runs N run (=30) times for each input parameter set, and the statistics of output values ( trend and  final ), including the mean values and standard deviations, are calculated and reported. The number of runs for any unique parameter combinations to derive statistics Table 2 summarizes the above mentioned parameters and the assigned values in the simulation.
The following parameters are used as the independent or input parameters: simulation runs are 0%, 10%, 20%, 30%, 40%, and 50%. The system behavior for initial  values more than 50% are the same as for 1- and changing the initial assignment of opinions to the agents ("-1" instead of "+1" and "+1" instead of "-1"). Fig. 2 shows the pseudo code of the agent-based model. To more clarification, the equivalent flowcharts are also shown in Fig. 3 and Fig. 4. For every N run simulation repetitions with different random seed values of any combination of independent parameters h and initial , the  values in every time steps are measured and saved as  trend . Then for every input parameters h, initial , and N run the output  trend is available for reporting statistics and drawing the figures showing the system behavior.   create N agents and randomly assign each agent to one node of Log_Norm_Graph 17: randomly assign -1 opinion to  percent of the agents, assign others' opinions to +1

18:
initialize _arr[0] to (the current initial)  value (at time step #0) [_arris an array of  values for each time step from initial time step (0)

4-Results
The results of running the simulation algorithm described in the previous section are presented in this section. We use error fill plots to show the results. To clarify the presentation style of the results in error fill plots in this section, Fig. 5   case, an orderly fluctuation, discussed in section II (Fig.  1), causes a regular fluctuation after a few time steps. Such a fluctuation in some of the next figures for whole time steps (1000) are seen as thick lines. As another example, with the same parameters as Fig. 5 and changing starting  to 50% results in the plots shown in Fig. 6, where orderly fluctuation happens.  When the noise level increases, some agents randomly change their opinion due to the system's more stochastic behavior. Therefore, the observed fluctuation for the error fill curve is not regular. Fig. 7 and Fig. 8 show examples for this case for h=600 and starting from  =30% and  =50%, respectively.  For high enough noise levels, the system behaves more stochastically. Fig. 10 and Fig. 11 show the results for h=2000, again for eight simulation repetitions for the first 20 time steps, starting from  =30% and  =50%, respectively. , and medians (blue bars). As the figure shows, since the system is noise-free in this case, the majority phase (frozen or orderly fluctuated) happens very soon in the few initial steps. Similarly, for the next step of noise h, the simulations" result is shown in the following figures: Fig. 12 for h=200, Fig. 13 for h=400, Fig. 14 for h=600, Fig. 15 for h=1000, and Fig. 16 for h=2000.       Similarly, the red curve shows the result of simulations with the same parameter values, but network topology is scale-free Barabási-Albert random network as in [12] instead of log-normal. The results will be compared in the next section.

5-Discussion
As Fig. 11 shows, the behavior of the social system is fully deterministic in the noise-free case, starting from consensus (=0%) results in a consensus ( final =0%) because there is no opposite opinion and no stochastic behavior to cause any agent to change its opinion. For other  values, the system reaches the equilibrium state of a frozen or orderly fluctuated majority phase in a few time steps. Indeed, when the system starts with noise-free or very small noisy conditions, a frozen or orderly fluctuated phase happens in equilibrium because there is no noise to cause any spontaneous opinion change.
When the simulation starts from 0%<<50%, it results in  final < because the majority opinion group dominates the minority group, and the minority group"s population shrinks down, but the segregation phenomenon causes no consensus (except =0%, which means starting from consensus). In most of the noise-free cases, starting from =50% causes a majority phase, in some cases toward "-1" opinion, and in some cases toward "+1" opinion. In some rare cases starting from =50, the system may reach (frozen or orderly fluctuated) non-majority phase with  final =50%. As Fig. 11 shows, the mean value of  final is roughly equal to 50%, but the min-max and standard deviation have a relatively wide range. Increasing the noise level to 200 causes some segregated groups to break due to the agents" stochastic behavior. Therefore, in Fig. 12, more majority opinion groups emerge on average. Even starting from =0%, it is less probable to reach a consensus phase. Moreover, the orderly fluctuation is less probable due to the stochastic behavior; therefore, the fluctuations are mostly nonorderly.
As the system noise level increases to 400 (Fig. 13) and 600 (Fig. 14), the non-orderly majority phase happens, but with less population in comparison with lower noise levels. In these cases, the more stochastic behavior of the agents causes some agents to change their opinion without a persuasiveness impact from interacting agents, and this spontaneous opinion changes may cause breaking the segregated groups the agents belong to. Therefore, more stochastic behavior causes less population of majority opinion group in the (non-orderly) majority phase. Increasing the noise level to h=1000, as shown in Fig. 15, causes more domination of stochastic behavior, and the majority opinion group"s population is not very discriminating from the population of the minority opinion group. Finally, increasing the noise to higher levels, e.g., 2000, starting from any  values, the system reaches an equilibrium non-orderly non-majority phase, in which the population of both opinion groups is roughly the same with some small fluctuations. Fig. 17 compares the system behavior starting from different  values with various noise levels for the lognormal network topology studied in this research (the black curves) and the scale-free Barabási-Albert network topology studied in [12] (the red curves). The networks in both studies have been generated using preferential attachment algorithms, starting from two nodes (m 0 =2) and adding two edges (m=2) with every addition of a new node. For the scale-free network with power-law node degree distribution, the Barabási-Albert algorithm [16] has been used, which is very similar to the Bianconi-Barabási algorithm [63] we used for the log-normal networks. The networks of both topologies have the same number of nodes and the same number of edges; therefore, the mean value of node degrees are the same in both cases. The comparison of simulation with both log-normal and scale-free network topologies is shown in Fig. 17. As the figure shows, starting from =50% results in a nonmajority phase (roughly  final =50%) for both network topologies. The other starting  values are discussed as follows:  For very high noise levels (>1200), a non-majority phase occurs ( final =50%) in both topologies regardless of starting  values.  For some lower noise levels (600< h <1200),  final in scale-free topology is closer to 50% than log-normal topology. The reason is that in the scale-free topology with power-law node degree distribution, there are few highly connected nodes (strong hubs) which are more connected in comparison with highly connected nodes in the log-normal topology. The strong hubs in the scale-free topology in the presence of high enough noise cause more segregated groups break, and  final is more closer to 50% in comparison to the log-normal topology. In other words, the stronger hubs in the scale-free network cause weaker majority phases than the same conditions in the log-normal topology.  For even lower noise levels (0< h <600), the noise level is not enough to break many segregations. In this case, if a network is more segregated, it will more resist against opinion changes due to interactions. The mean value and standard deviation of EI indexes for measuring segregation of the N run networks used for simulation sample runs are shown in Table 3. The table shows scale-free networks are more segregated at the starting point of the simulation runs than the lognormal networks due to more negative values of EI indexes. Therefore, since the scale-free networks are more segregated than the log-normal networks, in the log-normal networks,  final is closer to 50% compared to the scale-free networks. In other words, starting from the same  values, scale-free networks results in a more majority phase in equilibrium.

6-Conclusion
This research considered the phase transition due to the various noise levels in the social impact model of opinion formation in the log-normal network topology. Phase transition in the scale-free network topology, with powerlaw distributed networks, has been considered in previous studies [12]. Since some recent studies have revealed that the log-normal networks are more realistic models for real world social networks, we considered the log-normal network in this study on phase transition in the social impact model of opinion formation.
The results show that the segregation phenomenon is a main parameter affecting the phase transition for different noise levels, the level of the stochastic behavior of the social system. Two main phases are possible: the majority and the non-majority. The non-majority phase happens when there is high enough noise levels and causes approximately the same population of both possible opinions in the equilibrium. The majority phase occurs in lower noise and no-noise level, where the segregation of opinion groups inhibits consensus to occur, but the more populated opinion group becomes larger, and the less populated group shrinks down. In this research, the log-normal network topology has also been compared with the scale-free network topology to study differences in phase transition behavior in both topologies based on EI index [52]. The experiments show that the scale-free networks are more segregated than the log-normal networks with the same number of nodes and edges. The more segregation in the scale-free topology causes more majority phases to occur in equilibrium in comparison with the log-normal topology, and weaker majority phases in some higher noise levels before enough high noise levels that cause non-majority phases. Similar to many other studies in the complutational social science, the results of this study help us to understand some real world social behaviors. However, future studies may focus more on the various parameters assumed in this research, including persuasiveness and supportiveness strengths, determining individuals" leadership power. Furthermore, we assumed a fixed network topology during any simulation repetition; however, combining the opinion dynamics with the dynamics of the network structure (changing network links) could be a challenge to be studied in the future. Moreover, the results of similar studies using traditional sociological tools could be very worthy to be compared with the results of this study.