EXPERIMENTS IN SOCIAL INFLUENCE

In [1]:
from IPython.display import Image
%matplotlib inline
/usr/lib/sagemath/local/lib/python2.7/site-packages/setuptools-12.4-py2.7.egg/pkg_resources/__init__.py:1224: UserWarning: /home/mab/.sage//.python-eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).
In [2]:
%load_ext sage
In [3]:
from influence import influence_sim,infdif_sim,polinfluence_sim,cl_influence_sim
In [4]:
# Connected Erdos-Renyi random graph

nodes = 25
p = 0.2
iterations = 500
In [5]:
# Experiment B1: INFLUENCE 

# Susceptibility of all nodes (low)
sa = 0.1
influence_sim(nodes,p,sa,iterations)
In [6]:
# Experiment B2: INFLUENCE 

# Susceptibility of all nodes (high)
sa = 0.9
influence_sim(nodes,p,sa,iterations)
In [7]:
# Experiment B3: INFLUENCE 
# DIFFUSION BY INFLUENCE with heterogeneous susceptibilities

# Susceptibility of node 0 (the lowest)
sa = 0.
# Susceptibility of all other nodes (very low)
sb = 0.1
infdif_sim(nodes,p,sa,sb,iterations)
In [8]:
# Experiment B4: INFLUENCE 
# DIFFUSION BY INFLUENCE with heterogeneous susceptibilities

# Susceptibility of node 0 (low)
sa = 0.2
# Susceptibility of all other nodes (medium)
sb = 0.5
infdif_sim(nodes,p,sa,sb,iterations)
In [9]:
# Experiment B5: INFLUENCE 
# DIFFUSION BY INFLUENCE with heterogeneous susceptibilities

# Susceptibility of node 0 (medium)
sa = 0.4
# Susceptibility of all other nodes (low)
sb = 0.2
infdif_sim(nodes,p,sa,sb,iterations)
In [10]:
# Experiment B6: INFLUENCE 
# DIFFUSION BY INFLUENCE with heterogeneous susceptibilities

# Susceptibility of node 0 (high)
sa = 0.8
# Susceptibility of all other nodes (higher)
sb = 0.9
infdif_sim(nodes,p,sa,sb,iterations)
In [11]:
# Experiment B7: INFLUENCE 
# DIFFUSION BY INFLUENCE with heterogeneous susceptibilities

# Susceptibility of node 0 (high)
sa = 0.8
# Susceptibility of all other nodes (less high)
sb = 0.7
infdif_sim(nodes,p,sa,sb,iterations)
In [12]:
# Experiment B8: INFLUENCE 
# CONTRARIAN INFLUENCE 

# Susceptibility of all nodes (low)
sa = 0.1
polinfluence_sim(nodes,p,sa,iterations)
In [13]:
# Experiment B9: INFLUENCE 
# CONTRARIAN INFLUENCE 

# Susceptibility of all nodes (medium)
sa = 0.5
polinfluence_sim(nodes,p,sa,iterations)
In [14]:
# Experiment B10: INFLUENCE 
# CONTRARIAN INFLUENCE 

# Susceptibility of all nodes (high)
sa = 0.9
polinfluence_sim(nodes,p,sa,iterations)
In [15]:
# Experiment B11: INFLUENCE 
# SEGREGATED INFLUENCE: The interval of attributes [0,1] is divided in three zones:
# [0,1/3), the "left",
# [1/3, 2/3), the "center",
# [2/3,1], the "right".
# * Persons in either one of the three zones interact as in Experiment 1 as far as their neighbors' attributes
# lie in the same zone with them.
# * Otherwize, persons in the "left" interact only with persons in the "center left" [1/3,1/2],
# persons in the "right" interact only with persons in the "center right" [1/2,2/3], while persons in the
# "left" do not interact with persons in the "right."
# The outcome is that persons' attributes are stabilized in a multiplicity of heterogeneous positions in the
# interval of attributes, i.e., complete dissensus emerges.


# Susceptibility of all nodes (high)
sa1 = 0.9 # high susceptibility inside the "left" and the "right"
sa2 = 0.1 # low susceptibility among "left" and "center left" and among "right and center right".
cl_influence_sim(nodes,p,sa1,sa2,iterations)
In [ ]: