Bridging the gap between agent based models and continuous opinion dynamics

There is a rich literature on microscopic models for opinion dynamics; most of them fall into one of two categories - agent-based models or differential equation models - with a general understanding that the two are connected in certain scaling limits. In this paper we show rigorously this is indeed the case. In particular we show that DEMs can be obtained from ABMs by simultaneously rescaling time and the distance an agent updates their opinion after an interaction. This approach provides a pathway to analyse much more diverse modelling paradigms, for example: the motivation behind several possible multiplicative noise terms in stochastic differential equation models; the connection between selection noise and the mollification of the discontinuous bounded confidence interaction function; and how the method for selecting interacting pairs can determine the normalisation in the corresponding differential equation. Our computational experiments confirm our findings, showing excellent agreement of solutions to the two classes of models in a variety of settings.


Introduction
Much of opinion dynamics finds its roots in the models of Hegselmann-Krause (HK) [1] and Deffuant-Weisbuch (DW) [2].Both models are based on the underlying assumption, known as bounded confidence, that people interact only with those who already share a sufficiently similar opinion.In the DW model each individual can only interact with one randomly chosen partner at a time, while in the HK model individuals can interact with everyone in their interaction radius simultaneously.Computational experiments have shown that solutions to both models exhibit similar macroscopic behaviours, such as a transition from consensus to a growing number of opinion clusters as the bounded confidence radius is reduced, but their exact dynamics can be quite different.
Since their initial introduction, both models have been studied and adapted extensively, with their influence and major features visible in a wide range of modern opinion dynamics models (see review papers [3][4][5][6]).
In this paper we will investigate the two most common approaches in opinion dynamics: agent-based models (ABMs) and differential equation models (DEMs).The category of ABMs includes the original DW model, while many DEMs are generalisations of the ordinary differential equation (ODE) version of the HK model.In ABMs opinion updates are discrete events in which a pair of randomly chosen individuals interact and then change their opinion(s).By contrast, in DEMs opinions change continually as individuals interact constantly with the entire population, rather than with one individual at a time.This distinction is more than the difference between discrete and continuous time, but is a fundamental difference in the nature of interactions and opinion updates.For example, in ABMs both the order of these random interactions and the distance by which individuals update their opinions can play a major role in the dynamics, but these features are essentially absent from DEMs.Despite these differences, we will show that the models are connected in certain scaling regimes.
Our analysis begins with the following observation: reducing the update distance in the DW model leads to a slower convergence to equilibrium [2,7] and affects both the location and composition of opinion clusters [7,8].We take this situation to the extreme, considering an ABM in which agents interact at a very fast rate but with a very small update distance.In this setting, the effect of many small, random interactions in the ABM mirrors the continuous opinion updates characteristic of DEMs.Motivated by this, we will show that under a simultaneous rescaling of time and update distance, the trajectories of the ABM converge to those of a limiting DEM.
Primarily this clarifies when ABMs and DEMs will give similar results, but also addresses the question of when the two models are capturing the same real-world behaviour, highlighting their inherent assumptions.Furthermore, we will show how changes made in the ABM can translate to those in the corresponding DEM, drawing parallels between the choices made in each setting.This link also bridges the gap between two research communities by demonstrating the essential similarity of two seemingly disparate modelling approaches.Our effort to establish connections between the many opinion formation models will help motivate modelling choices and improve our understanding of these complex processes, we hope this drives others to seek similar connections.This paper is organised as follows: firstly in Section 2 we define an ABM and state our main results about its convergence to an ODE system.We also discuss several adaptations to the ABM that appear in the relevant literature, including the introduction of various additional noise terms, and give the corresponding ODE and stochastic differential equation (SDE) limits.A summary of the limiting models for all cases examined can be found in Table 1 and proofs given in the Supplementary Material A. In Section 3 we present numerical results for each of the ODE and SDE limits described in Section 2. Finally we conclude with a discussion of the significance and limitations of our results in Section 4.

Theory
We begin by introducing several ABMs, based on a generalisation of the DW model, and discuss their respective limits.Interested readers can find the rigorous derivation and the mathematical statements of these limits, which are based on Durrett [9], in the Supplementary Material.
Throughout this paper we will always consider a finite population size N , and do not examine any meanfield limits or density-based models (see for example [3,[10][11][12][13][14][15]).Such models offer one way of comparing the behaviour of ABMs and DEMs (through the limit of a large population size) while the aim of this paper is to offer an alternative approach for a fixed N < ∞.

Agent based model
Consider N agents with initial opinions x(0) = (x 1 , . . ., x N ) ∈ R N .For generality, we do not prescribe an interval in which an individual's opinion should lie, but for the majority of models we consider opinions will remain within the convex hull of the initial opinions [16,17].
Beginning at t = 0, we proceed in discrete timesteps of size h > 0. At each timestep, choose a pair of individuals i and j from the population.This choice is made uniformly at random with replacement (different selection mechanisms are considered in Section 2.2).After individuals i and j have been selected, they go on to interact with probability p ij (x).Note that p ij does not include the probability of selecting individuals i and j, only the probability of interaction after their selection.
The form of p ij (x) plays a significant role in the consensus dynamics.The majority of opinion formation models assume that interactions depend on the opinion distance, that is p ij (x) = ϕ(|x i − x j |) for some interaction function ϕ(d) : R + → [0, 1].The bounded confidence (BC) interaction function with radius R ∈ R + , as used in the DW model, also falls into this category, Here the only source of noise is the selection of individuals i and j, as an interaction will occur (or not occur) deterministically based on their opinion difference.Other possible choices of interaction functions include exponentially decaying functions and polynomials, see e.g.[15,16,18].
An common adaptation to the BC interaction function is the introduction of selection noise (see [19] and references therein).Hereby, after picking i and j, a random number r is drawn from a given distribution X .Individuals i and j then interact if Hence the probability of interaction is where F X is the cumulative distribution function of X .Thus selection noise corresponds to an altered interaction function.In particular, the introduction of selection noise can provide a mollification (or smoothing) of the discontinuous BC interaction function.Several examples are shown in Figure 1 for a variety of normal and uniformly distributed X 's.Note that for the normal distributions the interaction function is always strictly positive, while for the uniform distributions it is zero outside some interval around R. This distinction affects which interactions are possible and has a major impact on the behaviour of the limiting ODE systm [16].The probability of interaction p ij also provides an opportunity to introduce a social network by setting the probability of interaction equal to the network adjacency matrix.
In order to establish the connection between ABMs and DEMs, we will require the following assumptions on p ij : Assumption 1a) is required so that p ij can be interpreted as the probability of i and j interacting once selected.Assumption 1b) is required so that the limiting system of differential equations is well-defined on R N .In particular this excludes the discontinuous BC interaction function without mollification by selection noise.Such assumptions on the continuity of interaction functions are often necessary to make progress in analysing DEMs [20,21], making the identification of realistic mechanisms, such as selection noise, that give rise to smoothed interaction functions especially important.
If i and j do interact, then individual i updates their opinion according to, with all other individuals' opinions remaining the same in the next timestep.For a given timestep h, let µ h = N h.If h ∈ (0, N −1 ] then µ ≤ 1 and individuals' opinions will remain within the convex hull of the initial opinions x(0).
Remark 2.1.The setup in which both individuals i and j update their opinions will give the same limit with µ = N h/2, under the assumption that p ij (x) = p ji (x) for all x ∈ R N .
Overall, an interaction between individuals i and j gives the following possible updates to the opinion of individual i, This process of selecting a pair of individuals, determining if they interact and updating the first individual's opinion, continues until some given time T ∈ [0, ∞) is reached.
Main result: Let x 0 be the opinions at time t = 0.Then, as h → 0, trajectories of the ABM obtained using update rule (5) converge in distribution to the solution X i = (X i (t) : t ∈ [0, T ]) satisfying, Convergence in distribution means that the distribution of a sequence of random variables (here the trajectories of the ABM) converges to the distribution of a limiting random variable.Here the limit is the solution of the ODE system (6), so it is deterministic, and thus the trajectories of the ABM also converge in probability.Informally, this means that as h → 0 the trajectories of the ABM are almost surely arbitrarily close to the solution of the ODE system.Formal definitions of both types of convergence are given along with the proof of the main result in the Supplementary Material.
The ODE ( 6) is a general model of opinion formation in continuous-time, whose behaviour is analysed in e.g.[16,22,23].This result provides a link between the ABM and ODE model, showing that under the assumption of small, frequent pairwise interactions their behaviours are comparable.In addition, it shows how the interaction probability p ij in the ABM, which can encode interaction functions, selection noise and networks, corresponds to opinion weights in the ODE model.We will continue to explore this connection by considering various relevant generalisations in the following sections.
Remark 2.2.Here we have defined an ABM that is continuous in opinion space and discrete in time.It would also be possible to define a continuous-time version of this ABM, with pairwise interactions occurring randomly at some constant rate multiplied by p ij h.In this continuous-time ABM, interactions (and therefore opinion updates) are still discrete 'events', unlike the continual opinion updates in DEMs.Hence, changing the ABM from discrete-to continuous-time would not resolve the fundamental difference between ABMs and DEMs.However, the re-scaling and convergence results used in this paper could also be applied to a continuous-time version of the ABM to obtain the same limiting models.

Normalisation
A common variation of the ODE model ( 6) is to replace the normalisation by the population size N with normalisation by either the network degree (e.g. in [24]) or by the sum of interactions (e.g. in [16,18,25]).We show below how both of these variations can be obtained as the limit of an ABM by changing the way in which the interacting individuals i and j are selected.Recall that in (5), individuals i and j are chosen uniformly at random with replacement.
Remark 2.3.If the choice is made without replacement, the ODE (6) is unchanged if we set µ = (N − 1)h, rather than µ = N h.
Firstly we consider normalisation by node degree.Define a fixed, weighted network with adjacency matrix A ∈ [0, 1] N ×N , with A ii = 1 for all i = 1, . . ., N .This network will only be used when picking the pair of individuals i and j, and we do not assume that this network appears in the interaction probabilities p ij .For each individual i, denote their node degree by k i , this is At each timestep, select an individual i.The second individual j is then selected with probability That is, j is selected from amongst the neighbours of individual i, with probability proportional to the weight of the edge between i and j.The limiting ODE model in this case is given by Secondly we consider normalisation by interaction probability.In order for this setup to be well-defined we assume that there exists c > 0 such that p ii (X) > c for all X ∈ R N .This can be interpreted as each individual always maintaining some confidence in their own opinion.
At each timestep, first select an individual i.For this individual, calculate p ij for each j ∈ {1, . . ., N }.The second individual j is then selected with probability That is, j is selected with probability proportional to the likelihood that they would go on to interact with individual i.In this case we do not consider again the interaction probability p ij , instead after individual j is selected an interaction always then occurs.The limiting ODE model in this case is given by This more closely reflects the normalisation by the number of interacting agents in the original HK model.
The key difference is that the ODE system (11) corresponds to an ABM in which individual i considers the likelihood of interaction with all individuals before j is chosen, whereas the ODE system (6) corresponds to an ABM in which individual i considers the likelihood of interaction only after j is chosen.These variations show how the interpretation of the method through which i and j are selected in the ABM can help motivate the choice of normalisation in the ODE.In the case of opinion dynamics, normalisation by the entire population size may in fact be the more realistic option.

Additional sources of noise
As described in [19] there are various places that additional noise can be introduced into the ABM.For many of these additional noise terms, as well as some not considered in [19], a similar re-scaling as in the previous section again gives rise to a DEM.The following cases will be considered: • Ambiguity noise: in which the opinion of individual j is not clearly communicated to individual i, meaning that x j is replaced by ω j = x j + η h , where η h is some random variable depending on h.
• External noise: in which the opinion update of individual i is altered by adding a random variable ξ h .Alternatively, this noise could be added only when individuals i and j interact, in which case it is referred to as adaptation noise [19].
• Random update distance: in which the fixed value of the update distance µ is replaced by a random variable ν h .
These changes are made by altering the update rule (5), rather than by changing the way in which i and j are selected.We return to the original setup in which i and j are chosen uniformly at random with replacement.In this section we will introduce assumptions on the distributions of η h , ξ h and ν h , and their behaviours as h → 0, to ensure convergence of the model with the same drift term as previously.We show that, under these assumptions, ambiguity noise leads to the same ODE limit (6), while external noise and random update distance have the potential to give rise to SDEs.
Remark 2.4.Due to the many possible implementations, we do not consider here any boundary conditions on either the ABM or SDE system.Such boundary conditions could be included in the ABM and the changes followed through to determine the corresponding conditions on the SDE, but such an adaptation is beyond the scope of this paper.This is discussed further in Section 4.
The following notation will be used throughout this section.Consider a family of real-valued random variables ζ = (ζ h ) h>0 , where ζ h indicates dependence on h.We define with m k (ζ) undefined if a finite limit does not exist.

Ambiguity noise
Ambiguity noise represents the fact that an individual may not clearly communicate their opinion.The noise therefore affects both the probability of interaction and the location of individual i's new opinion.
We assume here that p ij (x) = ϕ(|x j − x i |) for some function ϕ : R + → [0, 1] that is Lipschitz continuous with Lipschitz constant L. We modify the ABM by replacing the update rule (5) with where ω j = x j + η h , with the following assumptions on η.
Assumption 2. Let η h correspond to the ambiguity noise in (13).Assume the family of real random Broadly speaking, the first assumption ensures that ϕ(|ω j − x i |) → ϕ(|x j − x i |) as h → 0, while the second is required to ensure convergence of the ABM.Under these assumptions on η, this system has the same ODE limit (6) as the ABM without ambiguity noise.Ambiguity noise affects the likelihood of interactions, but the first part of Assumption 2 ensures that in the limit h → 0 there is no net increase or decrease in this likelihood.As µ becomes small, each individual interaction has less significance, with the average behaviour instead driving the dynamics.Even though ambiguity noise does affect the ABM [19], this additional stochasticity does not impact the average behaviour and therefore does not lead to a different limit.This demonstrates that introducing additional noise and complexity at the ABM level does not necessarily impact the re-scaled system.

External noise
We now adapt the ABM by introducing additive noise to represent random external influences on an individual's opinion.We replace the update rule (5) with where ξ h ∈ R is a random variable representing all external influences on individual i's opinion.Motivated by the results applied in the Supplementary Material, we introduce the following assumptions on ξ, Assumption 3. Let ξ h correspond to the ambiguity noise in (14).Assume the family of real random The first of these assumptions ensures that the noise ξ does not introduce a drift in opinion.
If m 2 (ξ) > 0, meaning the variance of ξ is decreasing o(h), we obtain an SDE limit with additive noise.An example of this is ξ h ∼ N (0, sh) for some constant s > 0, which gives m 2 (ξ) = s.The final assumption on ξ is required to ensure convergence in this case.The limiting SDE is given by where β i are independent standard Brownian motions.This shows that additive noise introduced in the ABM can translate directly to additive noise in the scaling limit.The noise is additive as m2(ξ) N is a constant.Note that for m 2 (ξ) = 0 we recover the ODE limit (6).

Adaptation noise
Next we consider an adaptation of the ABM in which noise is added only if individuals i and j interact.This is referred to as adaptation noise in [19].We replace the update scheme in (5) with where ξ is again assumed to satisfy Assumption 3. In this case we obtain the limiting SDE, Here the additional noise term in the ABM has the potential to change the structure of the limiting DEM, motivating a feasible multiplicative diffusion function for the SDE.

Random update distance
Finally we adapt the ABM by adding a new source of noise: replacing the fixed value of µ with a random variable ν.This represents the idea that opinion updates do not move by a set difference, but that the outcome of an interaction is also random.At a particular interaction, individual j may be more or less persuasive and individual i may be more or less receptive or confident in their existing opinion.Additionally, we do not exclude the possibility of ν h taking negative values, only requiring that the mean returns the fixed value of µ = N h used in the standard ABM, meaning individuals may move apart after an interaction.We replace the update scheme (5) with Unlike in the external noise case, the noise term is also multiplied by (x j − x i ), so a consensus state in which all individuals have identical opinions is still a fixed point.
We make the following assumptions on ν, mirroring those on η, Assumption 4. Let ν h correspond to the ambiguity noise in (18).Assume the family of real random As before, if m 2 (ν) = 0 we obtain the standard deterministic ODE limit (6).If m 2 (µ) > 0 we obtain a limiting SDE with a new multiplicative diffusion function As both the drift and diffusion functions of the SDE are zero at a consensus state, there is no movement away from consensus or change in the position of consensus once it is established.

Summary table
Node degree normalisation (2.2) Interaction probability normalisation (2.2) Ambiguity noise (2.3.1) Table 1: Summary of variations on the ABM defined in Section 2.1 and the corresponding limiting differential equations.m2(•) is defined in (12).

Numerical results
In order to demonstrate the convergence results described in Section 2 we perform numerical simulations of both the ABM and ODE/SDE limits.To allow for a fair comparison between the different models we use the same setup throughout.
Let N = 50.We select a set of initial conditions x(0) uniformly at random in the interval [−1, 1] for each agent, and use these same initial conditions in all simulations.Let h = 10 −5 and final time T = 20.We use the BC interaction function with Gaussian selection noise, given by where F N (0,1) is the cumulative distribution function of a standard normal distribution.Interaction functions of this form can be seen in the left panel of Figure 1.
In this section we will compare timeseries of ABMs and their corresponding limits.For two timeseries X and Y we calculate the error timeseries according to

ODE limits
Solutions to the ODE are calculated numerically using a forward Euler scheme with a timestep of 0.01. Figure 2 shows a comparison between a single realisation of the ABM (Section 2.1 with update rule (5)) in solid lines and the limiting ODE (6) in dashed lines.Colours represent the initial opinions of the N = 50 different agents.For this value of h there is clearly an excellent match between the two timeseries, demonstrating the convergence of the ABM to the ODE system.An inset shows the error, calculated according to (21).There is an excellent match between the two sets of dynamics.
To quantify this comparison we examine the difference between the ODE model ABM for various values of h.Here the error over the whole timeseries is calculated as follows: realisations of the ABM are sampled at the timesteps of the ODE, the Frobenius norm of the difference between these matrices is then calculated and this value is divided by the length of the simulation to give the error.For each value of h the ABM is simulated 100 times and the error calculated for each simulation.
Our results are shown in a violin plot in Figure 3.For each value of h the violin outline shows the distribution of error values observed over the 100 realisations, with the mean and interquartile range shown within the violin shape.Figure 3 shows that as h is decreased, both the mean error and spread in errors decrease.The convergence results we apply in the Supplementary Material do not provide a bound on the convergence rate between the models, only guaranteeing weak convergence in the limit h → 0. However, these results show, as would be expected, that decreasing the value of h gives a better approximation to the ODE limit.(6) for different values of h.For each value of h the ABM is run 100 times with the same initial conditions and the error against the ODE calculated.

Normalisation
We also implement the two alternative methods for selecting the interacting pair i and j discussed in Section 2.2.To consider the limiting ODE (9) we must first define a network.We generate an Erdős-Rényi random network [26] and take its adjacency matrix.This adjacency matrix is then adapted by setting A ii = 1 for all i = 1, . . ., N .The ABM is simulated again, and now at each timestep individual i is selected first, then j is selected according to (8).The results are shown in Figure 4.Although the dynamics are more complex than in the case of the fully connected network (as in the original ABM) there is still an excellent match between the ABM and ODE limit (9).9) with h = 10 −5 .A single realisation of the ABM is plotted in solid lines, with the ODE plotted in dashed lines.Colours represent the initial opinions of the N = 50 different agents.An inset shows the error, calculated according to (21).There is again an excellent match between the two sets of dynamics.
Similar results are obtained for the case in which individual i first calculates the probability of interaction with each individual, then selects j with probability proportional to the interaction probability (10).This model does not include a network.These results are shown in Figure 5.Here the population reaches the clustered state much faster than seen in Figure 2. As we observe two clusters forming, individuals will have a probability of interaction that is close to 1 for approximately half the population, and a probability of interaction that is close to 0 for the rest of the population.Hence the normalisation factor in (11) ( N ℓ=1 p iℓ ) will be approximately half of that in (6) (N ), so the dynamics are notably faster.This effect is more pronounced at the beginning of the dynamics, as the spread of initial opinions reduces the value of N ℓ=1 p iℓ , thus leading to even faster dynamics.It is also more pronounced in individuals with extreme opinions, meaning their movement towards more moderate opinions is even faster.Both the ABM and ODE limit (11) capture these behaviours.We do not include numerical results for the variation in which i and j are chosen without replacement, the variation in which both i and j update their opinions, or the addition of ambiguity noise, as the limiting models are exactly the same as the base ODE case.

SDE limits
Realisations of the SDE are calculated using an Euler-Maruyama scheme with a timestep of t = 0.01.For each of the comparisons in this section we use the same initial conditions and simulation setup as before.We run 5000 realisations and calculate the mean and variance between realisations, over time, for each individual.Due to the multiple sources of stochasticity, this high number of realisations is chosen to allow sufficient opportunity for the variances of each model to be representative of their true values.

External noise
Firstly we consider the ABM with external noise, given by update rule (14).We take ξ h ∼ N (N h, sh) with constant s = 0.05.Here E (ν h ) 2 = (N h) 2 + sh, meaning m 2 (ν) = s > 0. We observe excellent agreement between both the means and variances of the ABM and SDE realisations.As in the ODE model, the means reach a clustered state.For the majority of individuals their mean behaviour is very similar to that of the ODE model and the variance between realisations is low.This is perhaps unsurprising given the relatively small size of m 2 (ν).However, for a small number of individuals with initial opinions close to zero (appearing in blue in Figure 6) their mean behaviour is different and their variance is significantly higher.This indicates that, with the addition of noise, they may sometimes enter either of the two major opinion clusters.There are also some individuals with initial opinions close to one (appearing in yellow in Figure 6) whose variance is higher, indicating they may sometimes not join the nearby opinion cluster or make take a long time to do so.Both of these behaviours can be observed in the selected example timeseries in Figure 7.
These example timeseries also show that, unlike the deterministic case, individuals' opinions continue to change after the opinion clusters have formed.This is due to the fact that interactions are still occurring, meaning individuals' opinions are still affected by the external noise, even if their opinions are very close to those they are interacting with.This can also be seen in the variances in the lower panel of Figure 6, which continue to increase as the simulation goes on.If these simulations were allowed to run indefinitely these variances would continue to increase as the opinion clusters followed a random walk, driven by the continued external noise.

Adaptation noise
We now consider the ABM with adaptation noise, given by the update rule (16).As previously we take ξ h ∼ N(N h, sh) with constant s = 0.05.
In this case we again observe (in Figure 8) an excellent match between the behaviours of the ABM and limiting SDE system (17).The behaviour of the means (across realisations) is again similar to that of the ODE model in Figure 2. As in the previous case (external noise) we observe one individual with significantly higher variance than all others, again explained by entering different opinion clusters, or neither opinion cluster, in different realisations.In this case the variance of this individual drops slightly towards the end of the simulations, indicating that they do eventually join one of the clusters.
A similar behaviour can be observed in the individuals with initial opinion near one (appearing in yellow) whose variance initially grows, peaks around t = 6, then drops again.This indicates that these individuals may take some time to join an opinion cluster, but always do so eventually.This variation in the time taken for clusters to form can be seen in the example timeseries in Figure 9.As the population splits into two noninteracting clusters, and individuals only experience noise when they interact, this model has comparatively smaller noise than in the previous case, leading to more predictable outcomes.

Random update distance
Here we give a numerical demonstration of the convergence to the SDE system (19) shown in Section 2.3.4.Let ν h ∼ N(N h, sh), with constant s = 5.As the noise term ν is multiplied by the distance between individuals' opinions, we choose a larger value of s so that the presence of noise is still clear.
The top panel of Figure 10 compares the mean opinion of each agent in the ABM in solid lines and the SDE system in dashed lines.There is clearly a good fit between the two.Similarly the behaviours of the variances shown in the lower panel of Figure 10 match well, although the values towards the end of the timeseries differ slightly for some individuals.
The behaviour of the means and variances mirrors that seen in Figure 6 for the ABM and SDE system with external noise.However, in this case, there are more individuals with initial opinions near zero who have a high variance.This may be caused by the possibility of ν taking negative values, meaning interactions can

cause individuals' opinions to move apart, adding to the uncertainty on which opinion cluster individuals will enter.
There is a key difference in the example timeseries shown in Figure 11, compared against those in Figures 7 and 9: towards the end of each simulation, individuals' opinions stop changing.This is due to the fact that the noise term ν is multiplied by the distance (x j − x i ).Towards the end of the simulation, pairs of individuals either have very similar opinions, meaning (x j −x i ) is very small, or no longer interact.Hence the noise arising from ν also becomes very small and the variance plateaus.In this case, if the simulations were left to run indefinitely there would be no further change in individuals' opinions and no continued increase in variance, as once a clustered state is reached it is fixed.This also makes the dynamics less predictable, as there is no possibility that individuals will eventually, due to continued stochasticity, join a nearby opinion cluster.

Discussion
The theoretical results presented in Section 2 provide a framework in which choices made in the ABM setting can be compared directly to those made in the ODE/SDE setting.We show that under a simultaneous rescaling of time and update distance the behaviour of the ABM mirrors that of DEMs.This confirms the assumptions inherent to DEMs: that pairwise interactions between individuals produce very small changes in opinion, but occur very frequently.These assumptions are not always valid in real-world scenarios, but when they are we have shown that DEMs are a very good approximation of ABMs.Moreover, we show how including external noise or a random update distance can translate into stochasticity in the limiting model, motivating the choice of diffusion in an SDE model.Our numerical results in Section 3 demonstrate the excellent match between the behaviour of the various ABM and SDE models, showing how both can capture a variety of complex behaviours.This means that the benefits of DEMs, such as reduced computational cost and increased analytic tractability, can be combined with the interpretability of ABMs.
However, the methods we have presented are not without their limitations.As previously discussed, we cannot take p ij to be the BC interaction function without selection noise, as this discontinuity prevents the necessary guarantee of existence and uniqueness of solutions to the corresponding DEM.This issue occurs whenever we wish to implement the BC interaction function in continuous time [17] and questions of existence and uniqueness of different types of solutions to the ODE model have been addressed [20,22], but further technical work is required to allow for a comparison against the ABM.In addition, this approach cannot capture effects such as Pineda noise [27] in which jumps in opinions cannot be bounded by a function of h, although convergence to a jump-diffusion process could be considered.Figure 7 shows an example timeseries in which noise causes some individuals' opinions to leave the initial interval [−1, 1].Boundary conditions could be defined for the ABM and the changes tracked through to identify when a limiting SDE exists.As there are many different ways that boundary conditions could be enforced (for example: reflecting or absorbing boundary conditions at the ends of the opinion interval; restricting the random variables η, ξ and ν to prevent movements outside the convex hull; multiplying noise terms by a function of x i that is zero at the boundary) we present instead more general results that could be adapted further if necessary.

A.1 Results from Durrett's Stochastic Calculus
We begin by formulating the ABM as a Markov process.For each h > 0 let Π h (x, •) be the transition function on R N and Y h mh , m = 0, 1, 2, . . . the corresponding discrete time Markov process.Define X h t = Y h h⌊t/h⌋ , i.e.X h t is constant on intervals [mh, (m + 1)h], as well as and In addition, define functions a : R d → S N and b : R N → R N , where S N is the set of non-negative definite real N × N matrices.Assumption 5 is satisfied if a and b are both globally Lipschitz continuous, see [9].The stochastic process X being a solution to the martingale problem for coefficients a and b is equivalent to it being a weak solution of the corresponding SDE As we are concerned with weak convergence of the ABM to the SDE, we use this representation.See Section 5.4, specifically the discussion of Theorem 4.5, in [9] for full details.Assumption 6.For each i, j with Before stating the main theorem we give definitions of two relevant notions of convergence for stochastic processes.We will consider processes with trajectories in the space of càdlàg functions, D([0, T ], R N ) for any T < ∞.Denote by d the metric on this space, as described in [9,28] (see these for a complete description of this space and its properties).The following definitions of convergence are adapted from those given in [28].
Definition A.1.For a random element X t and a sequence of random elements {X h t }, let P and P h denote their respective distributions.We say For a given (deterministic) c ∈ D([0, T ], R N ), convergence in probability is equivalent to convergence in distribution [28].
We now present the main results from [9] we will use.
Theorem 7.1 statement: If X h 0 = x h → x and Assumptions 5 and 6 hold, we have X h t ⇒ X t as h → 0, where X t is the solution of the martingale problem with coefficients a and b, with X 0 = x.

A.1.1 Useful Lemmas
The first lemma replaces the truncated moments in ( 22) and ( 23) with regular moments and replaces (24) with an easier expression to calculate.Let 1 ≤ i, j ≤ N and p ∈ N, define and then Assumption 6 hold.
A second lemma is helpful in the case of deterministic limits.In this case, as the limit X t is deterministic, the process X h t converges to X t both in distribution and in probability.

A.2 Convergence results
Consider the ABM defined in Section 2.1.We will use Lemma 8.5 from [9] (given above) to show that this Markov process converges weakly to the ODE (6).In the following calculations we assume that all subscript indices i, j satisfy 1 ≤ i, j ≤ N .
Let x be the current opinions of the population.As there are N 2 possible interactions, there are also N 2 states to which the system could move.These are given by for i, j = 1, . . ., N , where e i is the i th standard basis vector of R N .This state is obtained if i and j are chosen to interact, which occurs with probability N −2 , and indeed go on to interact, which occurs with probability p ij (x).If the same individual is chosen as both i and j, which occurs with probability N −1 , the system will not change state.Additionally, if i ̸ = j are chosen but do not interact, which occurs with probability 1 − p ij (x), the system will also not change state.Hence the transition probability function Π h is given by (31) We now check that these approximations converge suitably to b h i and a ii = 0. Recall that ϕ is Lipschitz continuous with Lipschitz constant L and is bounded above by 1.Using this Lipschitz condition, together with triangle inequalities, we obtain, As we assumed that E h |η| → 0 as h → 0, this gives the second condition of Lemma 8.5.The calculation for the bound on a h ii is more straightforward as there is a factor of h, so we need only show that all other terms are bounded.
As E h |η| → 0 as h → 0, and E h η 2 ≤ C we have that the first condition of Lemma 8.5 is satisfied.

A.3.2 Adaptation noise
Consider the ABM with adaptation noise, defined in Section 2.3.2 with update rule (16): x i (t + h) = x i (t) + µ h x j (t) − x i (t) + ξ h with probability p ij (x) x i (t) with probability 1 − p ij (x) .
We will now use Lemma 8.2 from [9] to show that this Markov process converges weakly to the SDE (17).Note that this case is introduced after that of the ABM with external noise (using update rule ( 14)) in Section 2.3.2, but will be considered first here as the calculations for the external noise case are a simplification of those below.
Let ρ h be the probability measure of the random variable ξ h and E h [•] the expectation with respect to this measure.Assume the family of random variables ξ satisfies Assumption 3. We first consider the case in which noise is added only if individuals i and j interact.In this case, As we wish to show that the limiting model is an SDE, rather than an ODE, we use Lemma 8.2 rather than Lemma 8.5.As before, we check the convergence of these approximations.
Clearly the first term in this sum converges to 0 as h → 0. As m 1 (ξ) = 0, E h [ξ] also converges to 0 as h → 0.
In addition, the definition of m 2 (ξ) ensures that the last term in the sum also converges to 0 as h → 0. Hence the second condition of Lemma 8.2 is satisfied.
As we are using Lemma 8.2, we also calculate γ h p with p = 4: The assumption that m 3 (ξ) = m 4 (ξ) = 0 guarantees that all terms in this sum converge to 0 as h → 0.

A.3.3 External noise
Now consider the ABM with external noise, defined in Section 2.3.2 with update rule ( 14): x i (t + h) = x i (t) + µ h x j (t) − x i (t) + ξ h with probability p ij (x) x i (t) + ξ h with probability 1 − p ij (x) .
We will use Lemma 8.2 from [9] to show that this Markov process converges weakly to the SDE (15).At each timestep, once individuals i and j are selected, there are two possible updates depending on whether or not an interaction occurs.This will lead to two integrals in the following calculation, but in fact gives a simpler final result.

Figure 1 :
Figure 1: Examples of interaction functions of the form (3), in which the discontinuous bounded confidence interaction function (1) (shown in red, dashed) is mollified with various types of selection noise.All the resulting interaction functions are Lipschitz continuous, but not necessarily differentiable everywhere.

Figure 2 :
Figure 2: Comparison of the dynamics of the ABM (Section 2.1) and ODE (6) with h = 10 −5 .A single realisation of the ABM is plotted in solid lines, with the ODE plotted in dashed lines.Colours represent the initial opinions of the N = 50 different agents.An inset shows the error, calculated according to(21).There is an excellent match between the two sets of dynamics.

Figure 3 :
Figure3: Violin plot of error between the ABM (Section 2.1) and ODE(6) for different values of h.For each value of h the ABM is run 100 times with the same initial conditions and the error against the ODE calculated.

Figure 4 :
Figure4: Comparison of the dynamics of the ABM on a network (Section 2.1) in which individual j is chosen according to(8) and the limiting ODE (9) with h = 10 −5 .A single realisation of the ABM is plotted in solid lines, with the ODE plotted in dashed lines.Colours represent the initial opinions of the N = 50 different agents.An inset shows the error, calculated according to(21).There is again an excellent match between the two sets of dynamics.

Figure 5 :Figure 6 :
Figure5: Comparison of the dynamics of the ABM (Section 2.1) in which individual j is chosen according to(10) and the limiting ODE(11) with h = 10 −5 .A single realisation of the ABM is plotted in solid lines, with the ODE plotted in dashed lines.Colours represent the initial opinions of the N = 50 different agents.An inset shows the error, calculated according to(21).There is again an excellent match between the two sets of dynamics.

Figure 7 :
Figure 7: Example timeseries of the ABM with external noise (14), using the setup described at the beginning of Section 3.

Figure 8 :
Figure 8: Comparison of the ABM with adaptation noise (16) and limiting SDE system(17) with the setup described at the beginning of Section 3.2.Solid lines show the mean (top panel) and variance (bottom panel) in the opinion of each individual across 5000 realisations of ABM, dashed lines show the same for the corresponding SDE system.Both panels include an inset showing the error, calculated according to(21).

Figure 9 :
Figure 9: Example timeseries of the ABM with adaptation noise (16), using the setup described at the beginning of Section 3.

Figure 10 :
Figure10: Comparison of the ABM with random update distance (18) and limiting SDE system(19) with the setup described at the beginning of Section 3.2.Solid lines show the mean (top panel) and variance (bottom panel) in the opinion of each individual across 5000 realisations of ABM, dashed lines show the same for the corresponding SDE system.Both panels include an inset showing the error, calculated according to(21).

Figure 11 :
Figure 11: Example timeseries of the ABM with random update distance (18), using the setup described at the beginning of Section 3.

Assumption 5 .
The functions a and b are continuous and the martingale problem with coefficients (a, b) is well-posed.

Table 1
collects the ABMs described in Section 2 and their corresponding ODE/SDE limits.

)
Remark A.1.As we never apply Theorem 7.1 directly and never calculate a h ij and b h i , only âh ij and bh i , we omit the 'superscript hats' from now on.Lemma 8.2: If p ≥ 2 and for all 0