Keywords

1 Introduction

The process of consensus formation in public opinion is at least partially believed to be impacted by social interactions. Individuals gather information about the world, other individuals, and societal structures through conversations with each other. They also learn about accepted norms and normative evaluations of individuals and situations through interactions with others. Through this process they ultimately form their own beliefs and opinions about relevant issues using social information as one of the inputs. People with differing points of view may reconcile their differences through conversation by either learning to adopt the other’s views, or convincing the other of one’s own or by resisting opinion change.

The Hegselmann-Krause (HK) model of opinion dynamics is a bounded-confidence model with continuous real-valued opinions [1]. Classically, the HK imposes a constraint that allows a listening agent to only consider other agents whose opinion falls within a distance of a boundary parameter (commonly denoted by ε) of the listening agent. The listening agent updates its opinion to the average value of the opinions of all such agents. Different system parameters and initial conditions can cause the HK system to produce consensus, polarization, or fractured states.

A number of theoretical properties of the HK model have been studied such as the probability [2] and kinetics of consensus [3], the role of noise [4, 5], heterogeneity in ε [6], adding more dimensions to the opinion space [3, 7], and how the presence of social network constraints influences dynamics [8]. Some other studies have extended the HK model by adding to the dynamics new features such as the presence of agenda-setting ‘leaders’ [9] or extremists [10].

We took a slightly different approach to advancing the HK model, by introducing an additional component to the dynamics that simulates the role of social identity groups on the asymptotic behavior of the system. Social Identity Theory (SIT) proposes that pairwise inter-personal interactions are relevant but insufficient to explaining the collective dynamics of a society, and that perceived group identities influence one’s behavior towards another [11]. Identities may help individuals understand and approximate a complex landscape of public opinion and interests by reducing nuances and variances into simplified labels. We aimed to study the relevance of social identities to polarization—a qualitative state of the system where the opinions of all agents tend to be split into two antagonistic camps—given its sociological significance as a commonly occurring state of public opinion [12, 13].

Both assumed (by the self) and perceived (of others) identities are known to influence one’s opinion. For example, a study by Wojcieszak and Garrett found that priming national identity, and exposure to anti-immigration news increases reported anti-immigration sentiment among anti-immigration participants [14]. We follow the Reinforcing Spirals Model [15, 16] in proposing that salience of social identity and the degree to which there exists closed vs open communication norms are major drivers of polarization in a dynamic model.

Consistent with SIT, we treat opinions and identities as interacting components of social behavior that are both relevant for dynamics. Therefore, we model the formation of social identities as an emergent process in the opinion space. Agents look at the entire opinion space to find groups of agents that are well-clustered, and assign identities to these clusters. Then they update their opinions using only the inputs from agents that are both within their own identity group, and also satisfy the HK opinion boundary. Our model thus assumes that social identity acts as an additional filter for agents as they select other agents to seek consensus with at each step. Therefore, an agent might ignore another’s opinion either because their opinions are too far from each other, or because they perceive the other agent to be in a different identity group. Importantly, identities are not pre-assigned to agents—rather they are inferred from the opinion positions of the entire population. Some agents may “see” different identity groups than others. Moreover, identity groups might evolve as opinions of agents evolve—as agents move through the opinion space the groups might merge, shift and break up.

We needed a plausible algorithm to dynamically assign agents to identity groups based on their opinion positions in the opinion space. For this, we needed to consider what conditions must be satisfied for agents to be said to form an identity group based on opinions. Firstly, for an identity group to be said to exist, there must be at least a few agents showing a high degree of proximity to one another in the opinion space. Secondly, for an agent to be considered as part of an identity group, she must demonstrate sufficient similarity to the identity group’s ideology. Thirdly, the identity group must not only be defined by the proximity of the opinions of its own members, but must also be sufficiently far from agents it excludes. In other words an identity group isn’t defined just by the oneness of its members, but must also take into account the otherness of agents it excludes.

Our algorithm for identity group detection follows a similar logic as detailed above. Identity groups are detected in the opinion space by considering only those agents that have enough sufficiently like-minded agents in the opinion space. In this subset of non-isolated agents, the detector applies a Louvain Community Detection (LCD) [17] algorithm, which is our implementation of a general mechanism that lets agents automatically detect the existence of identity groups from information about the spread of opinions in the population.

An important parameter in the process above controls what we mean by “sufficient like-mindedness” in the filtering step. We call this parameter “Salience of Proximity in Identity-Relevant Opinions” (SPIRO), since it defines which pairs of agents are close enough in opinion space to be relevant for LCD, and treat it as an experimental variable. SPIRO is a property of the detector—as agents look around in the opinion space and detect identity groups, they may be differentially sensitive to agents clustering close together.

In this article we present five hierarchically related models, of which the last two include social identity effects. We do this to introduce not only our implementation of social identity, but also other model features and variables we believe may have interesting effects alongside identity. In Sect. 2 we discuss our methods, including their components (Sect. 2.1), the model variants (Sect. 2.2), and our variables of interest (Sect. 2.3). In Sect. 3 we present evidence that the presence of identity drives polarization, along with some preliminary results involving other variables. In Sect. 4 we interpret these data and present plans for future work with these models.

2 Methods (Code and Data are Available [18])

2.1 Model Components

Hegselmann-Krause Dynamics with conformity. An agent’s opinion is represented as a real number between − 1 and + 1, implemented at the resolution of 3 decimal places. Opinions of all agents are updated at every time-step based on their previous opinion and the opinions of influencers according to the rule:

$$o_{i} \left( t \right) = { }o_{i} \left( {t - 1} \right){ } + { }\alpha_{i} \left[ {\frac{1}{{\left| {N_{i} \left( t \right)} \right|}}\mathop \sum \limits_{{j{ } \in { }N_{i} \left( t \right)}}^{{}} o_{j} \left( {t - 1} \right){ } - o_{i} \left( {t - 1} \right)} \right]$$
(1)

where,

  • \(o_{i} \left( t \right) \in \left[ { - 1, + 1} \right]\) is the opinion of agent \(i\) at time \(t\).

  • \(\alpha_{i} \in \left[ {0, 1} \right]\) is the conformity parameter, it controls how quickly agent \(i\) moves towards the found consensus.

  • \(N_{i} \left( t \right)\) is the neighborhood of agent with index \(i\) at time \(t\).

    $$N_{i} \left( t \right) = \{ j:\left| {o_{j} \left( {t - 1} \right) - o_{i} \left( {t - 1} \right)} \right| \le \varepsilon_{i} \}$$
    (2)

\(\varepsilon_{i} \in \left[ {0, 1} \right]\) is the boundary parameter and tells us the maximum dissimilarity in opinion agent \(i\) can accommodate. Note that \(\varepsilon_{i}\) is normalized—it is measured as a fraction of the maximum possible distance, i.e. \(\varepsilon_{i} = 1\) means that agent \(i\) with opinion \(o_{i} = - 1\) also takes into account agent j with opinion \(o_{j} = + 1\).

Thus \(N_{i} \left( t \right)\) is the set of all agents (including the listening agent itself) whose opinion fall within a distance of the boundary parameter \(\varepsilon_{i}\) of the listening agent.

Social Identity Boundary. In the model with social identity, an agent only listens to another agent who additionally also shares the same identity group as oneself at each time step.

Let \(Id_{i} \left( t \right)\) represent the index of the identity group of agent i at time t. Therefore, the neighborhood of an agent \(N_{i} \left( t \right)\) is redefined as:

$$N_{i} \left( t \right) = \{ j:\left| {o_{j} \left( {t - 1} \right) - o_{i} \left( {t - 1} \right)} \right| < \varepsilon_{i} \} \cap \left\{ {j:Id_{j} \left( t \right) = Id_{i} \left( t \right)} \right\}$$
(3)

Identity Group Assignment. The identity groups are dynamically updated at every time step as follows:

Firstly, we convert the opinion space into an equivalent weighted full network (the ‘Proximity Network’) by representing each agent by a node creating a weighted link between every pair of agents. The weight of each link is given by:

$$w_{{i,{ }j}} \left( t \right) = 1 - d\left( {o_{i} \left( t \right),\,o_{j} \left( t \right)} \right)$$
(4)

where,

\(w_{i, j} \left( t \right) \in \left[ {0, 1} \right]\) is the weight of the link between nodes i and j at time t.

\(d\left( {a, b} \right)\) is the Euclidean distance between points a and b in the opinion space, normalized by the maximum theoretical distance in the opinion space. Therefore,

$$d\left( {o_{i} \left( t \right),\,o_{j} \left( t \right)} \right) = \frac{{\left| {o_{i} \left( t \right) - o_{j} \left( t \right)} \right|}}{2}$$
(5)

Thus a weight of 1 means the two linked agents have identical opinions, while a weight of 0 means they are maximally dissimilar.

We then perform community detection on a subset of the Proximity Network, keeping only edges of sufficient weight and nodes sufficiently connected by such edges. We use a SPIRO-thresholded definition of which edges’ weights are sufficient, and we keep only nodes connected by 2 or more such edges, along with only edges of sufficient weight to these nodes. We then perform LCD on this sub-graph. In practice, “sufficiently connected” edges are edges whose weight in the Proximity Network equals or exceeds the perceiving agent’s SPIRO value. Thus, higher SPIRO values would mean we tend to return fewer nodes and links after these reduction steps.

In order to ensure every agent is assigned to an identity group, we follow up LCD with k-means clustering as follows—we consider the number of detected communities after SPIRO-thresholding and LCD on the Proximity Network, and compute the opinion centroid of the set of agents corresponding to each community. We use the number of communities and the centroids thus found as initial values to the k-means clustering algorithm which is performed on the entire agent population (including those excluded before LCD). Every excluded agent is initially assigned to the cluster whose centroid is closest to it. k-means clustering is repeated on the opinion space thereafter until the centroids converge. Thus, every agent is assigned to an identity group.

Global versus individual detection of identity groups. We wanted to simulate the possibility of different agents being differently sensitive to identity-related information from the opinion space—in our model this translates to agents having different SPIRO values (see Sect. 2.2, model VBVI). Implementing this directly would mean running the Louvain algorithm several times at every time step, making the simulation computationally very expensive. To make the process more efficient, we segmented the agent population into eight partitions, each having its own pre-defined SPIRO value. Although the number and index of the agents assigned to each partition may vary across simulations, every partition—and therefore every agent—can take on SPIRO values only from the set: {0.15, 0.25, 0.35, 0.45, 0.55, 0.65, 0.75, 0.85}.

To determine which agent gets assigned to which SPIRO value, we implemented an approximation of a discrete normal SPIRO distribution as follows: During simulation set up, every agent samples a value \(x_{i}\) from a normal distribution with mean \(\mu_{SPIRO}\) and standard deviation \(\sigma_{SPIRO}\). If \(x_{i} \notin \left[ {0, 1} \right]\), its sampling is repeated until \(x_{i} \in \left[ {0, 1} \right].\) The SPIRO of the agent i is given by the closest possible value to \(x_{i}\) from the set of valid SPIRO’s given above.

2.2 Model Variants

We ran 2,504,964 simulations in total spanning 5 variants of the HK model. The models are described:

Deterministic Start HK Model (DHK): Initial opinions of agents are a set of evenly spaced real numbers between [− 1, + 1]. Agents have the same confidence boundary \(\varepsilon\).

Randomized Start HK Model (RHK): Initial opinions of agents are uniformly distributed real values in the interval [− 1, + 1]. Agents have the same confidence boundary \(\varepsilon\).

Heterogeneous Boundary Model (VB): Agents have individualized confidence boundaries and conformities. The confidence boundary \(\varepsilon_{i}\) of an agent is obtained from a truncated normal distribution as follows: Every agent samples a value \(\varepsilon_{i}\) from a normal distribution with mean \(\mu_{\varepsilon }\) and standard deviation \(\sigma_{\varepsilon }\). If \(\varepsilon_{i} \notin \left[ {0, 1} \right]\), its sampling is repeated until \(\varepsilon_{i} \in \left[ {0, 1} \right]\). \(\alpha_{i}\) is also sampled with an identical method as \(\varepsilon_{i}\), with mean \(\mu_{\alpha }\) and standard deviation \(\sigma_{\alpha }\).

Heterogeneous Boundary with Identity (VBI): Agents only communicate within their identity groups, which are assigned at the beginning at every time-step via a common identity group assignment step as outlined in Sect. 2.1. This assignment is parametrized by the common SPIRO value, which determines the tightness of identity groups thus formed.

Heterogeneous Boundary with Heterogeneous Identity (VBVI): Agents only communicate within their perceived identity groups, but they may be inconsistent across agents. This is done by relaxing the assumption of a single SPIRO value for the entire population as follows:

  1. 1.

    At the beginning of the simulation all agents are assigned an individualized SPIRO value as described in Sect. 2.1. This is done to allow for heterogeneous identity effects while keeping the model computationally efficient.

  2. 2.

    At the beginning of every time step, one instance of the identity group assignment step outlined in Sect. 2.1 is run for each partition.

  3. 3.

    The detected identity groups for each partition are then inherited by each agent within the partition. Thus, all the agents in a partition perceive a common set of identity groups.

The above models are hierarchically related, in that every subsequent model in the list above inherits features of the previous models (exception: RHK does not inherit the regularly-spaced initial opinion space condition from DHK). Therefore, VBI and VBVI both have normally distributed \(\varepsilon\) values for instance. We ran each simulation for 365 time steps, or until consensus is reached, whichever is earlier.

2.3 Variables

Independent Variables. Besides \(\mu_{\varepsilon }\), \(\sigma_{\varepsilon }\), \(\mu_{\alpha }\), \(\sigma_{\alpha }\), \(\mu_{SPIRO}\), and \(\sigma_{SPIRO}\) which are defined in Sects. 2.1 and 2.2, we also included the following two variables in our experimental design since we were also interested in studying some robustness properties of the HK model for a related study:

Evenness or Oddness of population size: Population size is either N = 100 or N = 101.

Randomness of initial opinion distribution: The initial opinion of agents is either drawn uniformly at random (Random_start? = TRUE), or can assume equally spaced out values in the interval of [− 1, + 1] (Random_start? = FALSE).

Note: in models with no variability of some parameter p, \(\mu_{p}\) stands in for the common value of p.

Dependent MeasurePolarization. To measure polarization we adapt the Equal Size Binary Grouping (ESBG) algorithm from Tang et al. [19], which gives a continuous-valued metric we call ESBG Polarization, or just ESBG. The ESBG measure is based on the ideal type of maximally polarized community. Such a community is divided in two camps of equal size. These camps are very homogenous, i.e. opinions of camp’s members are the same, but these camps are on opposite poles of opinion scale, i.e. the distance of camps in opinion space is maximal. To reflect this ideal type, ESBG firstly divides the population in two groups by a specific version of k-means clustering algorithm. This algorithm divides the population in two groups of equal size, but on the other hand it minimizes opinion heterogeneity of these forcibly created groups. Then ESBG computes distance of group centroids and mean deviation of groups’ members’ opinions around respective centroids. Then ESBG value is computed as centroids’ distance divided by sum of 1 and mean deviations of both clusters. Centroids’ distance and mean deviations of both clusters are normalized by maximum possible distance which ensures that the resulting ESBG is between 0 and 1, where 0 signifies perfect consensus and 1 signifies complete polarization.

$$ESBG = \frac{Norm\left( B \right)}{{1 + Norm\left( {w_{1} } \right) + Norm\left( {w_{2} } \right)}}$$
(6)

where,

$$Norm\left( x \right) = \frac{x}{{\sqrt {4 \times Number\,of\,Opinion\,Dimensions} }} = \frac{x}{2}{ }$$
(7)

\(B\) = Absolute distance between the two cluster centroids

\(w_{i}\) = Total mean deviation of agent opinions of cluster i from its centroid

Analysis: We performed multiple regression for our dependent measure on the experimental variables of interest: \(\mu_{\varepsilon }\), \(\sigma_{\varepsilon }\), \(\mu_{\alpha }\), \(\sigma_{\alpha }\), \(\mu_{SPIRO}\), \(\sigma_{SPIRO}\), Evenness of Population Size, and Randomness of initial opinions. To avoid making assumptions about linearity of relationships we treated each variable as a factor. In our results section we report mean ESBG value of all simulations run for a given combination of variables.

3 Results

The relationships between polarization and \(\mu_{\varepsilon }\) of each of our models show qualitative differences (Fig. 1). Firstly, we observe that the two models with dynamically updated identity groups (VBI and VBVI) maintain polarized states for much higher values of \(\mu_{\varepsilon }\) than the other models. Secondly, we observe the lowest polarization in the Heterogeneous Boundary Model (VB), the difference in polarization is striking and significant especially for lower values of \(\mu_{\varepsilon }\) (approximately in interval 0.10–0.23). Thirdly, we observe the effect of deterministic starting conditions: polarization produced by the DHK model in response to \(\mu_{\varepsilon }\) values qualitatively dramatically differs from all other models based on or employing random start conditions. Fourthly, we observe that \(\sigma_{SPIRO}\) has a negligible effect—models VBI and VBVI differ just slightly and they reach maximal difference only for the highest investigated value of \(\mu_{\varepsilon }\). Fifthly, we observe that \(\mu_{\alpha }\) and Size of Population (N) have effect on models not employing heterogenous Boundary (DHK and RHK), models VB, VBI and VBVI seem to qualitatively keep their behavior despite the values of \(\mu_{\alpha }\) and N.

Fig. 1
figure 1

ESBG-\(\mu_{\varepsilon }\) relationship for each model. Panels represent different conditions of population evenness and conformity. Ordinate in each panel is the Mean ESBG at the end of all simulations with the given parameter combination

Here we report that evenness appears to drive a qualitative change in the Polarization-Boundary relationship only when the initial condition is not randomized (DHK). We originally investigated the effect of population size. We surprisingly found that size itself does not matter much, but what matters for DHK was whether the population size is even or odd. For example, even for DHK it had almost no effect whether the size of population was 20, 100, or 256 agents, but it had a substantive effect whether the size was 21 instead of 20, or 101 instead of 100, or 257 instead of 256 agents. For the final presentation of our analyses in this paper we chose N = {100, 101}, since these sizes spot the effect of evenness and are heavily used in the canon of literature. We intend to explore this methodological issue further in a subsequent paper (in preparation).

Mean ESBG polarization differs across our models in the following way: VB < DHK < RHK < VBVI < VBI (Table 1). The two models with identity in them have the highest mean polarization—showing that identity drives polarization and impedes consensus. In all the models, \(\mu_{\varepsilon }\) is negatively associated with polarization as expected (Table 2).

Table 1 Summary statistics for ESBG in different models
Table 2 Regression on ESBG in model VBVI. (N = 460,800)

A consistent finding throughout our analyses is that higher \(\sigma_{\varepsilon }\) brings down polarization dramatically (Table 2), and its influence is stronger than that of the mean boundary. This is also evident in Figs. 2 and 3. We interpret this as an unbalanced mitigating influence of agents with higher-than-average boundaries (see discussion). \(\sigma_{SPIRO}\) also lowers polarization, although far not as strongly as \(\sigma_{\varepsilon }\).

Fig. 2
figure 2

ESBG-\(\mu_{\varepsilon }\) relationship for model VBVI for different values of \(\mu_{SPIRO}\). Panels represent different values of \(\sigma_{\varepsilon }\)

Fig. 3
figure 3

ESBG-\(\mu_{SPIRO}\) relationship for model VBVI for different values of \(\mu_{\varepsilon }\). Panels represent different values of \(\sigma_{\varepsilon }\)

The main drivers of polarization are \(\mu_{SPIRO}\), \(\sigma_{\varepsilon }\), and \(\mu_{\varepsilon }\). This can also be seen in Figs. 2 and 3 for a model with heterogeneous identity (VBVI). Interestingly however, \(\mu_{SPIRO}\) systematically modulates the relationship between \(\mu_{\varepsilon }\) and polarization (Fig. 3). For \(\mu_{SPIRO}\) values from 0.25 to 0.61, \(\mu_{SPIRO}\) is positively associated with polarization across boundary values. However, polarization decreases when \(\mu_{SPIRO}\) is raised from 0.61 to 0.73 and 0.85. We interpret this as a consequence of the dominant system dynamics transitioning from polarized state to fractured state for the highest \(\mu_{SPIRO}\) values (see Sect. 4).

4 Discussion and Future Work

In this work we implemented a novel algorithm for dynamic detection of identity groups based on their opinions. In recognition of the common observation that people differ in their judgements on how many partisan groups there are in a society, and which individual belongs to which group, we parameterized our implementation of identity with the variable we call SPIRO.

SPIRO determines how closely a pair of agents must be to be considered for identity group detection. Through visual inspection of the course of the models’ runs, it appears that higher SPIRO values (0.73 and 0.85) causes the opinion space to be split into more identity groups. The effects of these parameters will be explored in detail elsewhere (in preparation). In our last model we allow SPIRO to vary across agents to account for people perceiving different sets of identity groups around them. This makes our model more realistic, while being computationally efficient due to our method of partitioning.

Through our analysis of the behaviors of our models, we are able to determine which experimental variables in our different models are the most relevant for polarization. We find that models with identity exhibit a higher average polarization across their different experimental conditions than models without identity. We also find that introducing heterogeneity in both Boundary and SPIRO in our model lowers polarization overall. This is admittedly a simplistic way of analyzing the effects of identity and heterogeneity. We will dive deeper into the role of these model features in a future article.

We also observe that the influence of identity on polarization depends on the SPIRO value of the agents. For moderate values of mean SPIRO, polarization monotonically increases with SPIRO. However, the highest two SPIRO values we have considered here show a deviation from this trend and show reduced polarization. Since the ESBG algorithm privileges bi-polarization over fractured states with multiple tight clusters, this can be explained by a fracturing of the agent population into several opinion camps. This is another aspect of our analysis that we will discuss in more detail in a future work.

Going forward, we will also be looking at the effect of heterogeneity of boundary and SPIRO on the behavior of the system. Previous studies have looked at the influence of boundary heterogeneity on consensus [20] and the number and size of opinion clusters [6, 21]. Consistent with these studies we find that heterogeneous ε causes the system to tend towards less polarized states, possibly towards consensus. This is likely due to the possibility that agents with above-average ε act as bridging agents due to their openness to a wider range of opinions, while the agents with below-average ε might not have much of an influence on the system dynamics. We purport a similar mechanism might be at play in the case of the heterogeneous SPIRO model—variance in group classification might lead to less clearly defined identity bubbles, which would allow some agents to act as bridges between clusters that emerge due to identity effects.