Documentation for the project “Group dynamics”

The dynamics of online human activity behind the evolution of online groups that individuals follow prior to developing high levels of extremist outbreak is a hot topic and crucial for improving the social security. Here is the documentation for the codes used for the analyses.

Table of Contents

  1. Installation
  2. Preprocessing the datasets (optional)
  3. Observations
  4. Evolutionary profiles for the sizes of a single group
  5. Simulation results for the PA model
  6. Simulation results for the AA model
  7. Analytical expression for the group size evolution of the AA model
  8. Group-size distributions
  9. Numerical results for the analytical expression of the group-size distributions

1. Installation

Download the source code folder “projects/Group-dynamics”, and using bash command “cd” to go into the folder.

Run in the “Group-dynamics” folder this bash command to download the required python packages:

pip install -r requirements.txt

Run in the “Group-dynamics” folder this bash command to download the datasets:

python download_datasets.py

2. Preprocessing the datasets (optional)

This is optional, since when running python download_datasets.py, the preprocessed data will also be downloaded.

“datafix.py” includes a function for fixing the abnormal (e.g., due to the abnormal shutdown of the server for collecting data) data points in a time-series.

“getGroupSizeVsT.py” is for generating the fixed (by calling the function defined in “datafix.py”) size evolutionary data for each group, and plotting them (in the folder “figs/GSvsTAll/”). Only shark-fin groups whose birth date is within the period of observation (can be distinguished one-by-one by eyes by looking at the figures for their group-size evolution) will be used for this study.

“getcumJoinsAndLeavesByGroup.py” is for generating the cumulative number of group joining and leaving events for each group.

“getNJoins.py” is for generating the number of group joining events vs. time.

“getNLeaves.py” is for generating the number of group leaving events vs. time.

“getNUsersNGroups.py” is for generating the number of users and groups vs. time.

3. Observations

Running “empirical-PA-sim.py” you will get the following figure in the sub-folder “figs/figs_emPA/”:

GSizes-vs-t-em

Running “join-del-vs-s.py” you will get the following figure in the sub-folder “figs/figs_emPA/”:

JL-rate-vs-s-all-em

4. Evolutionary profiles for the sizes of a single group

Running “groupSizeFitting-loc-trueN.py” you will get the following figure in the sub-folder “figs/GSvsTFit/”:

combined-multi-loc-trueN1.png

5. Simulation results for the PA model

Running “simulation-JL-theory-vs-observation-precise.py” with the parameter “model” set to “PA” you will get the following figures in the sub-folder “figs/simJL/”:

 

6. Simulation results for the AA model

Running “simulation-JL-theory-vs-observation-precise.py” with the parameter “model” set to “PA” you will get the following figures in the sub-folder “figs/simJL/”:

 

7. Analytical expression for the group size evolution of the AA model

Running “analytic-compare.py” you will get the following figures in the folder “figs/”:

 

8. Group-size distributions

Running “size-pdf-sim-compare.py” you will get the following figure in the sub-folder “figs/simJL/”:

Size-PDF-compare.png

9. Numerical results for the analytical expression of the group-size distributions

Running “size-pdf-sim-vs-theory-plot.py” after setting the parameter “model” to either “PA” or “AA”, you will get the following figures in the sub-folder “figs/simJL_theory/”:

 

Feedback: comment below or send me an email.

Publication: (preparing)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s