Classification-Based Opinion Formation Model Embedding Agents’ Psychological Traits

: We propose an agent-based opinion formation model characterised by a two-fold novelty. First, we realistically assume that each agent cannot measure the opinion of its neighbours about a given statement with infinite resolution and accuracy, and hence it can only perceive the opinion of others as agreeing much more , or more , or comparably , or less , or much less (than itself) with that given statement. This leads to a classification-based rule for opinion update. Second, we consider three complementary agent traits suggested by significant sociological and psychological research: conformism , radicalism and stubbornness . We rely on World Values Survey data to show that the proposed model has the potential to predict the evolution of opinions in real life: the classification-based approach and complementary agent traits produce rich collective behaviours, such as polarisation, consensus, and clustering, which can yield predicted opinions similar to survey results.

Agent-based models (ABMs), such as the French-DeGroot model [4], are very common in the opinion formation literature.In an ABM, every individual holds a different opinion (or vector of opinions) and interacts with the other agents according to a given function over a network that can be directed, weighted, or signed.Some notable examples of agent-based models are those by [30], [31], and [32], among many others [33,34,35,36,37].An extensive literature [38] proposes and analyses opinion formation models for different types of agent interactions and network characteristics.
This paper proposes an agent-based model characterised by two novel features.
1.Even if the agents communicate, and openly express their real opinion, it is impossible for an agent to exactly measure and quantify the opinion of another.Therefore, the model introduces a classificationbased approach, supported by the empirical finding that the assessment of the opinion of others depends on the perceived distance to those others [26]: each agent classifies its neighbours in different groups according to their perceived opinion, distinguishing between those that agree much more, or more, or comparably, or less, or much less (than itself) with a given statement.
The fact that agents don't have access to the exact opinion of their neighbours with infinite resolution and accuracy has been taken into account by models with quantised opinions [39,40], while threshold models [41,42] could be seen as adopting a classification approach because the opinion update law depends on the number of neighbours expressing a particular opinion or action.Our classification-based approach is based not on the opinion of an agent's neighbours, but on the weighted difference between the opinion of the agent and of its neighbours, accounting for the finite resolution with which agents perceive the opinions of their neighbours.Also in opinion formation models with private and public opinions [43,44,45,23,46] the agents cannot have perfect access to the real opinion of their neighbours.However, there is a critical difference.In these models, the agents can choose which public opinion they show, with certainty that it will be the opinion perceived by others, and hide their true private opinion: the misperception is intentional.Conversely, in our model, the misperception is unintentional and unavoidably caused by the inability to communicate with infinite accuracy: the agents wish to show as openly as possible their opinion, which still cannot be perceived with infinite resolution, and the other agents can only perceive the range in which the opinion falls, which depends on both the agent that expresses the opinion and the one that assesses it.Therefore an agent cannot know with certainty how its opinion is perceived by others.Also in the Continuous Opinions and Discrete Actions model [47], the mismatch between real and perceived opinions is intentional and due to the agents purposefully hiding their actual opinion to others (each agent controls the action it takes and consequently how its opinion is perceived by its neighbours), while in the classification-based model the mismatch is due to the intrinsically imperfect perception mechanism.
To reflect imperfect communication in the model, our proposed solution of classifying the opinion of others in one of five categories is inspired by the field of psychometrics: in questionnaires, the responses quantify opinions according to discrete scales.Likert scales are a standard psychometric scale used to analyse surveys, which in turn are the typical approach to measure the opinions of individuals in a population.In our model, the process of agent i assessing the opinion of agent j yields, at each time step, the answer to a five-point Likert question, which asks how much agent j agrees with a statement, compared with agent i, where the possible answers are: Agrees much more, Agrees more, Agrees the same, Agrees less, and Agrees much less.For certain specific questions and specific social groups and connections, the perception may be sharper, while in other cases it may be less sharp; also, some agents may have a sharper perception than others.Five levels are chosen as a compromise resolution to account for the perception skills of the average agent interacting with an average neighbour.Still, the model could be modified to consider more than five levels, thus accounting for agents with a sharper average perception, and differentiating the sharpness of perception for different agents could also be interesting; however, this goes beyond the scope of the manuscript and is left for future work.
2. Each agent behaves according to a combination of three internal traits based on well studied sociological and psychological concepts: conformisms, radicalism, and stubbornness.
• Conformism: agents tend to agree with their neighbours.This behaviour was first shown in the conformity experiment by [48,49,50] and evolved into social conformity theory [51].A similar behaviour is supported by the cognitive dissonance theory [52,53].• Radicalism: agents do not care if their opinion is different from their neighbours'.On the contrary, their opinion is strengthened by the presence of agents with a similar opinion, which reinforce their beliefs; this is known as the persuasive argument theory, which supports several polarisation models [54,55,56,21,57].• Stubbornness: agents refuse to change their opinion; this type of behaviour has been often present in opinion formation models starting from those by [6,58].
In the model, the behaviour of each agent is determined by a combination of these three traits: in fact, actual people are not completely conformist, radical, or stubborn, but everyone is characterised by a peculiar blend of these three traits.The inclusion of the radical trait can be seen as an extension of the model by [6,58], which includes both conformist and stubborn traits.
The proposed model evolves over an invariant, directed, signed and unweighted network.Signed edges are interpreted as in structural balance theory: an edge from agent j to agent i is positive if agent i approves, trusts, or follows agent j, whereas it is negative if agent i disapproves, distrusts, or antagonises agent j [59,60,61].
Despite significant research efforts in the development and analysis of opinion formation models, empirical validation is often lacking, and has been identified as one of the frontiers of opinion modelling [62].In most cases, just an analytical or numerical characterisation of possible opinion evolutions is provided and, with some exceptions (most notably the model by [6,58]), there are no systematic comparisons with real world behaviours.
The problem of identifying individual-level parameters (in our case, agent inner traits) from populationlevel data (in our case, survey results) is known as the inverse problem [63] and arises, in the context of opinion dynamics, for any agent-based model, also when estimating agent interactions [64] and underlying networks [65] from data.An approach to solve the inverse problem using survey results relies on evolutionary algorithms [23]; other papers taking into account survey results or empirical data in the study of opinion formation models include those by [22,24,25,47].
Here, we assess the potential of our model to predict opinion evolution in real-life settings using data from the World Values Survey [66,67], a global research project that studies people's values and beliefs over time, conducting surveys every five years.The results of these surveys are classified by 'waves'.We use the results from wave 5 (year 2010) and wave 6 (year 2015).The answers of wave 5 are used as initial opinions that are evolved, according to the model dynamics, so as to produce predicted opinions that are compared with the survey results from wave 6.Our main purpose is to present a new opinion formation model; through the comparison with real data, we identify parameter choices showing that the model has the potential to accurately predict real opinions starting from a variety of different initial opinions, but this does not fully or univocally solve the inverse problem [63].
The paper is structured as follows.First, it introduces the model and its key parameters.Then, five types of simulation results are presented: simulations with simple parameters and digraphs, to gain intuition on the model behaviour; parameter sensitivity analysis, to explore the effect of different parameters on the opinion evolution; model validation with real data, to assess the predictive potential of the model by choosing the parameters through either a free or a constrained optimisation problem; a comparison with the Friedkin-Johnsen model [6,58]; and qualitative model outcomes, illustrating the rich and varied opinion distributions that the model can yield.

The Classification-Based Model
In our proposed classification-based (CB) model, the set V = {1, 2, . . ., n} indexes the agents.The opinion of agent i ∈ V at time k, representing its level of agreement with a statement, is denoted by . The opinions x i = 1, x i = 0, and x i = −1 represent complete agreement, indifference, and complete disagreement respectively.The vector of all opinions at time k is denoted by x[k].
The agent opinions evolve in time due to opinion exchanges occurring over a signed digraph, represented by the matrix W ∈ {−1, 0, 1} n×n , whose entries are constant and, in particular, not opinion-dependent.The self-confidence of each agent is expressed by w ii = 1 for all i.The coefficient w ij represents the influence of agent j over agent i.If w ij = 0, then agent i is not influenced by agent j.If w ij = 0, then agent j is a neighbour of agent i: w ij = 1 means that agent i approves, trusts, or follows agent j, while w ij = −1 means that agent i disapproves, mistrusts, or antagonises agent j.Signed edges have been interpreted in the opinion formation literature in terms of either cooperative/antagonistic interactions [59], trust/mistrust [60], or approval/disapproval [61].In our model, if w ij = 1 (respectively w ij = −1), then agent i perceives the opinion of agent j as x j (resp.−x j ).The set of neighbours of agent i ∈ V is The agent opinions evolve in discrete time and the opinion update relies on the assumption that agents cannot determine their neighbours' opinions precisely.Instead, each agent can classify its neighbours according to how close their perceived opinion is to its own opinion.For instance, if agent j influences agent i, and x i = 0.61 and x j = 0.34, then it is unrealistic to expect agent i to know exactly the opinion of agent j, or to assume that agent i knows that the opinion difference is exactly 0.27.However, agent i can perceive that agent j agrees less than itself.On the contrary, if x j = 0.89, agent i can perceive that agent j agrees more than itself.
Therefore, agent i can at most classify agent j according to an estimation of ∆ ij , which is the weighted difference between its opinion x i and the opinion of agent j, x j : ∆ 2] in five equal subintervals.Then, depending on the subinterval to which ∆ ij belongs, agent i can perceive that agent j: (1) agrees much more, (2) agrees more, (3) agrees comparably, (4) agrees less, or (5) agrees much less with the statement; see Figure 1.If w ij = −1, then agent i disapproves/mistrusts/antagonises agent j, therefore the weighted opinion difference is ∆ then agent i approves/trusts/follows agent j and the weighted opinion difference is ∆ 2].The combined effect of signed edges and neighbour classification leads to a three-step process: first, agent i perceives the opinions of its neighbours; then, the opinions of neighbours that agent i disapproves, mistrusts, or antagonises have the sign reversed; finally, the neighbours are classified according to the adjusted perceived opinion distance.The set N i of all the neighbours of agent i is thus partitioned into five time-dependent subsets: , which contain the neighbours that agree much less, less, comparably, more, and much more, respectively.Mathematically these subsets are defined as . The cardinality of these sets has the following interpretation: number of neighbours that agent i perceives as agreeing much less than itself at time k |D i [k]| = number of neighbours that agent i perceives as agreeing less than itself at time k number of neighbours that agent i perceives as agreeing the same as itself at time k number of neighbours that agent i perceives as agreeing more than itself at time k number of neighbours that agent i perceives as agreeing much more than itself at time k The overall behaviour of each agent results from the combination of three complementary inner traits: conformism, leading the agent to agree with its neighbours; radicalism, driving the agent to reinforce its opinion; and stubbornness, anchoring the agent to its current opinion.The conformism, radicalism and stubbornness degree of agent i is respectively denoted by α i , β i and γ i .The parameters ψ i = (α i , β i , γ i ), quantifying the inner traits of agent i, satisfy α i , β i , γ i ∈ [0, 1] and α i + β i + γ i = 1 for all i.We call inner traits assignation the collection of inner traits of all agents, ψ (ψ i ) i∈V .The model features are summarised in Figure 2.
The opinion change ∆x i [k] of agent i at time k is thus the convex combination of the behaviour of a purely conformist, purely radical, and purely stubborn agent, with f con i , f rad i , and f stb i taken as where λ, ξ, and µ are positive parameters: λ weighs the overall opinion change magnitude, ξ weighs the increased influence that neighbours with distant opinions have over conformist traits, and µ weighs the influence of the agent's own opinion in radical traits.We call these opinion evolution parameters: Ω = (λ, ξ, µ).
To better understand Equations (4) and choose reasonable values for the parameters, one can think of how an extreme agent (α i = 1, or β i = 1, or γ i = 1) behaves.
• A purely conformist agent (α i = 1, β i = 0, γ i = 0) evolves towards an opinion comparable to that of its neighbours.For instance, if N i = N i (all the neighbours of agent i agree comparably), then agent i does not change its opinion.If A i = N i (all the neighbours of agent i agree more), agent i increases its opinion x i by λ; given that all the neighbours of agent i are in the set A i , a value λ = 0.4 guarantees that, if all the neighbour opinions remain unchanged, then at the next time step all the neighbours of agent i will be in the set N i , hence perceived as having a comparable opinion.Instead, if A + i = N i , then the opinion of agent i needs to increase 0.8 = 2λ in order to be perceived as comparable to its neighbours' at the next time step, and therefore a natural choice is ξ = 2.The same reasoning can be applied to the sets D i and D + i .• A purely radical agent (α i = 0, β i = 1, γ i = 0) ignores neighbours with a different opinion and only cares about agents that think comparably to itself, hence it reinforces its current opinion x i [k] depending on the magnitude of its own opinion and on the fraction of its neighbours in the set N i .To make sure that radical traits can affect the opinion change more strongly than conformist traits, we need µ > 1.In fact, if µ = 1, then | in general: the opinion change caused by the radical trait (which is proportional to x i [k], and |x i [k]| ≤ 1) is smaller in magnitude than the one caused by the conformist trait.In our simulations, we set µ = 5.The effect of different values of µ can be seen in Table 7.
The new opinion of agent i at time k + 1 is the sum of the previous opinion x i [k] and the opinion change ∆x i [k], modulated by the saturation function σ so as to guarantee that the opinions remain in the interval [−1, 1].The complete opinion update law is therefore

Model Parameters
The Classification-Based (CB) model has three types of parameters: the signed digraph weights w ij ; the inner traits assignation ψ i = (α i , β i , γ i ); and the opinion evolution parameters Ω = (λ, ξ, µ) = (0.4,2, 5) whose values are fixed, and chosen based on the model interpretation.Later, a parameter sensitivity analysis explores how the model evolution is affected by changes in opinion evolution parameters.
If the model has n agents, then: • The signed digraph has weight matrix W ∈ W n .In general, W n = {−1, 0, 1} n×n , but we can focus for instance on small-world, or strongly connected, networks.
• The inner traits assignation is ψ ∈ A n , where We omit the subscript n from the sets W and A for simplicity.Given n agents, a signed digraph W ∈ W, an inner traits assignation ψ ∈ A, and a vector of initial opinions x[0], the opinion formation model evolves according to Equation (6).The vector x[K] of opinions after K iterations can be explicitly represented as a function of W , ψ, and x[0] by the map F Ω (x[K] also depends on Ω, whose value, given by the model interpretation, is fixed) as The value of K depends on the type of statements and the prediction horizon.For statements related to core values or beliefs, opinions are not expected to change very fast and one could consider roughly 10 changes per year.Therefore, if the model is used to predict the opinions after 5 years, K = 50.On the other hand, the opinions on more superficial topics could change faster and, over the same 5-year timespan, it could be K = 500.See Figure 2 for a summary of the model parameters and features.
Figure 2: Visualisation of the model features and parameters.The model has three parameter types: inner traits assignation ψ (in green), opinion evolution parameters Ω (in magenta), and signed digraph weights W (in red).These parameters appear in the Opinion Update Law of Equation ( 6), which is a convex combination of contributions by conformist, radical, and stubborn traits, with the opinions of neighbouring agents evaluated through a classification-based approach.Given the initial conditions x[0] and the number K of iterations over the prediction horizon, the Opinion Update Law produces the final predicted opinions ỹ = x[K].The opinion evolution parameters Ω can be fixed based on the model interpretation.Then, the final predicted opinions in each particular case are a function x[K] = F Ω (x[0], W, ψ, K) of the chosen initial opinions, signed digraph weights, inner traits assignation, and number of iterations in the prediction horizon.
To validate the model -namely, assess its potential to closely reproduce the evolution of opinions in real life with suitably chosen parameters -we consider real initial and final opinions, denoted by x and y respectively, taken from survey data.Assuming that y are the real opinions K iterations after the real initial opinions x, these data can be used to find values of the model parameters (edge weights W and inner traits ψ) that match as closely as possible the real opinion evolution, through the minimisation problem ( W , ψ) = arg min where the cost function J(y, ỹ) = n i=1 |y i − ỹi | quantifies the mismatch between opinion vectors y and ỹ.If the same population is asked to quantify the agreement with Q different statements, the signed digraph cannot change.However, the inner traits assignation can vary depending on the statement, since each individual may have different attitudes towards different topics.Therefore, if ψ (l) represents the inner traits assignation associated with statement l, values for the parameters W and (ψ (l) ) Q l=1 that produce predicted opinions as similar as possible to the real ones can be found through the free optimisation problem where x l and y l are the known initial and final opinions related to statement l.
If instead all the inner traits assignations are constrained to be the same for every question, we consider the constrained optimisation problem The free optimisation problem, where the inner assignations can change, allows for a more thorough study of the behaviour of a population, while the constrained optimisation problem allows for a more rigorous testing of the prediction capabilities of the model in the form of cross-validation: the answers to some questions can be used as training datasets to choose the model parameters, and the model performance can then be tested on the remaining questions.

Simulation Results
To gain insight into the classification-based (CB) model, this section presents five different types of simulation results: 1) Simulations in Simple Cases evolve the model in simple, special cases to gain intuition into its behaviour; 2) Parameter Sensitivity Analysis studies how changes in each of the model parameters (inner traits assignation, signed digraph, opinion evolution parameters) affect the model behaviour; 3) Model Validation with Real Data leverages real data from the WVS to show that the CB model has the potential to reproduce the time evolution of real opinions in society (with parameters chosen through the free and the constrained optimisation problems of Equations ( 10) and ( 11) respectively) and presents the transitions between different qualitative types of opinion distributions, such as Perfect Consensus, Consensus, Polarization, Clustering, Dissensus, based on the recently proposed transition tables [68]; 4) Comparison with the Friedkin-Johnsen (FJ) Model investigates the relation between the two models and their predictive capabilities (first, evolving equivalent populations; second, solving the optimisation problems (10) and (11); and third, computing the corresponding transition tables); 5) Model Outcome Capabilities explores the rich variety of opinion vectors that the CB model can produce.
Due to the deterministic nature of the model, running it with the same initial opinions, inner traits, and interconnection network always produces the same results.Given a parameter constellation and a network, the model evolution could only change due to different initial conditions (see the repeated model runs in Figure 6).
To facilitate the interpretation of simulation results, we introduce some definitions.Given the inner traits assignation ψ = (ψ i ) i∈V = (α i , β i , γ i ) i∈V , the associated average inner traits ψ = (ᾱ, β, γ) where ᾱ = 1 n represent the traits of an average agent in the considered society or population with n = |V | agents.inner traits assignation ψ and the corresponding average inner traits ψ can be plotted in a ternary diagram as shown in Figure 3a.The general agreement of an opinion vector x = (x i ) n i=1 , quantified by the pair (θ + , θ − ) where is the overall level of agreement and disagreement in the whole society.Figure 4a shows the histograms corresponding to 5 different opinion vectors and their corresponding agreement plot.The agreement plot, (i.e., the plot in the Cartesian plane of one or more general agreements) can be used to represent not only single opinion vectors, but also sequences of opinion vectors, resulting in a parametric curve of the opinion evolution, as shown in Figure 4b.All the simulations involve a population of 100 agents.All the digraphs used in both Parameter Sensitivity Analysis and Model Validation with Real Data have a small-world network topology, with an assigned probability for positive and negative edges, and are strongly connected.We consider small-world networks because they have a high clustering coefficient (neighbours of neighbours of agent i are likely also neighbours of agent i) and low diameter (maximum distance between two agents of the network), which are believed to be characteristics of real-life social networks [69,70].The directed small-world networks were built based on the Watts-Strogatz algorithm.Appendix A describes the computation of network metrics.The signed digraphs are not restricted to be structurally balanced, to account for the fact that also non-structurally-balanced networks have been considered in the literature when modelling social dynamics [71,72,73].
In all the considered simulations, the initial opinions, traits and networks are assigned independently.A different approach -which is left for future work -could be to assign them in some correlated way: e.g., initial opinions and network could be correlated by assigning the initial opinions such that two vertices connected by an edge have a very similar (or very distant) initial opinion; traits and network could be correlated by assigning the agent parameters with a probability that depends on the corresponding vertex characteristics, for example assuming that vertices with higher out-degree have a higher probability of being completely conformist, or radical.Correlations between initial opinions, traits, and network characteristics can reproduce different types of societies present in real life (for instance, in a society that values tradition, highly stubborn agents may be more influential than others, and hence the corresponding vertices may have a higher out-degree).

Simulations in Simple Cases
To better understand the model behaviour, we simulate the model evolution in special simple cases.First, for the same digraph with a lattice topology, we vary the inner traits assignations (Figure 5).Then, for the same inner traits assignation, we consider different digraph topologies (complete, lattice, ring, small-world) and different, randomly chosen, initial opinions (Figure 6).Finally, for the five initial opinions shown in Figure 4a, we consider 12 different networks (4 topologies, each with 3 different probabilities for positive and negative edges) and 10 different inner traits assignations (Figure 7).

Different Inner Traits Assignations
We consider a signed lattice digraph, where each agent has 4 in-neighbours and the edges are positive with probability 0.77.All the agents have the same inner traits, combining only two inner traits: stubbornness and radicalism; radicalism and conformism; conformism and stubbornness.Starting from the same initial opinions, Figure 5 shows the opinion evolution over 30 time steps.Radicalism tends to form polarisation by driving the agents to extreme opposite views.Conformism tends to create consensus; however, because of the classification approach, the agents do not converge to the very same opinion (close enough agents are unable to perceive their opinion difference, because opinions are assessed with finite resolution).Stubbornness slows down the effect of the other two traits; only in a fully stubborn population everyone keeps its initial opinion.Among the three traits, radicalism appears to have the greatest effect: even a small amount of radicalism can prevent conformism from forming consensus, and can yield polarisation in a very stubborn society.
Figure 5: Evolution of the CB model, starting from the same initial opinions, over a signed lattice digraph where the edges are positive with probability 0.77.In each simulation, all 100 agents have the same inner traits that are a combination of only two of the possible traits: stubbornness (Stb), radicalism (Rad), and conformism (Con).The top labels show the proportion of each trait: the upper left (respectively, right) graph corresponds to a simulation where all agents are purely stubborn (resp.radical).The colour of the lines is the RGB representation of the inner traits assignations (blue: conformist; red: radical; green: stubborn).

Different Digraph Topologies
Additional intuition on the model behaviour can be gained by studying the effect of different initial opinions and different digraph topologies with fixed inner trait parameters.Figure 6 shows 10 simulations starting from various, randomly chosen, initial opinions and evolved over four signed digraphs with Complete, Lattice, Ring, and Small-World topologies.The inner traits assignation for all these simulations is kept constant and is shown at the top left of Figure 6 (it is the same also shown in Figure 3a).Both the digraph topology (dictating how the agents communicate among them) and the initial opinions (providing the starting point of the evolution) have a significant effect on the opinion evolution and the final predicted opinions.For Lattice and Ring digraphs, there is a clear tendency towards consensus at one extreme opinion (completely agree or completely disagree), even when, as in this case, the average radical trait is relatively low.A possible explanation is that in both these topologies agents have less in-neighbours, so the radical trait can have a stronger effect.Another possible explanation is that both these types of networks have a larger average path length, and diameter, than Complete and Small-World networks, and therefore the 'consensus effect' takes more time to act than in more connected networks.Indeed, since they share common features, the Complete and Small-World digraphs (small diameter), as well as the Lattice and Ring digraphs (large diameter), showcase similar behaviours and similar final opinion distributions, across all the chosen initial opinion distributions.We have observed that this tendency is recurrent for several different choices of inner traits assignations.As is apparent from Figure 5 (and from all the opinion evolution simulations shown in the next subsection), the inner traits assignation has a tremendous effect on the opinion evolution.The simulations of Figure 6 reinforce this idea by showing that, although the initial opinions and digraph topology do have an impact, keeping the same inner traits assignation restricts the final opinion distributions to some characteristic patterns.

Different Networks and Inner Traits
To provide an overview of the different behaviours that the model can produce, in relation to different initial opinions, signed digraphs, and inner traits assignations, Figure 7 shows the agreement plot of several opinion evolutions for complete, lattice, ring, and small-world graph topologies.In each panel, all the signed digraphs have the same topology, but the ratio of negative to positive edges changes from highest (row 1) to lowest (row 3).Simulations along the same row evolve over the same signed digraph, which is shown to the left together with digraph metrics.The simulations along the same column have the same initial opinion (which are the same as the initial opinion shown in Figure 4a).Each agreement plot contains 10 different opinion evolutions, each starting from the same initial opinions (given by the column), evolving over the same digraph (given by the row) and with the inner traits shown in Figure 3c (for every line the corresponding average inner traits are represented by the line colour; the average weight of conformist, radical, and stubborn traits are represented by blue, red, and green colours respectively).Figure 7a shows that increasing the ratio of positive to negative edges, corresponding to less antagonism and more balance, allows the opinions to be clearly expressed and reinforced, and thus "propagate" further, often reaching the top right or bottom left corners of the plot.To understand why this happens, think of a population of two agents, a and b: if a antagonises b but b does not antagonise a, then a will tend to the opposite opinion than b has, while b will tend to the same opinion as a, and hence both their opinions converge to zero.An extreme example of how a decrease in this ratio makes opinions weaker (in fact, converge to zero) is the well-known model by [59]; the same phenomena is also present in the CB model, although less pronounced.Analogous trends can be seen irrespective of the graph topology.Concerning the effect of inner traits assignations, the blue lines (prevalence of conformism) tend towards the top right and bottom left corners, indicating consensus with an extreme opinion, whereas the red lines (prevalence of radicalism) tend towards the bottom right corner, associated with polarization.
Comparing Figure 7b with Figure 7a shows that, with a lattice topology, the opinions tend to be less extreme than with a complete graph topology: in fact, with a lattice graph, opinions take more time to propagate from one agent to the others, and become smaller in magnitude in the process.This also makes the effect of a different positive to negative edge ratio less prominent.However, it is still present: for instance, in the third column of Figure 7b, the blue line goes from moving to the origin, in the second row, to moving towards the bottom left corner, in the third row.The results in Figures 7b and 7c look similar, but the evolution over the ring digraph seems to leave the opinions closer to the initial configuration for all the different inner traits assignations, perhaps because opinions take even more time to propagate on average due to less interaction among agents, and hence less opportunity to change the opinions of others.Finally, simulations in Figure 7d show opinions that propagate considerably in the Cartesian plane, because of the higher connectivity of the Small-World topology (although the same effect is even more pronounced for opinions evolving over a complete graph).
Figure 8 shows the same opinion evolutions as in Figure 7, but now the agreement plots are grouped by initial opinions and inner traits assignations.Evolutions shown in the same row have the inner traits shown to the left; the initial opinions are the same for all simulations along the same column; and each plot contains Figure 8: Each agreement plot along the same column (respectively, row) corresponds to an opinion evolution with the same initial opinion (respectively, the same inner traits assignation).The corresponding inner traits assignation is shown to the left.Each agreement plot contains 12 curves, one for each of the 12 signed digraphs in Figure 7.
12 lines corresponding to the 12 signed digraphs in Figure 7.In addition to the effect of the network topology, each inner traits assignation leads to a characteristic behaviour for the opinion evolution.Highly conformist inner traits assignations tend to move towards the axis: most opinions are either positive or negative.On the contrary, predominantly radical inner traits assignations tend to move towards the bottom right corner, associated with polarisation, or at least with the presence of significant amount of agents with both positive and negative opinions.Inner traits assignations with a strong stubborn component can have either of the two behaviours.More heterogeneous inner traits assignations give rise to a wider variety of behaviours.

Parameter Sensitivity Analysis
We select a set of nominal parameters (which, for given initial conditions, produce nominal simulation results) as a baseline with which other parameter choices can be compared.We choose a nominal inner traits assignation that leads to model outcomes that closely reproduce real data from the World Values Survey (in fact, it is close to some of the inner traits assignations resulting from the Free optimisation problem (9), see Figure 19a), and therefore has the potential to represent a realistic society; moreover, it allows us to showcase the wide range of different opinion evolutions that the model can produce.Then, we vary inner traits assignations, signed digraph and opinion evolution parameters, one by one, and study their effect on the simulated behaviour.

Nominal Parameters and Nominal Results
We consider the initial opinions shown in Figure 9a, which evolve according to the model with the nominal parameters: λ = 0.4, ξ = 2, µ = 5, inner traits assignations in Figure 9b, and signed digraph in Figure 9c.9b shows that most agents have very strong conformist traits, with a notable percentage of radicalism, resulting in an average agent (crossed dot) with 60% conformist traits, 30% radical traits, and 10% stubborn traits.The nominal signed digraph in Figure 9c is highly connected, with average path length 2.12, clustering coefficient 0.38, diameter 4. It has 834 positive edges and 767 negative edges.
The nominal results are shown in Figure 10. Figure 10a shows the opinion evolution of every agent.The line colour represents the percentage of conformist, radical, and stubborn agent traits (blue for conformist, red for radical, and green for stubborn).The purple colour of most lines corresponds to a combination of conformist and radical traits.The discontinuity in the opinion change is due to the classification process leading to a discontinuous opinion update law.The opinion evolution of the various agents shows a great variability in opinion changes, without a clear global tendency.Figure 10b shows the histogram of the nominal final opinions predicted by the model after 50 time steps.Compared with the initial opinions, the final opinions appear to have a more uniform distribution: in fact, for the nominal final opinions, θ − = −25.75 and θ + = 25.1, hence θ + ≈ −θ − .The behaviour of the opinion evolution and the distribution of the final opinions is explained by the presence of two opposing forces that drive the opinion of all the agents: on one hand, the tendency to achieve consensus, due to the conformist traits, drives the agents towards the centre; on the other hand, the radical traits move the opinions towards extreme values.

Varying the Inner Traits Assignations
To evaluate the effect of different inner traits assignations, we change the nominal inner traits assignations of Figure 9b and simulate the opinion evolution, keeping all the other parameters unchanged.The two new inner traits assignations, shown in Figures 11a and 11d, are simply rotations of the nominal inner traits assignations.The corresponding opinion evolutions are shown in Figures 11b and 11e, while the final opinion histograms are presented in Figures 11c and 11f.
Comparing the opinion evolutions of Figures 10a, 11b, and 11e and the final opinion histograms of Figures 10b, 11c, and 11f reveals the profound effect of different inner traits assignations on the opinion evolution.In the inner traits assignation of Figure 11a, the agents are mostly stubborn and conformist.This results in a very slow convergence towards the mean, spurred by conformist traits and slowed down by stubborn traits.Because of the neighbour classification, even completely conformist agents would not reach perfect consensus, but would rather converge to an opinion subinterval where all the agents perceive that the others have a comparable opinion.This tendency towards the mean can be seen in the final opinion histogram of Figure 11c, where both θ − = −11.02and θ + = 18.85 are much closer to 0.
On the other hand, the inner traits assignation of Figure 11d gives agents pronounced radical traits.Both the opinion evolution in Figure 11e and the final opinion histogram in Figure 11f show that agents lean towards extreme opinions.A bunch of agents keeps its opinion closer to zero.The line colours (closer to blue and green) show that these agents do not have very strong radical traits, and instead they are more conformist and stubborn: such traits allow these agents to avoid extreme opinions.

Varying the Signed Digraph
To study the effect of changing the signs of the weights of the signed digraph, the nominal signed digraph of Figure 9c is modified into the signed digraphs shown in Figures 12a and 12d.The topology is unchanged, but the number of positive and negative edges is changed.The resulting opinion evolution and final opinion histograms are shown in Figures 12b and 12c, and in Figures 12e and 12f respectively.
Compared with the nominal results in Figures 10a and 10b, the most different outcome occurs when most edges are positive (digraph in Figure 12d).In this case, the end result is almost perfect consensus for the    +1 opinion, because the initial opinion, with θ − = −19.3and θ + = 41.5, is more skewed towards +1.The presence of negative edges is crucial to avoid trivial consensus outcomes even when the agents are not completely conformist.The opinion evolution in Figure 12e shows that, initially, conformist traits pull the opinions towards positive values, and then radical traits make them increase in value until they reach +1.Purely radical agents would have produced polarisation instead of consensus.
When increasing the number of negative edges (digraph in Figure 12a), the final opinions in Figure 12c are different from the nominal ones, but the qualitative behaviour is comparable.

Varying the Opinion Evolution Parameters
We study the sensitivity with respect to the opinion evolution parameters Ω = (λ, ξ, µ), where: λ is the overall opinion change magnitude, and can also be thought of as a time scaling parameter; ξ gives more weight to distant opinions for conformist traits; µ increases the opinion change for radical traits.We change these parameters one at the time, with respect to the nominal parameters, and compare the results with the nominal results in Figure 10.
Figure 13 shows the opinion evolution and final histogram for λ = 0.2 and λ = 0.8.The final histograms in Figures 13b and 13d do not change much with respect to the nominal.The most significant change can be noticed in Figures 13a and 13c, showing that indeed a higher value of λ produces larger changes in the opinions.Overall, however, the effect of varying λ is very limited.13b) and λ = 0.8 (Figures 13c and 13d) evolving 100 agents.
The effect of varying ξ is shown in Figure 14.The changes in both the opinion evolution and the final opinion histogram are quite noticeable.A value of ξ = 1 means that distant opinions have the same attracting power as closer opinions for the conformist traits, hence in general the conformist trait has less influence over the whole opinion change, which is instead dominated by the radical traits.The result is visible in the opinion evolution in Figure 14a and the final opinion histogram in Figure 14b.On the contrary, increasing the value to ξ = 4 yields a stronger conformist tendency towards consensus, evident when comparing the nominal final opinions in Figure 10b with the final opinions with ξ = 4 in Figure 14d, and the respective θ − and θ + .14a and 14b) and ξ = 0.8 (Figures 14c and 14d) evolving 100 agents.
Parameter µ modulates the effect of radical traits on the opinion evolution.Comparing Figure 15b with Figure 15d shows that a larger µ increases radicalism in the population, which leads to polarisation for the given initial opinions.A similar effect is achieved by varying ξ: in fact, both ξ and µ affect the balance between the conformist tendency towards consensus and the radical tendency towards polarisation.Although both ξ and µ play a role in the conformist-radical balance, they are not completely complementary: an increase in ξ is not the same as a decrease in µ.This can be seen by comparing Figures 14d and 15b: increasing ξ produces final opinions that are more evenly distributed than those obtained by decreasing µ.Moreover, increasing radicalism does not always lead to polarisation: this happens only when the opinions have both positive and negative values.If the opinions have only positive values or only negative values, then radicalism will move all of them to a single extreme, resulting in consensus.Therefore, it is not possible to generalise the idea that more radicalism always leads to polarisation, regardless of the initial opinions.15b) and µ = 10 (Figures 15c and 15d) evolving 100 agents.

Model Validation with Real Data
Data from the World Values Survey are used to validate the CB model, namely, show that a suitable choice of the parameters allows the model to produce predicted opinions similar to the real opinions in a society.The World Values Survey is an international organisation that conducts surveys about ethics and values in different countries around the globe.These surveys are repeated every 5 years.We considered the answers to 30 questions, shown in Table 13, in 26 countries, shown in Table 12.In each question, the respondents are asked to state the extent to which they agree with a statement in a Likert-scale 10.The answers given in the surveys of 2015 (wave 5) are taken as initial opinions, while the answers of 2020 surveys (wave 6) are taken as final opinions.
Two minimisation problems are stated to find model parameters that produce predicted opinions similar to the ones found in the survey answers.The Free Optimisation Problem allows the inner traits assignation to change with questions; in the Constrained Optimisation Problem, the inner traits are fixed for all questions.The transition tables for the model with parameters provided by both optimisation problems are also computed.
Given real and model-generated opinion vectors r and y, the cost function J used in the minimisation problems ( 9), (10), and ( 11) is defined as where r = (r i ) n i=1 is the vector r = (r i ) n i=1 sorted in descending order, and • is the quantisation function ri = arg min with Quantisation is needed because the World Values Survey answers we consider as real opinions use a Likert scale 10: participants could choose their opinion from 10 different options.These opinions rescaled to be between -1 and 1 produce the set R and, therefore, the predicted opinions also need to be quantified in the same way.Both opinion vectors (real and predicted) are sorted in descending order, so that equal opinions add a zero to the total cost.
Even for a relatively small population n = 100, the size of the sets W (underlying signed digraph structures) and A (inner traits assignations) is enormous.Given the tremendous size of the parameter space W × A, performing the minimisation over all possible signed digraphs and agent inner traits would be computationally intractable.Therefore, the minimisation occurs over small subsets W ⊂ W, Ã ⊂ A of the whole parameter space.As a consequence, there is no guarantee that we are estimating the real parameter values or making the absolute best parameter choice: with other parameter choices, not included in W × Ã, the model could reproduce the data with even better accuracy.The subset W contains 35 different small-world signed strongly connected digraphs.Table 1 shows the main characteristics of the networks.The subset Ã contains 3528 randomly generated inner traits assignations ψ = (ψ i ) n i=1 .To avoid bias towards societies with average inner traits that are more conformist, radical, or stubborn, the set Ã satisfies the following property: for every inner traits assignation ψ, with corresponding average inner trait ψ = ( ᾱ, β, γ) = (a 1 , b 1 , c 1 ), there are two inner traits assignations ψ , ψ ∈ Ã that satisfy ψ = (b 1 , c 1 , a 1 ), and ψ = (c 1 , a 1 , b 1 ).In other words, the parameter space Ã is symmetric with respect to permutations of agent traits.Besides this property, the elements of this set were chosen at random.All the average inner traits ψ corresponding to inner traits assignations ψ in Ã are shown in Figure 16.
Due to the anonymity of the surveys, it is not possible to guarantee that the same people answered the survey in subsequent waves of the WVS.However, if the surveys are done correctly to represent society overall, the results can be anyway assumed to reflect the global opinion distribution of the general population about a given topic at a specific time, and this allows us to use the survey results in different waves in our minimisation problem, as if the very same people had answered.

Free Optimisation Problem
Assuming that the agents can have different inner traits for each question, Equation (10) was used to find model parameters for each country that yield opinions similar to the real ones.Once the parameters that solve the minimisation problem (10) were found for each country, the cost associated with the prediction discrepancy for each question-country pair was computed as in Equation ( 14) (see Figure 17) and is shown in Table 2. Due to its complexity and the huge size of the feasibility set, the minimisation problem is solved approximately: hence, a possibly suboptimal solution is found.By solving the optimisation problem more accurately, over a longer computation time (which we could not afford, due to the very large number of question-country pairs that we consider), even smaller costs could be achieved, and hence even better fits of the real data.
Figure 17: Visualisation of the procedure generating each column in Table 2 and of the minimisation problem in Equation (10).Assume that a survey conducted in two separate occasions in country A had Q questions.Given a signed digraph W and Q inner traits assignations (ψ (l) ) Q l=1 for each question, the model predicts a final opinion ỹl .The cost function J(y l , ỹl ) measures how close the predicted final opinion is to the real final opinion y l .The sum of all these costs gives the total cost T .Minimising the value of T over the signed digraph W and inner traits assignations (ψ (l) ) Q l=1 gives the parameters that best reproduce the society, W , and ( ψ (l) ) Q l=1 .The cost for each question and the average and total cost obtained using these optimal parameters are reported in the column of Table 2 corresponding to the considered country.All simulations evolved 100 agents.
Figure 18 shows the model predictions for some question-country pairs.The original opinion is shown in blue, the real final opinion in orange, and the predicted final opinion in green; the corresponding cost (discrepancy) is reported.For costs less than 7, the model produces predicted final opinions that accurately represent the real final opinions.These cases correspond to green cells in Table 2, while cells with a cost higher than or equal to 7 are highlighted in red and constitute a small minority.
Figure 18: Examples of the opinion predictions achieved with the CB model, with varying resulting costs.For each trio of histograms, the initial opinions are in blue, the real final opinions in orange, and the predicted final opinions in green.The value of the cost J (in Equation ( 14)) is shown in the predicted histogram: cost values within 7 are shown to correspond to an accurate reproduction of the real opinion distribution.
To carry out a thorough comparison with standard models of opinion formation, an analysis equivalent to the one reported in Table 2 is performed also for the Null model (the model that assumes that the opinions do Table 2: Results of the Free optimisation problem using the Classification-Based model.Each column corresponds to a different country and each row to a different question.The cell values correspond to the optimal cost for all the countries and questions.The average cost along all the countries is 3.2815.The two final rows shows the column average and total.Cells with cost less than 7 are in green, the others are in red.Of the 780 possible question-country pairs, 755 have a cost less than 7 (an accuracy of 97% in total).The average cost of accepted question-country pairs is 2.97.
not change over time) and the French-DeGroot (FG) model [1,2,3,4].The results are reported in Tables 3  and 4, respectively.To make Tables 2 and 4 comparable, for the FG model the digraphs used in each country are selected following the same minimisation problem as the one solved for the CB model.Since the FG model does not involve agent parameters, we only minimise over the set of digraphs W FG .Both the set of digraphs for the CB model, W, and for the FG model, W FG , have the same number of elements and there is a one-to-one topology correspondence; the digraphs in W are signed and unweighted, while those in W FG are unsigned and row-stochastic (as required by the different nature of the two models).
Comparing Table 2 with Tables 4 and 3 shows that the CB model performs remarkably well, yielding a 97% accuracy in contrast to the 43% accuracy of the Null model and the 2% accuracy of the French-DeGroot model.In fact, from Table 3 it is clear that, although there is a strong tendency towards stubbornness and opinion distribution tend to change only slightly over time, keeping the opinions exactly constant does not lead to good predictions.As shown in Table 4, the predictions of the French-DeGroot model are also not accurate, consistently with the evidence that perfect consensus is uncommon in real life.Plotting the average inner traits ψ for all question-country pairs for which the cost is less than 7 provides possible hints on how these societies could potentially be formed.However, because of the large parameter space and relatively small data set, we cannot make conclusive statements on actual societies just based on the optimisation results, as very different inner traits assignations may produce similarly low costs: we just propose a possible explanation.The resulting ternary diagram is presented in Figure 19. Figure 19a shows the position of each question-country pair.Figure 19b shows a density plot over the ternary diagram indicating the regions where most question-country pairs are found.
Despite the small data set and possible multiple local minima with similar low cost, fitting real data to Table 4: Results of the optimisation problem using the French-DeGroot model, for comparison with Table 2.
The average cost along all the countries is 38.4323.Of the 780 possible question-country pairs, 13 have a cost less than 7 (an accuracy of 2% in total).The average cost of accepted question-country pairs is 5.43.gain an insight into the composition of actual societies reveals a clear trend: most average inner traits include a strong stubborn component, as shown by the high density in the stubbornness corner in Figure 19b.Also, the non-stubborn part can be roughly divided into 70% conformist and 30% radical, as shown by the trend in Figure 19a.This distribution is almost constant across all question-country pairs.Again, this is a possible explanation, and more data and more thorough explorations of the parameter space (extremely challenging from a computational standpoint) would be needed to make more conclusive statements.Hence, this is not conclusive evidence that most people are stubborn.There may be other explanations, for instance that not too many opinion exchange events take place in an average person's life.Graph-theoretically speaking, isolation due to the lack of outgoing edges from a node (i.e., lack of interactions) is associated with the concept of stubborness.However, from a mathematical model it is impossible to draw conclusions on whether the opinion of an agent remains unchanged because the agent refuses to consider the different opinions it is exposed to, or because the agent intentionally avoids exposure to different opinions, or because the agent simply lacks the opportunity to come into contact with different opinions.Furthermore, the traits themselves can be interpreted in different ways: for instance, a lower value of stubbornness can be regarded as a greater openness to change.
Parameter Variation: The results presented in Table 2 and Figures 18 and 19 are obtained by solving the minimisation problem (10) with nominal opinion evolution parameters λ = 0.4, ξ = 2, and µ = 5.We now analyse the results of the minimisation problem when these parameters are changed.Tables 5 to 7 present how this variation affects the percentage of accurate question-country pairs (namely, those associated with a cost smaller than 7), the average cost of accurate question-country pairs, and the ternary diagram plot.
Tables 5 to 7 show that, even after varying the values of λ, ξ, and µ, the percentage of accurate questioncountry pairs remains around 96%, and the average cost of accurate question-country pairs is between 2.79 and 3.45 which is quite remarkable since it means that the high accuracy achieved with the CB model is very robust to parameter variations.
Comparing the ternary diagrams shows the persistent tendency of question-country pairs to lie along a line where the proportion between conformist and radical traits is constant.For most simulation results, this proportion is still 70% conformist and 30% radical, as in the nominal case (Figure 19a).The proportion only changes when varying µ: for µ = 2.5, we have 60% conformist and 40% radical agents, while for µ = 10 we have 80% conformist and 20% radical agents.Therefore, it appears that µ can be tuned to regulate this proportion.

Constrained Optimisation Problem
If the agents are assumed to have the same inner traits for every question, then the model parameters can be found using the constrained optimisation problem in Equation (11).One advantage of using this approach is that, since each country has the same topology and inner traits assignation for all the questions, these parameters can be identified by solving the constrained optimisation problem (11) for a subset of all available questions (training dataset), and then tested on the remaining questions (test dataset).This was not possible previously, when assuming a different inner traits assignation associated with each question.This procedure is commonly known as cross-validation.Generally, a subset of available data is used to train an algorithm (in this case, to identify the model parameters W and ψ) and the remaining data is used to test the trained algorithm (in this case, the model with identified parameters W and ψ).To eliminate result biases due to the selected training datasets and test datasets, cross-validation is performed multiple times for different partitions of the data.A common approach is to divide the data in K subsets and validate the model K times so that, at each iteration, only one subset is taken as the test dataset.This is known as K-fold cross-validation.
Table 8 shows the result of sixfold cross-validation on the available data (the questions are divided in six subsets of five questions each: {1, . . ., 5}, {6, . . ., 10}, . . ., {26, . . ., 30} ).The first six rows show the mean cost for the five questions in the test dataset for each country for each cross-validation (CV1 to CV6).The last row shows the mean of the first six rows.
The simulation results summarised in Table 8 show that the model is able to accurately reproduce the final opinions for the tested data.Although the values are higher than 7, it is important to note that these predictions are done based on the assumption that the inner traits are the same for every question, while in reality the inner traits of the agents may change when considering their attitude towards different types of questions (which is taken into account by the free optimisation approach).Table 8: Results of the sixfold cross validation.Each column corresponds to a country, and each row to one of the six cross validations.The value in cell (i, j) is the average cost of the test data in cross validation i for country j.The last row represents the mean over all the rows.
Table 9 is analogous to Table 2, but now the model parameters are obtained with the Constrained optimisation problem (11), which yields a higher cost, as expected, since the optimised inner traits assignations can be very different when unconstrained, see Figure 19a.

Transition Tables
Let x o be an initial opinion vector, and x f the final opinion vector predicted by the model.Both x o and x f can be sorted into one of five possible opinion distribution categories shown in Figure 20: 1) perfect consensus, PC; 2) consensus, Co; 3) polarization, Po; 4) clustering, Cl; 5) dissensus, Di.The reader is referred to [68] for more details.Now, let X o be a collection of initial opinions X o = {x o } and X f the corresponding collection of predicted opinions X f = {x f }.A transition table T , with 5 rows and 5 columns corresponding to the five possible opinion categories, is computed so that the coefficient in cell (a, b) is the number of initial opinion vectors belonging to category a for which the corresponding predicted opinion x f belongs to the category b.The table shows whether the model can evolve initial opinions belonging to any category into predicted opinions belonging to any other category.
Figure 21 shows three transition tables, where the set X o represents the set of all World Values Survey answers to wave 5 for all questions and countries.For the real transition table A, the set X f represents all the corresponding survey answers in wave 6, which are the true final opinions.For the transition table B (respectively, C) the set X f contains all the corresponding predicted opinions produced by the CB model with the parameters obtained through the Free (respectively, Constrained ) optimisation, namely, all the predicted final opinions ỹ used to compute Table 2 (respectively, Table 9).Interestingly, with the suitable choice of parameters, the CB model is capable of evolving opinions from any initial category into any other final category, as it happens with real opinion distributions.As expected, better results are achieved with the Free optimisation, in line with the results from Tables 2 and 9; still, both the free and the constrained transition tables show the versatility of the CB model, which can yield all transitions between opinion distribution categories that are seen in real life.

Comparison with the Friedkin-Johnsen Model
The classification-based model can be seen as an extension of the Friedkin-Johnsen (FJ) model [5,6], in the sense that both models include in the agents' behaviour inner traits described by tuples.In the FJ model, each agent i is characterised by two parameters: susceptibility a i ∈ [0, 1], determining how strongly the agent is affected by its neighbours' opinions and forgets the initial opinion [6], and prejudice b i = 1 − a i ∈ [0, 1].A value of a i = 1 means that the agent has complete susceptibility to interpersonal influence (similar to complete conformism), while a value of a i = 0 means that the opinion remains the same for all times (similar to complete stubbornness).When all agents are completely susceptible, the FJ model becomes the classic French-DeGroot (FG) model [1,2,3,4]; when all agents are completely prejudgemental, the FJ model becomes the Null model (opinions do not change over time).In the CB model, each agent i is associated with three parameters: , and stubbornness γ i ∈ [0, 1], such that α i + β i + γ i = 1 for all i ∈ V .Therefore, a FJ model where all agents have a susceptibility of a is similar to a CB model where all agents have inner traits α = a and γ = 1 − a (hence β = 0).Still, the interpretations of stubbornness and prejudice are slightly different: prejudice in the FJ model means that agents tend to remain with their initial opinion, while stubbornness in the CB model means that agents tend to remain with their current opinion, which leads to the same outcome only when all the agents are completely stubborn.Apart from the outlined similarity, the FJ and CB models are different: crucially, the FJ model is linear, while the CB model is highly non-linear, which severely limits the applicability of closed-form analysis tools.
Figure 22 shows the evolution of the same initial opinions according to the two models, for different values of a, α, and γ.The digraphs had the same topology; randomly generated weights are considered for the FJ model, while for the CB model all the edge signs are taken positive to match the absence of antagonism in the FJ model.The FJ model exhibits a slower change as a increases, while with the CB model, as soon as conformism is introduced, the opinions converge to an interval where all the agents perceive that their neighbours' opinion is similar enough to theirs.This difference is caused by the two different interpretations and implementations of stubbornness and prejudice.Another important difference is that, as the susceptibility value increases, the final opinions of the FJ model tend to converge to a single opinion, and yield perfect consensus when a = 1.Conversely, the final opinions of the CB model never converge to perfect consensus, even when α = 1 and γ = 0, as a consequence of the classification-based approach.The simulations start from the same initial opinions and evolve over digraphs with the same topology.The degree of susceptibility, prejudice, conformism, and stubbornness is represented by the colours cyan, magenta, blue, and green respectively.
The differences between CB and FJ model help visualise the strong implications of the classification-based mechanism for assessing the opinion of others, which captures the fact that opinions cannot be perceived with perfect resolution and accuracy, and hence changes the model behaviour significantly: it grants the model new properties, such as the existence of multiple equilibria that can span the complete spectrum of opinions.For instance, in Figure 22, the CB model with α = 1 and γ = 0 generates equilibrium opinions that span almost 40% of the opinion interval [−1, 1] (a wider span can be achieved with different topologies), while the FJ model with a = 1 leads to identical equilibrium opinions.The non-linearity introduced by the classification-based assessment of the opinion of others can completely change the resulting dynamics and lead to the emergence of peculiar features, which would not emerge from models where the agents have perfect access to the opinion of others.This is highlighted, for instance, by the comparison with the Friedkin-Johnsen model and with the French-DeGroot model (corresponding to the FJ model with a = 1).The formal analysis of the distinctive mathematical properties of the CB model is the subject of ongoing research.
The results of an analysis for the FJ model, equivalent to the one reported in Tables 2 and 9 for the CB model, are reported in Tables 10 and 11.To make the results comparable, when solving the optimisation problems (10) and (11) for the FJ model the sets Ã and W are modified as follows: the set of digraphs is the same used for the French-DeGroot model, since both models require row-stochastic adjacency matrices; the inner traits assignations in Ã are transformed into parameters of the FJ model using the mapping a i = α i /(α i + γ i ); if α i + γ i = 0, then a i = 0.5.Table 10: Results of the Free optimisation problem using the Friedkin-Johnsen model.The average cost along all the countries is 7.4897.Out of 780 possible question-country pairs, 460 have a cost less than 7 (an accuracy of 59% in total).The average cost of accepted question-country pairs is 3.3.
Comparing Tables 2 and 10 shows that the CB model outperforms the FJ model, yielding a 97% accuracy in contrast to 59%.Also, the average cost of accepted country-question pairs is lower for the CB model (2.97) compared with the one produced by the FJ model (3.3) are predicted satisfactorily, but also the predictions are more accurate.Since the French-DeGroot (FG) and the Null model can be seen as extreme cases of the FJ model, as expected, the FJ model produces better results than the FG model and the Null model, as can be seen by comparing Tables 10 and 11 with Tables 4 and 3 (note that the optimisation was done for the total cost, not the number of accepted question-country pairs).The fact that the Null model yields better predictions than the FG model suggests that opinions do not change much from one wave to the other, an observation that is also confirmed by the transition tables in Figure 21, where the sum (and percentage) of the values on the diagonal cells (associated with cases where initial and final opinion distributions both belong to the same qualitative category) is always the largest.Figure 23 shows the transition tables for the FJ model (computed as for the CB model in Figure 21).In the CB transition tables, the diagonal sums (416 and 352) are always smaller than the real diagonal sum (444), while in the FJ transition tables the diagonal sums (544 and 630) are always larger, probably due to prejudice having a stronger effect than stubbornness in preserving the initial opinion.The lack of a "radical" trait makes the FJ model less versatile, which is reflected in the lower off-diagonal sum.According to Tables 2, 9, 10 and 11 the models that mimic the real opinion evolution at best are (in order): Free CB, Free FJ, Constrained FJ, and Constrained CB.Instead, according to the qualitative evaluation emerging from the transition tables, the models that are more faithful to the real opinion evolution are: Free CB, Free FJ, Constrained CB, and Constrained FJ.

Model Outcome Capabilities
Through the agreement plot, we explore the model's capacity to produce a wide range of predicted opinions and gain insight into the dynamics that allow these predictions.
Given a single initial opinion vector x o and a set of inner traits assignations A and networks N , let X = X(x o , A , N ) be the set of all final opinion vectors produced by evolving the initial opinions x o with inner traits assignation ψ ∈ A over a network W ∈ N .The agreement plot of set X(x o , A , N ) gives a visual representation of the range of opinions that the model is able to produce starting from x o .Figure 24 shows the agreement plot for five different initial opinion vectors achieved by two models: the classification-based (CB) model and the Friedkin-Johnsen (FJ) model.In the agreement plot, each dot is colour-coded: for the CB model, the colour represents the average inner traits (blue for average conformist trait α, red for average radical trait β, and green for average stubborn trait γ); for the FJ model, it represents the average susceptibility a (cyan represents complete susceptibility a = 1 and magenta complete stubbornness a = 0).We consider the same set of traits as for the optimisation problem, i.e., A = Ã, and a set of networks N including networks 1 to 5 in W , selected because they represent networks with the same topology and varying ratio of negative to positive edges.
Figure 24: Row 1 (respectively, row 2) shows the agreement plot of the potential opinion vectors predicted by the FJ (respectively, CB) model, starting from the initial opinion vectors shown in Figure 4a.The marker colour encodes the average traits of the agents producing the final opinion: for the FJ model, cyan and magenta represent susceptibility and prejudice respectively; for the CB model, blue, red and green represent conformism, radicalism and stubbornness respectively.All simulations evolved over 50 time steps.
Figure 24 highlights that the CB model can produce a wide range of predicted opinions, primarily thanks to the interaction of the three complementary inner traits: conformism brings opinions together, yielding an effect that is similar to that of the FJ model, i.e., moving opinions along the 3π/4 diagonal; radicalism allows the opinions to move in the other 3 diagonal directions (π/4, 5π/4 and 7π/4); and stubbornness makes opinions stay near the initial opinion.The combined effect of multiple combinations of these traits leads to an agreement plot of the possible predicted opinions that has a greater range than that produced by the FJ model.
Susceptibility or conformism could be considered as a trait that moves all the opinions towards a common opinion in the middle of the interval [−1, 1], whereas radicalism moves all the opinions to their corresponding extremes, either −1 or 1.The combined effect moves the opinions across the interval [−1, 1], and the degree of stubbornness determines the speed of the change.Interestingly, if the initial opinion is above the line θ + = −θ − , then the predicted opinions also tend to stay above the line: if the overall population agrees more than it disagrees with a statement, this opinion balance is likely to be preserved.However, a change in opinion balance is not impossible: a considerable fraction of predicted opinions may approach the line θ + = −θ − , and from there a slight change in population traits may move the predicted opinions to the other side of the line (initial opinion 2 can produce an opinion vector near initial opinion 1 and from there the next opinions can be near initial opinion 3).It is also interesting to note that, although initial opinions 1 are slightly below the θ + = −θ − line, most of the predicted opinions are above that line, an effect probably caused by the network topology or the edge signs.

Summary and Conclusions
We have proposed a novel agent-based opinion formation model that has two fundamental distinctive features.First, the model drops the unrealistic assumption that agents can measure the opinion of their neighbours with infinite precision, which drastically affects the opinion evolution, and introduces a novel classificationbased approach that more realistically replicates the way individuals assess and evaluate the opinions of their neighbours, by classifying them as agreeing much less, less, comparably, more or much more.Second, the model captures the complexity of the behaviour of individuals by introducing three different internal traits, associated with conformism, radicalism, and stubbornness.Instead of considering agents of different types, the model allows all these tendencies to coexist in each agent, thus representing multifaceted psychological and sociological phenomena in action within each individual.
Five types of simulation analyses were carried out: (i) simulations over simple digraphs and agent parameters to gain insight into the model behaviour; (ii) simulations with varying model parameters to perform a parameter sensitivity analysis; (iii) simulations with parameters chosen through the approximate solution of two optimization problems to assess the model's potential to predict opinions similar to those seen in real life; (iv) comparison with the Friedkin-Johnsen model; and (v) exploration of the model's capability to generate different opinion predictions.
We used real data from the World Values Survey to assess the capability of our classification-based model to mimic actual opinion evolutions seen in real life.Despite its simplicity, the model can yield opinions similar to the ones in survey results and can also produce a rich and wide variety of collective behaviours, without the need of introducing bounded confidence, randomness, or more complex mechanics.
Possible further directions for future work include a more detailed study of the effects of different network topologies on the opinion evolution, and an investigation of what happens if the opinion evolution parameters Ω are agent-dependent.

Appendix A: Network Metrics
The signed digraph is represented by the weight matrix W ∈ {−1, 0, 1} n×n , where w ij is associated with the edge going from vertex j to vertex i.We consider six network metrics: average path length (APL), clustering coefficient (CC), positive edges (PE), negative edges (NE), diameter (D), and balance index (BI).This appendix explains how these metrics are computed.
A directed path is a K-tuple of vertices (p 1 , p 2 , . . ., p i , p i+1 , . . ., p K ) such that there is an edge from vertex p i to vertex p i+1 for i = 1, . . ., K − 1.The length |p| of a directed path p is the number of edges that it crosses.Let P (i, j) be the set of all directed paths from vertex i to vertex j (if there are none, then P (i, j) = ∅).Denote by d(i, j) the length of the shortest directed path from i to j, i.e., d(i, j) min p∈P (i,j) |p|.Let C(W ) be the set of vertex pairs (i, j) such that there exists a direct path from i to j and i = j, i.
Note that, because all the networks are strongly connected, |C(W )| = n(n − 1).
To compute the clustering coefficient, consider agent i, with k i in-neighbours excluding itself: k i = | Ñi |, where Ñi {j ∈ V | w ij = 0, i = j}.Then there are at most k i (k i −1) directed edges between these neighbours.The fraction c i of these edges that is actually present is the clustering coefficient of agent i.If agent i has only one in-neighbour, then its clustering coefficient is 1, and if it has no in-neighbour but itself c i is not defined: |{(j,k)|j =k and i,k∈ Ñi}| ki(ki−1) The clustering coefficient of the network (defined by extending to digraphs the definition for undirected graphs by [70]) is thus the average of the clustering coefficients of all agents with at least one in-neighbour excluding themselves: The number of positive and negative edges are computed as where tr(•) is the trace operator, exp(•) is the matrix exponential, and D = |W | component-wise.This formula is a direct extension of the balance index for undirected graphs proposed by [71,74]. .For this questions, a 1 means that you "completely disagree" and a 10 means that you "completely agree."Q10 How much you agree or disagree with the statement Because of science and technology, there will be more opportunities for the next generation..For this questions, a 1 means that you "completely disagree" and a 10 means that you "completely agree."Q11 How much you agree or disagree with the statement We depend too much on science and not enough on faith..For this questions, a 1 means that you "completely disagree" and a 10 means that you "completely agree."Q12 All things considered, would you say that the world is better off, or worse off, because of science and technology? 1 means that "the world is a lot worse off," and 10 means that "the world is a lot better off."Q13 How important is God in your life? 10 means "very important" and 1 means "not at all important."Q14 Indicate if the action of Claiming government benefits to which you are not entitled can be never justified (1); always justified (10); or something in between in a scale from 1 to 10. Q15 Indicate if the action of Cheating on taxes if you have a chance can be never justified (1); always justified (10); or something in between in a scale from 1 to 10. Q16 Indicate if the action of Someone accepting a bribe in the course of their duties can be never justified (1); always justified (10); or something in between in a scale from 1 to 10. Q17 Indicate if the action of Homosexuality can be never justified (1); always justified (10); or something in between in a scale from 1 to 10. Q18 Indicate if the action of Abortion can be never justified (1); always justified (10); or something in between in a scale from 1 to 10. Q19 Indicate if the action of Divorce can be never justified (1); always justified (10); or something in between in a scale from 1 to 10. Q20 Indicate if the action of Suicide can be never justified (1); always justified (10); or something in between in a scale from 1 to 10. Q21 Indicate if the action of For a man to beat his wife can be never justified (1); always justified (10); or something in between in a scale from 1 to 10. Q22 Governments tax the rich and subsidize the poor.an essential characteristic of democracy?Use this scale where 1 means "not at all an essential characteristic of democracy" and 10 means it definitely is "an essential characteristic of democracy" Q23 Religious authorities interpret the laws.an essential characteristic of democracy?Use this scale where 1 means "not at all an essential characteristic of democracy" and 10 means it definitely is "an essential characteristic of democracy" Q24 Is People choose their leaders in free elections.an essential characteristic of democracy?Use this scale where 1 means "not at all an essential characteristic of democracy" and 10 means it definitely is "an essential characteristic of democracy" Q25 Is People receive state aid for unemployment.an essential characteristic of democracy?Use this scale where 1 means "not at all an essential characteristic of democracy" and 10 means it definitely is "an essential characteristic of democracy" Q26 Is The army takes over when government is incompetent.an essential characteristic of democracy?Use this scale where 1 means "not at all an essential characteristic of democracy" and 10 means it definitely is "an essential characteristic of democracy" Q27 Is Civil rights protect people7s liberty against oppression.an essential characteristic of democracy?Use this scale where 1 means "not at all an essential characteristic of democracy" and 10 means it definitely is "an essential characteristic of democracy" Q28 Is Women have the same rights as men.an essential characteristic of democracy?Use this scale where 1 means "not at all an essential characteristic of democracy" and 10 means it definitely is "an essential characteristic of democracy" Q29 How important is it for you to live in a country that is governed democratically?On this scale where 1 means it is "not at all important" and 10 means "absolutely important" what position would you choose?Q30 And how democratically is this country being governed today?Again using a scale from 1 to 10, where 1 means that it is "not at all democratic" and 10 means that it is "completely democratic," what position would you choose?

Figure 1 :
Figure 1: Partition of the interval [−2, 2] in five equal subintervals.Depending on the interval to which the weighted opinion difference ∆ ij = x i − w ij x j belongs, agent i will perceive that agent j agrees either: much more; or more; or comparably; or less; or much less.
Figure 3b explains how to interpret a point in the ternary diagram.

( a )
Each dot represents the inner traits of an agent; its RGB colour reflects the weight of each trait (blue: conformist; red: radical; green: stubborn).The crossed dot represents the average inner traits.(b) Example of average inner traits in the ternary diagram: 60% conformist, 10% radical, 30% stubborn.(c) The ten inner traits assignations used in the simulations in Figure 7, along with the corresponding average inner traits in the ternary diagram.

Figure 3 :
Figure 3: Ternary diagrams visualising inner traits assignations ψ and average inner traits ψ.Panel 3a shows the whole inner traits assignation (along with its average), while panel 3b only shows the average inner traits.The relation between the two types of plots is visualised in panel 3c, showing that each of the ten inner traits assignations (plotted in a ternary diagram) can be represented by a single point, i.e. the average inner traits, which can also be plotted in a ternary diagram, with different axis labels.

( a )
Agreement plot of 5 opinion vectors.(b) Agreement plot of the opinion evolution (a parametric curve).

Figure 4 :
Figure 4: Panel 4a shows the general agreement of five different opinion vectors (represented in the figure by their corresponding histograms) plotted in the Cartesian plane.Panel 4b shows a parametric curve in the the agreement plot: the opinion evolution of 100 agents and the corresponding values of θ − and θ + are shown as a function of time (left) and the corresponding general agreement evolution is plotted in the Cartesian plane (right), visualising information on the evolution of the opinions that may be difficult to grasp otherwise.

Figure 6 :
Figure 6: Evolution of the CB model, with 100 agents, over four different digraph topologies and starting from ten different, randomly chosen, initial opinions, shown on the left-most column.Each of the four columns framed in green shows the opinion evolution and the final opinion distribution for each of the initial opinions, for a different choice of the digraph (Complete, Lattice, Ring, Small-World), shown at the top of the column along with its characteristics.The inner traits assignation is presented at the top left and has average traits: α = 0.4 (conformist), β = 0.22 (radical), and γ = 0.38 (stubborn).The ternary diagram of these inner traits can also be seen in Figure 3a.
(a) Evolution over a Complete graph topology.(b) Evolution over a Lattice digraph topology.(c) Evolution over a Ring digraph topology.(d) Evolution over a Small-World network topology.

Figure 7 :
Figure 7: Each agreement plot shows 10 different opinion evolutions starting from the same initial opinions (identical for all plots along the same column), over the same digraph (identical for all plots along the same row and shown to the left) and with the inner traits shown in Figure 3c.All simulations involve 100 agents and have evolved for 1000 time steps.
(a) Initial Opinions Histogram (b) Nominal Inner Traits Assignation (c) Nominal Signed Digraph

Figure 9 :
Figure 9: Initial opinions and nominal parameters.
(a) Nominal Opinion Evolution (b) Nominal Final Opinion Histogram

Figure 10 :
Figure 10: Simulation results with the nominal parameter values (evolving 100 agents).
(a) Opinion Evolution (b) Final Opinion Histogram (c) Opinion Evolution (d) Final Opinion Histogram
(a) Opinion Evolution (b) Final Opinion Histogram (c) Opinion Evolution (d) Final Opinion Histogram

Figure 16 :
Figure 16: All the average inner traits ψ corresponding to inner traits assignations ψ in Ã.

( a )
Ternary diagram plotting the average inner traits for the question-country pairs with cost < 7 according to Table 2. (b) Density plot of the ternary diagram: most questioncountry pairs have an average agent with more than 95% stubborn traits.

Figure 19 :
Figure 19: Analysis of the location of the average agents for all the question-country pairs with cost less than 7.

Figure 20 :
Figure 20: Histograms of opinion vectors that are representative of the five possible qualitative opinion distribution categories: Perfect Consensus, Consensus, Polarization, Clustering, and Dissensus.

Figure 21 :
Figure 21: Real transition table and transition tables produced by the CB model using the digraphs and inner traits assignations given by the Free and Constrained optimisation problems, along with the sum and percentage of cells above / on / below the diagonal.The two tables below show the absolute value of the difference between predicted and real transition tables.

Figure 22 :
Figure 22: Comparison between the Friedkin-Johnsen (FJ) model, for different values of susceptibility a, and the Classification-Based (CB) model, for corresponding values of conformist (α) and stubborn (γ) weights.All the 100 agents have the same values of a (FJ) and of α and γ (CB).The simulations start from the same initial opinions and evolve over digraphs with the same topology.The degree of susceptibility, prejudice, conformism, and stubbornness is represented by the colours cyan, magenta, blue, and green respectively.

Figure 23 :
Figure 23: Real transition table and transition tables produced by the FJ model using the digraphs and inner traits assignations from the Free and Constrained optimisation problems.The sum and percentage of cells above, on, and below the diagonal shown.The two bottom tables correspond to the absolute value of the difference between the predicted transition tables and the real one.
e. C(W ) = {(i, j) | P (i, j) = ∅ and i = j}.Then the average path length and diameter of the digraph W are: balance index is computed as BI = tr(exp(W )) tr(exp(D))

Table 3 :
Results using the Null model, for comparison with Table2.Out of 780 possible question-country pairs, 332 have a cost less than 7 (an accuracy of 43% in total).The average cost of accepted question-country pairs is 4.17.

Table 11 :
, indicating that not only more question-country pairs Results of the Constrained optimisation problem using the Friedkin-Johnsen model.The average cost along all the countries is 10.3918.Out of 780 possible question-country pairs, 330 have a cost less than 7 (an accuracy of 42% in total).The average cost of accepted question-country pairs is 4.1.
Q1 Some people feel they have completely free choice and control over their lives,whileother people feel that what they do has no real effect on what happens to them.Please use this scale where 1 means no choice at all and 10 means a great deal of choice to indicate how much freedom of choice and control you feel you have over the way your life turns out Q2 All things considered, how satisfied are you with your life as a whole these days?Using this card on which 1 means you are completely dissatisfied and 10 means you are completely satisfied where would you put your satisfaction with your life as a whole?Q3 How satisfied are you with the financial situation of your household?Please use this card again to help with your answer (1 is completely dissatisfied, 10 is completely satisfied) Q4 How would you place your views on this scale? 1 means you completely agree with the statement Incomes should be made more equal; 10 means you completely agree with the statement We need larger income differences as incentives for individual effort.And if your views fall somewhere in between, you can choose any number in between.Q5 How would you place your views on this scale? 1 means you completely agree with the statement Private ownership of business and industry should be increased; 10 means you completely agree with the statement Government ownership of business and industry should be increased.And if your views fall somewhere in between, you can choose any number in between.Q6 How would you place your views on this scale? 1 means you completely agree with the statement The government should take more responsibility to ensure that everyone is provided for; 10 means you completely agree with the statement People should take more responsibility to provide for themselves.And if your views fall somewhere in between, you can choose any number in between.Q7 How would you place your views on this scale? 1 means you completely agree with the statement Competition is good.It stimulates people to work hard and develop new ideas; 10 means you completely agree with the statement Competition is harmful.It brings out the worst in people.And if your views fall somewhere in between, you can choose any number in between.Q8 How would you place your views on this scale? 1 means you completely agree with the statement In the long run, hard work usually brings a better life; 10 means you completely agree with the statement Hard work doesn't generally bring success-it's more a matter of luck and connections.And if your views fall somewhere in between, you can choose any number in between.Q9 How much you agree or disagree with the statement Science and technology are making our lives healthier, easier, and more comfortable.