Project 4: Opinion Dynamics over Two Topics

Santa Claus wants your vote.

Zombie Santa Claus.

1. Working with two opinions: Extending Opinion Dynamics Models

This project explores how multiple opinions interact and evolve within a population using an agent-based model. The model is inspired by the model presented in class, which introduces key concepts in opinion dynamics. The project focuses on understanding how individuals with varying opinions on multiple topics influence each other, and how this interaction can lead to different population-level outcomes such as consensus, polarization, or the persistence of diverse viewpoints.

In real life, individuals hold opinions on a wide range of issues. For example:

  • Political beliefs: Individuals might have opinions on topics like healthcare, taxation, or climate change.
  • Social issues: People might hold opinions on topics such as gun control, abortion rights, or immigration policies.
  • Cultural preferences: Individuals might have preferences for specific genres of music, types of cuisine, or fashion styles.

These opinions can influence each other and are often interconnected. For instance, someone’s stance on climate change might influence their views on energy policy, or their cultural preferences might be related to their social and political beliefs.

The project will use a model where each agent possesses a vector representing two different opinions, and adaptation from the model provided in class and available through this link. This simplified representation allows for a deeper understanding of the complex dynamics that arise when individuals consider multiple factors when forming and changing their opinions. The model will explore how different mechanisms of social influence, such as positive influence, bounded confidence, and negative influence, interact with the initial distribution of opinions and the structure of social interactions within the population.

By simulating these interactions, the project aims to gain insights into the conditions under which consensus, polarization, or the maintenance of diverse viewpoints emerge in populations with multiple interconnected opinions. These insights can be applied to understand opinion dynamics in various real-life scenarios, such as the formation of political ideologies, the spread of cultural trends, or the evolution of beliefs within online communities.

The project’s findings will contribute to a better understanding of the complexities of opinion formation and change in a world where individuals are constantly exposed to diverse viewpoints and social influences.

Research Goal:

The research goal for this project is to investigate how interactions between individuals with two different opinions can lead to different population-level outcomes, such as consensus, polarization, or the persistence of diverse opinions.

2. Learning Objectives

  • Understanding and Implementing Agent-Based Modeling: Students will learn to build and run agent-based models, translating theoretical concepts of opinion dynamics into computational logic. For example, defining agent properties, such as their two opinions, and specifying rules governing interactions and opinion updates. This aligns with the objective of implementing spatial agent-based modeling using techniques from class.
  • Exploring Social Influence Mechanisms: Students will investigate how various social influence mechanisms, like positive influence, bounded confidence, and negative influence, impact the model’s outcomes. They will learn to manipulate model parameters related to these mechanisms, observing how changes in, for example, confidence thresholds or the presence of negative influence affect the distribution of opinions in the population.
  • Analyzing the Emergence of Consensus, Polarization, and Diversity: A key learning objective will be to analyze the simulation results, identifying patterns of consensus, polarization, or the persistence of diverse opinions. This involves interpreting data visualizations, like scatterplots of agent opinions or metrics of polarization and extremism, and relating these patterns back to the model’s parameters and underlying social influence mechanisms.
  • Relating Model Outcomes to Real-World Phenomena: Students will learn to connect the model’s findings to real-world examples of opinion dynamics, such as the formation of political ideologies or the spread of cultural trends. For instance, they might consider how the model’s representation of bounded confidence relates to real-life echo chambers or filter bubbles, where individuals primarily interact with like-minded people. This aligns with the project’s goal of understanding how online communities shape opinions and beliefs.
  • Developing Scientific Communication Skills: Students will practice communicating their findings effectively through written reports and presentations. This includes clearly describing the model’s structure and assumptions, presenting data visualizations, and drawing meaningful conclusions about the relationship between social influence and opinion dynamics.

3. Problem Overview

In this computational modeling project, you will develop an agent-based model to simulate multiple opinions dynamics. For doing so, you will use a vector of opinions for each agent containing two different opinions. That is, agent \(i\) is defined by an opinion vector of length 2,

\[\overrightarrow{x_i} = (x_{i1}, x_{i2})\]

so that \(x_{ik}\) represents the kth opinion of agent \(i\). As before, all opinions will be a real number between -1 and 1.

3.1 Model Behavior Expectations:

It is expected that your model accounts for the following behaviors:

  • Agents exist on a spatial grid in a 2D-lattice structure
  • Initial opinions will be distributed randomly originally
  • Agents will have a color related to opinion 1 while the patches will change their color according to opinion 2 of each agent

3.2 Key Modeling Questions:

You will be trying to answer the following questions as you report your results:

  • How does the strength of positive influence affect the emergence of consensus or polarization when agents have two opinions?
  • What is the impact of varying the confidence threshold on the formation of opinion clusters and the persistence of diverse opinions?
  • Under what conditions does negative influence lead to polarization in a model with two opinions?
  • How does the correlation between the two initial opinions affect the final opinion distribution?
  • Does the inclusion of a spatial constraint, where agents primarily interact with their neighbors, promote or hinder the emergence of consensus or polarization in a two-opinion model?

3.3 Computational Approach:

Our initial starting point is the model created in class, accessible by clicking in this link.

Download the code in your computer, and make sure it runs without errors.

  1. Model Initialization
  • Agent Properties: Each agent will have a vector of length two, representing their opinions on two different issues. These opinions can be represented as real numbers between -1 (strongly against) and 1 (strongly in favor). For example:
    • opinion_vector = [opinion_1, opinion_2]
    • Initialize each element of the vector randomly within the range [-1, 1].
  • Population Structure: Test different population structures:
    • Well-Mixed: Agents interact randomly with any other agent.
    • Spatial: Agents are placed on a grid and interact only with their neighbors (e.g., a von Neumann neighborhood).
  • Set Initial Opinion Distribution: Determine the initial distribution of opinions for each of the two opinions. Consider:
    • Uniform Distribution: All opinion values are equally likely.
    • Normal Distribution: Opinions cluster around a mean value with varying spread.
Tip 1: Vectors

For creating a vector in Netlogo and setting the opinions, check the command n-values. Using this command, you can set the two values of a vector of size 2 as follows:

set values-in-a-vector n-values 2 [ 1 - (2 * random-float 1)]
Tip 2: Coloring the patches

To change the color of the patches where an agent is located, use the set pcolor command in the context of the agent. For example, the following command will change all patches colors with turtles on them to red:

ask turtles [
  set pcolor red
]
  1. Define Social Influence Mechanisms
  • Positive Influence: When agents interact, their opinions become more similar. Determine:
    • Strength of Influence: How much do opinions change after an interaction? This can be a fixed parameter or a function of the distance between opinions.
    • Confidence Threshold (\(d\)): Do agents only interact with others whose opinions are within a certain threshold of similarity? If so, set a value for \(d\).
  • Negative Influence: When agents with differing opinions interact, their opinions become more dissimilar. Decide:
    • Conditions for Negative Influence: Will all dissimilar interactions lead to negative influence, or only those exceeding a certain threshold?
    • Strength of Negative Influence: How much do opinions diverge due to negative influence? This can be a fixed parameter or a function of the distance between opinions.
  1. Implement Agent Interactions
  • Choose Interaction Partners:
    • Well-Mixed: Select a random agent from the population.
    • Spatial: Select a random neighbor from the agent’s neighborhood.
  • Calculate Distance and Influence Weight: Determine the distance between the interacting agents’ opinion vectors. Use a suitable distance metric (e.g., Manhattan distance). Calculate the influence weight based on the distance. For example:
    • influence_weight = 1 - distance
  • Update Opinions: Adjust each agent’s opinion based on the influence weight and the selected influence mechanism (positive, negative, or bounded confidence). Ensure opinions stay within the range [-1, 1].
Distance between two agents’ opinions

One way of doing so is calculating the Manhattan distance using the vectors of two agents interacting with each other:

\[D_{ij} = \frac{1}{2}\sum^{2}_{k=1} |x_{jk} - x_{ik}|\]

For this situation, a pair of agents who agree on everything will have a distance of zero, while a pair who disagree on everything will have a distance of 2. Use this distance to account for negative and positive influence. Similar agentes will have a strong positive influence in each other, while agents that are more different than similar will exert negative influence. For that, use an influence weight determining the direction and strength of the influence as follows:

\[w_{ij} = 1 - D_{ij}\]

The value of \(w_{ij}\) will vary from \([-1, 1]\), with positive values indicating positive influence, and negative values otherwise.

Warning

Notice that the agents need to have a vector opinions as an attribute from now on!

To loop over vectors in Netlogo, consider the following code of a report function that receives two agents as inputs:

to-report trait-distance [agent1 agent2]
    let t 0 
    let distance 0
    while [t < num-opinions] [
        set distance distance + abs (item t ([opinions] of agent1) -
                                    item t ([opinions] of agent2))
        set t t + 1
    ]
    report (total / num-opinions)
end

After calculating the influence weight between two agents by subtracting the distance from one, we loop over each of the agent’s opinions and influence them accordingly. It is important to keep the values between \([-1, 1]\). For doing so, we can use the equations seen in class with small adjustments for a pair of agents \(i\) and \(j\):

\[x_{ik} \leftarrow x_{ik} + \frac{1}{2} w_{ij}(x_{jk} - x_{ik})(1 - |x_ik|)\]

\[x_{jk} \leftarrow x_{jk} + \frac{1}{2} w_{ij}(x_{ik} - x_{jk})(1 - |x_jk|)\]

Changing values in vectors

To change a value in a vector in Netlogo use the command replace-item. Here is one example of how to use it:

set opinions (replace-item t opinions x2-new)

This code changes the tth position of the vector opinions to a new value x2-new.

Perform batch runs to answer the key modeling questions, and plot the results. Write your discussion in the Info tab.

Important

Send me an email if you have any questions of if any of the instructions are not clear enough for you to complete the assignment!

Submission

Submit your Netlogo code on Moodle until Friday, December 13. Document well your code and report the answers for all the steps in the Info tab.

Note that I didn’t give you information about how many times to run or how to implement some of the specifics of the model. Feel free to come up with your solution where the assignment is not clear.

Grading Rubric

This project will be graded the following way: 100pts total

The criteria to get a good grade will be based on:

  • 40pts: Model is correct
  • 20pts: Code quality and documentation
  • 10pts: Experimental design rigor (batch run designs)
  • 10pts: Data visualization (graphs and outputs given by the batch runs)
  • 10pts: Analytical depth (interpretation of your own results)

Reasons for losing points:

  • -100pts: Model doesn’t run
  • -20pts: Model doesn’t have all features requested in the assignment
  • -100pts: Model is exactly the same as other people’s models