Simulating societal polarization dynamics using Streamlit
Introduction
Societal polarization is the phenomenon where opinions on specific topics (ideological polarization) and emotions towards other political groups (affective polarization) within a society diverge over time. While evidence points to increasing affective polarization in countries like the USA the phenomenon of affective polarization is more nuanced in other countries (see “Cross-Country Trends in Affective Polarization” by Boxell et al).
In the paper “Preventing extreme polarization of political attitudes” by Axelrod et al. a simple agent-based model is introduced in which the authors focus on issue based polarization. The model hinges on three key parameters:
- Exposure probability E: The likelihood that an agent interacts with another agent holding a differing opinion.
- Tolerance window T: The extent to which an agent is accepting of another’s opinion.
- Reaction R: The intensity of an agent’s shift in position upon encountering another’s viewpoint.
Importantly, the amount by which the actor moves is always larger when repulsed by an opinion compared to the case when an actor is attracted to the position of another actor. Simulation
Implementation and Simulation
Inspired by the paper I replicated the model in Python. The code is based on a nice framework for agent based simulation called AgentPy. To make the model easily accessible I packaged it into a Streamlit applicattion and published it on Streamlit Cloud.
You can play around with the model here on Streamlit Cloud. For parameters E=0.1, T=0.25 and R=0.25 we get a fully polarized society (consisting of 30 agents) after 1000 simulation iterations. The following plots show the polarization dynamics over time and the distribution of opinions after 1000 iterations.
Summary and Disussion
The paper provides a thorough analysis of the model’s implications. One notable takeaway is the potential counterproductive effect of dismantling “filter bubbles.” In a society predisposed to polarization, increasing exposure probability could inadvertently accelerate polarization, assuming all other parameters remain constant.
Is this useful? Well..from the technical perspective it was fun replicating the model and working with AgentPy. It was also the first time I built a Streamlit app which was also a nice surprise in how easy and simple the whole development and deployment process was.
The model’s societal implications, however, are more ambiguous. It offers a plausible explanation for how social media might expedite polarization, as discussed. Yet, the model also posits a debatable assumption:
Unless the actor is already near an extreme, an interesting effect of this rule is that repulsion moves actors farther than attraction does. […] Repulsion is less likely than attraction, but it leads to greater movement when it does occur.
The rationale for this assumption remains unclear.
All in all a fun exercise.