Git Product home page Git Product logo

opiniondynamics's Introduction

Fundamentals

Opinion dynamics aim to simulate and analyse the spread of opinions on adaptive networks. Each node in the network represents a user, and each user is connected through edges to neighbours with whom the user can interact. This specific version of an opinion dynamics model is based on Deffuant and Weisbruch's [Deffuant 2000] selective exposure model: users do not interact with the entirety of the opinion space, but only with users whose opinions fall within the user's tolerance range.

In this model, we select a single random user in each time step, and perform an opinion update, that is, we let the user interact with one of her neighbours. The neighbour is chosen according to the weight distribution of each edge, which are normalised to represent an interaction probability. An edge weight of 0.5 thus represents a 50% chance of that neighbour being selected for interaction in a time step. The user network is a directed network, meaning in- and out-edges have different weights.

In addition to the user network, we have implemented a media network (see eg. [Quattrociocchi 2014]) to simulate the interaction of people with influencers (politicians, media companies, celebrities, etc.) - users or entities, whose sole purpose is to attract as many followers as possible, and who will adjust their opinion to maximise their user count.

Implementation

Users

Each user ui is given a set of five parameters: opinion σi, tolerance εi, susceptibility μi, age a, and (if the media network is turned on) the used medium.

User opinion

The opinion lives in the opinion space, which in this model is the unit interval [0, 1] as a subset of R. The opinion values are thus real numbers (doubles). The initial opinion distribution can be intialised as a constant, uniformly distributed, Gauss-distributed, or age-distributed (cf. the distribution_type key below). They are updated according to the selective exposure law

    (1)

if

.

User tolerance

The user tolerance is a double value in [0, 1]. It decreases when users radicalise (ie. move away from the "moderate opinion" 0.5) and increases when they deradicalise. The radicalisation law is

    (2),

    (3).

The radicalisation parameter k determines the strength of the effect, and must be a value in [0, 4]. Setting k=0 turns off the tolerance change effect entirely. Note that this function skews the tolerance distribution towards low values - this is an implementation error that is yet to be corrected.

User susceptibility

A user's susceptibility parameter can be set as a function of her age a(t):

    (4),

where a, b, and c are parameters that specify the shape of the curve. In the configuration file, these parameters are transformed into more user-friendly variables (age of peak susceptibility, susceptibility at peak, susceptibility at age 0). This gives users complete control over the susceptibility distribution function.

User ageing

A user's age is initialised at random. If ageing is turned on, every year (the length of year having been set in the config-file) a fraction of the senior members of the population are reinitialised as young users of age 1. They are rewired to a parent node, as well as to several peers (peer, children, and senior ages can be set in the config). The child-parent edge is given weight 0.5, the out edges to the peers are given weight 1/(out degree -1). The child's tolerance is set to the parent's tolerance, and the child's opinion value is set a mixture of the parent opinion and the average opinion of the child's peers.

Weights

After each opinion revision, the user can cut links to a neighbour whose opinion is furthest from her own. A new neighbour is chosen at random, and the weights set to 1/(number of users added). Additionally, weights are adjusted in each time step to reflect two things: distance in opinion space, and the age difference. Weights are adjusted according to

    (5),

where the weighting parameter determines the strength of the selective exposure and Δa is the age difference between the two users in question. Users thus prefer neighbours whose age and opinion is close to their own.

Media network

The media network is an undirected network between competing media nodes. Each medium also holds an opinion, has a tolerance radius, is susceptible to opinion change, and knows how many followers (voters, readers, ...) it currently has. Additionally, a medium has a persuasiveness ρ, which describes how convincing a medium is to its user base, and an advertisement budget ads, which describes how much money a medium can spend on outreach to attract new followers. The persuasiveness determines the strength of the media-user network coupling. A user interacts with a medium via the interaction law

    (6),

where the index j represents the medium properties. In each media update, a single medium compares its own user count to that of its neighbours, and shifts its own stance to that of the most popular competitor, but only if the opinion distance is smaller than the tolerance, and larger than third of the medium's tolerance. If the opinion distance is less than a third of the tolerance, the medium moves away from the competitor. The size of a medium's user base directly leads to ad revenue. The higher a medium's advertisement budget, the more users are exposed to that medium's opinion. In each time step, a random user is assigned a particular medium based on that medium's ad value, and performs an opinion update if the medium's opinion is within her tolerance range.

How to run the model

  1. model: Choose the network type. For the directed user network nw_u, available models are ErdosRenyi (random), BollobasRiordan (scale-free directed), or WattsStrogatz (small-world). For the undirected media network nw_m, the scale-free option requires the BarabasiAlbert key.
  2. num_vertices: Select number of users or media.
  3. mean_degree: Mean number of out-edges of a single node.
  4. opinion, tolerance, susceptibility, persuasiveness. This sets the initial distributions of the various vertex properties for users and media:
  • distribution_type: Choose from constant, uniform, gaussian, or age-dependent (only for user susceptibility).
  • const_val: If the distribution type is constant, set the constant value here.
  • uniform_int: If the distribution type is uniform, specify the interval over which the parameter is to be set to a uniform value.
  • mean/stddev: If the distribution type is Gaussian, specify the mean and standard deviation.

For user susceptibility, a custom susceptibility function can be defined via the custom key:

  • peak: Specify the age of peak susceptibility (must be greater or equal to 0!).
  • val_at_peak: Specify the susceptibility at the peak (must in [0, 1]).
  • val_at_0: Specify the susceptibility at age 0 (must be in [0, 1]).
  1. radicalisation_parameter: Determines the strength of the radicalisation effect (see equation 3). Set it to 0 to turn off all radicalisation effects. Cannot be larger than 4, or else the tolerance can become greater than 1.
  2. media_status: Turn the media network either to on or off.
  3. life_cycle: Determines how many numerical steps are equal to a single year. If the user_ageing key is turned off, this key has no effect.
  4. replacement_rate: Determines how many users are reinitialised as children each year; 2-3% are realistic values.
  5. age_groups: Set the various age groups for children, parents, and seniors. 10.media_time_constant: If the media network is turned on, it can run on a slower timescale than the user network, ie. media will update their opinions less frequently than the public. Setting this key to a value of 2, for instance, lets the media network update itself every second time step. Must be an integer larger than 0.
  6. init_ads: The initial ad value interval.
  7. weighting: The weighting parameter from equation (5).
  8. rewiring: The probability that a user will rewire ties to neighbours furthest away in opinion space.

Output

The model outputs several user data plots and one media data plot (if the media network is turned on):

1. User parameters plot:

user_param_plot

This plot shows user opinion, tolerance, age group distribution, and susceptibility for five timeframes. The column on the right displays the model configuration values, as well as the susceptibility distribution function (if distribution_type = age-dependent is selected.)

2. Animated user opinion evolution:

op_plot

This animation shows the opinion distribution over time.

3. Animated opinion distribution by age groups:

age_groups

This animated stacked bar plot shows the opinion distribution for various age groups (the age groups to be plotted can be specified in the plot_cfg.yml file) Finally, when the media network is being used, the model outputs a third plot:

4. Average opinion of age groups:

age_grp_avg

For each age group (can be specified in the plot configuration) the average opinion is plotted over time.

5. Opinion clusters

op_cluster

This plot outputs the opinion clusters over time: for each time step, the graph plots the opinion values divided by the maximum value in that time step.

6. Media plot

media

The scatterplots show the initial media distribution (user numbers over opinion value), the middle plot displays the media evolution.

Future projects

  • Update users individually and throughout the year, rather than in batches
  • Model user properties (especially age-dependent ones) more closely on real sociological/psychological empirical findings
  • Generalise the concept of "radicalisation" to refer to average user behaviour rather than absolute position on opinion spectrum
  • Long-term plan: opinion dynamics on different opinion space topologies!

References

  • Deffuant G. et al: Mixing beliefs among interacting agents. Adv Complex Syst. (2000) 3:87-98. DOI: 10.1142/S0219525900000078
  • Quattrociocchi W. et al: Opinion dynamics on interacting networks: media competition and social influence. Sci. Rep. (2014) 4, 4938. DOI: 10.1038/srep04938

opiniondynamics's People

Contributors

thgaskin avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.