<<

MATHEMATICAL STUDY OF HUMAN DYNAMICS WITH MODELING OF COLLECTIVE MOTION AND SOCIAL MEDIA

by

HYE RIN LINDSAY LEE

Submitted in partial fulfillment of the requirements

For the degree of Doctor of Philosophy

Thesis Adviser: Dr. Alethea Barbaro

Department of Mathematics, Applied Mathematics and Statistics

CASE WESTERN RESERVE UNIVERSITY

August, 2020 Mathematical Study of Human Dynamics with Modeling of

Collective Motion and Social Media

Case Western Reserve University

We hereby approve the thesis1 of

HYE RIN LINDSAY LEE

for the degree of

Doctor of Philosophy

Dr. Alethea Barbaro

Committee Chair, Adviser Date Department of Mathematics, Applied Mathematics, and Statistics

Dr. Jenny´ Brynjarsd´ottir

Committee Member Date Department of Mathematics, Applied Mathematics and Statistics

Dr. Roger H. French

Committee Member Date Department of Materials Science and Engineering

Dr. David Gurarie

Committee Member Date Department of Mathematics, Applied Mathematics and Statistics

Dr. Mary Ann Horn

Committee Member Date Department of Mathematics, Applied Mathematics and Statistics

Date of Defense

May 26, 2020

1We certify that written approval has been obtained for any proprietary material contained therein. I dedicate this dissertation to my late grandpa, Dr. ByungHyuk Lee. I thank him for his never ending support and love. Although he is not here to celebrate this big milestone of my life, I know that he has been with me all along on this journey. I am happy. Table of Contents

List of Tables vii

List of Figures xiv

Acknowledgements xxv

Acknowledgements xxv

Abstract xxvii

Abstract xxvii

Chapter 1. Introduction1

Overview1

Mathematical and Statistical Background3

Literature Review8

Chapter 2. Evaluation of the Social Force Model Using Experimental Data 28

Motivation 28

Experiment 29

Modeling 31

Modeling Result 44

Experiment and Simulation Comparison 51

No Noise Model vs. Noise Model 55

Discussion 57

Future Work 61

Chapter 3. Examining the Effects of Parameter Scaling in a Model for

Collective Motion 64

iv Motivation 64

The Proposed Scaling 65

Introduction of the Numerical Experiment 67

Scaling of R and ∆t 69

The Result of the Scaled and Non-Scaled Parameters 71

Implementing the Zone of Repulsion 77

Different Types of Collision 84

Comparison of the Repulsion Cases 94

Discussion 99

Future Work 101

Chapter 4. Predicting Civil Unrest Using Data from the 2015

Baltimore 103

Motivation 103

Data Background 104

Cleaning Data 107

Time Series 111

Looking into 114

Outlier Tweets 118

The Sentiment Analysis 121

Detecting Events Using Nonnegative Matrix Factorization 126

Building the Prediction Tool 145

Discussion 150

Future Work 152

v Chapter 5. Conclusions 155

Appendix A. Social Issue Events Detected by NMF 157

Appendix B. One-Way Analysis of Variance (ANOVA) of the Four Cases 159

Appendix. Complete References 161

vi List of Tables

2.1 Parameters used for simulating crowd models 39

2.2 Top 5 parameter sets are given for all the experimental

conditions. The Wasserstein distance is abbreviated as ‘WD’ in

the table. From top to bottom, the order goes from the best to

worst for each row. 45

2.3 Results from simulations of parameter sets given by Latin

Hypercube Sampling, plotted in 2D parameter space. The

x−axes are the parameter A, and the y−axes are the parameter

y. Here, we plot the Wasserstein distances as a colored

circle at the point in parameter space where it was run. The

blue schemes represent lower Wasserstein distance values,

whereas the red schemes represent higher values. The best

parameter sets are filled with a magenta star, and the next

top four parameter sets are filled with a magenta diamond.

Since parameter space is four-dimensional, consisting of

[ARush, BRush, ANoRush, BNoRush], we look at the Wasserstein Distances projected onto parameter space for the no-rush

agents on the left, and projected onto the rush agents on the

right. 47

2.4 Top 5 parameter sets are given for all the rush and no-rush

conditions. The Wasserstein distance is abbreviated as ‘WD’ in

vii the table. From top to bottom, the order goes from the best to

worst for each row. 59

2.5 Results from simulations of parameter sets given by Latin

Hypercube Sampling, plotted in parameter space. Here, we

plot the Wasserstein distances as a colored circle at the point in

parameter space where it was run. The blue schemes represent

lower Wasserstein distance values, whereas the red schemes

represent higher values. The best parameter sets are filled

with a magenta star, and the next top four parameter sets are

filled with a magenta diamond. Since parameter space is four-

dimensional, consisting of [ARush, BRush, ANoRush, BNoRush], we look at the Wasserstein Distances projected onto parameter

space for the no-rush agents on the left, and projected onto the

rush agents on the right. 60

3.1 The scaled parameters using Equation 1.19. The first column is

the number of particles, the second column is the radius, and

the last column is the time step. 70

3.2 The average difference of the global, local, and fixed local

polarities of the non-scaled parameters cases between the

varying number of particles. For each cell, the first element is

the difference of the global polarities between the two Ns, the

second element is the difference of the local polarities, and the

last element is the difference of the fixed local polarities. 73

viii 3.3 The average difference of the global, local, and fixed local

polarities of the scaled parameters cases between the varying

number of particles. For each cell, the first element is the

difference of the global polarities between the two Ns, the

second element is the difference of the local polarities, and the

last element is the difference of the fixed local polarities. 76

3.4 The scaled parameters using Equation 1.19. The first column is

the number of particles, the second column is the radius for the

zone of orientation, the third column is the radius for the zone

of repulsion, and the last column is the time step. 78

3.5 The average difference of the global, local, and fixed local

polarities of the non-scaled parameters without repulsion cases

between the varying number of particles. For each cell, the

first element is the difference of the global polarities between

the two Ns, the second element is the difference of the local

polarities, and the last element is the difference of the fixed

local polarities. 88

3.6 The average difference of the global, local, and fixed local

polarities of the scaled parameters without repulsion cases

between the varying number of particles. For each cell, the

first element is the difference of the global polarities between

the two Ns, the second element is the difference of the local

polarities, and the last element is the difference of the fixed

local polarities. 90

ix 3.7 The average difference of the global, local, and fixed local

polarities of the non-scaled parameters with repulsion cases

between the varying number of particles. For each cell, the

first element is the difference of the global polarities between

the two Ns, the second element is the difference of the local

polarities, and the last element is the difference of the fixed

local polarities. 92

3.8 The average difference of the global, local, and fixed local

polarities of the scaled parameters with repulsion cases

between the varying number of particles. For each cell, the

first element is the difference of the global polarities between

the two Ns, the second element is the difference of the local

polarities, and the last element is the difference of the fixed

local polarities. 94

3.9 We list the summary statistics for each case. In each cell, we list

the number of data, N, mean, and standard deviation (std) of

the absolute average differences of global (GP), local (LP), and

fixed local (FLP) polarities, respectively. NSNR stands for the

non-scaled parameter set with no repulsion, and SNR stands

for the scaled parameter set with no repulsion. Similarly, NSR

stands for the non-scaled parameter set with repulsion, and SR

stands for the scaled parameter set with repulsion. 95

3.10 We list the test statistic (W) and p-values from the Shapiro-

Wilk’s test between the cases using the raw (first two columns)

x and log transformed (last two columns) data. In each cell, we

list the mentioned values of the absolute average differences

of global, local, and fixed local polarities, respectively. NSNR

stands for the non-scaled parameter set with no repulsion, and

SNR stands for the scaled parameter set with no repulsion.

Similarly, NSR stands for the non-scaled parameter set with

repulsion, and SR stands for the scaled parameter set with

repulsion. 96

3.11 We list the statistic (F), degrees of freedom (df), p-values, and

95% confidence interval (CI) from the F-test between the two

cases. In each cell, we list the said values of the absolute

average differences of global, local, and fixed local polarities,

respectively. NSNR stands for the non-scaled parameter set

with no repulsion, and SNR stands for the scaled parameter

set with no repulsion. Similarly, NSR stands for the non-scaled

parameter set with repulsion, and SR stands for the scaled

parameter set with repulsion. 97

3.12 We list the statistic (t), degrees of freedom (df), p-values, and

95% confidence interval (CI) from the t-test between the two

cases. In each cell, we list the said values of the absolute

average differences of global, local, and fixed local polarities,

respectively. NSNR stands for the non-scaled parameter set

with no repulsion, and SNR stands for the scaled parameter

set with no repulsion. Similarly, NSR stands for the non-scaled

xi parameter set with repulsion, and SR stands for the scaled

parameter set with repulsion. 99

4.1 The first column of the table is the top 10 most used hashtags

from the entire data, and the second column represents how

frequent the hashtags appeared in the Tweets. 117

4.2 The first column of the table is the top 10 hashtags from the

3-day data, and the second column represents how frequent

the hashtags appeared in the Tweets. 118

4.3 The first column of the table is the top 10 hashtags from 8 to

11 PM of April 27th, and the second column represents how

frequent the hashtags appeared in the Tweets. 120

4.4 We provide examples of the possible Tweets (first column) and

their sentiment scores (second column) given by NLTK. 123

4.5 We calculate the proportions of understandable topics from

the topics given by NMF. The first column lists the number of

topics declared in NMF. The second column lists the number

of understandable topics, and the third column calculates the

proportions of the understandable topics within all topics. 131

4.6 6 out of 300 topics are listed. The left column lists the topic

number, the center column lists the 5 most relevant words, and

the right column lists the topic. We exclude any topics that

contain illegal substances, explicit words, or curse words. 133

4.7 Fivr interesting topics found by the NMF with the 300 topics. 135

xii 4.8 We list the same topics from Table 4.7 that were also found

from 200 topics. 139

4.9 We calculate the proportions of understandable topics from

the topics given by NMF. The first column lists the number of

topics declared in NMF. The second column lists the number

of understandable topics, and the third column calculates the

proportions of the understandable topics within all topics. 141

4.10 The selected topics on the . 143

4.11 We list the ten relevant words from the topics of NMF. From

left to right column, these relevant words are from the outlier

hours 2 am, 2 pm, and 11 pm of April 26th. 149

A.1 The two social issues found by NMF using hashtags. 157

B.1 We list the degrees of freedom (df), sum of squares, mean

squares, statistic (F), and p-values from one-way ANOVA

between all cases. We list the said values of the log absolute

average differences of global, local, and fixed local polarities,

respectively. 159

xiii List of Figures

1.1 The three zones of interaction of kth particle that is located at

the center of the zones. The radii of the zones are given by rr,

ro, and ra, for the zone of repulsion (Rk), zone of orientation

(Ok), and zone of attraction (Ak), respectively. 21

2.1 The floor plan of assembly area, or arena, is shown as a 4 m by

4 m gray square where the participants assembled prior to the

start of experiments. 30

2.2 The experimental data and adjusted mutual conditions:

(Top row) the image of experiment initial positions of the

participants. (Bottom row) right: the raw initial positions data

of the 100(0) condition, and left: the fixed initial positions data

of the 100(0) condition. 36

2.3 The initial positions from the experimental data are in the

small open black circle, and the adjusted initial positions of the

agents are the blue asterisk. The big red circles surrounding

the small black circles represent the maximum shoulder length

of the agents. From left to right, (Top Row) 0(100) and 25(75),

(Middle Row) 50(50) and 75(25), and (Bottom Row) 100(0). The

blue lines indicate the experiment arena dimension. 37

2.4 The average speeds across the rush (red) and no-rush (blue)

conditions for the experiment (in dark colors) and the

xiv simulation (in light colors) with parameters from the Helbing’s

2000 paper. 38

2.5 A simple 3 by 3 Latin Square. 40

2.6 The plot of the 600 values sampled from Latin Hypercube

sampling. The y-axis is the characteristic length scale of

interaction range, B, and the x-axis is the interaction strength,

A. 42

2.7 The cumulative distribution functions of the exit speed for

the 50(50) condition. In both figures, the blue represents

no-rush conditions, and the red represents rush conditions.

The experimental CDF are shown as dark solid lines. The CDFs

for one run using the parameter values giving the minimum

Wasserstein distance is shown in light dashed lines (left), and

the CDFs for a simulation performed using the parameters

producing the maximum Wasserstein distance is in light

dashed lines (right). 44

2.8 The exit speed of experiment (darker lines) and simulation

(lighter lines). The red lines represent rush, and the blue lines

represent no-rush. The dashed lines with ‘x’ markers are the

exit speed of simulation with fixed A/B rush and no-rush

across the all conditions. 48

2.9 Top five fits for A (left) and B (right) parameters for all the

conditions from the simulation. Blue shows the no-rush

xv parameters (ANR in the plot on the left and BNR in the plot on

the right) while red shows the rush parameters (AR in the plot

on the left and BR in the plot on the right). The solid lines show the values for the best fitted parameters, while the dotted lines

show the top four runners up. 49

2.10 (Top Left) The values of parameter A that are within a

Wasserstein distance tolerance of 0.28 for all rush conditions

from the simulation. The best A is in a dark solid red circle,

and the rest are in light red squares. (Top Right) The values of

parameter B that are within a Wasserstein distance tolerance of

0.28 for all rush conditions from the simulation. The best B is

plotted as a dark solid red circle. (Bottom Left) The values of

parameter A that are within a Wasserstein distance tolerance

of 0.28 for all no-rush conditions from the simulation. The best

value of A is shown as a dark solid blue circle, and the rest

are in light blue squares and the rest are in light red squares.

(Bottom Right) The values of parameter B that are within a

Wasserstein distance tolerance of 0.28 for all no-rush conditions

from the simulation. The best B is shown as a dark solid blue

circle, and the rest are in light blue squares. 50

2.11 The instantaneous speeds (m/s) for both experiment (top) and

simulation (bottom). The rush agents’ instantaneous speeds

are in red, and the no-rush agents’ instantaneous speeds are in

blue. The average instantaneous speed is in bold, and the all

xvi the instantaneous speeds are in lighter lines. For the simulation

plots, The desired speeds for rush (red) and no-rush (blue) are

plotted as dashed lines. 52

2.12 The time to exit of 18 individuals is plotted in seconds. The

left plot is for the experiment, and the right plot is for the

simulation. 53

2.13 The raw trajectories of the agents are plotted. The top plots are

for the experiment, and the bottom plots are for the simulation.

The red lines are the rush agents, and the blue lines are for the

no-rush agents. 54

2.14 The exit speed of experiment (darker lines) and simulation

using the no-noise model (lighter lines). The red lines represent

rush, and the blue lines represent no-rush. 56

2.15 Top five fits for A (left) and B (right) parameters for all the

conditions from the no-noise model simulation. Blue shows

the no-rush parameters (ANR in the plot on the left and BNR in

the plot on the right) while red shows the rush parameters (AR

in the plot on the left and BR in the plot on the right). The solid lines show the values for the best fitted parameters, while the

dotted lines show the top four runners up. 57

2.16 (Top Left) The values of parameter A that are within a

Wasserstein distance tolerance of 0.28 for all rush conditions

from the no-noise model simulation. The best A is in a dark

xvii solid red circle, and the rest are in light red squares. (Top

Right) The values of parameter B that are within a Wasserstein

distance tolerance of 0.28 for all rush conditions from the

no-noise model simulation. The best B is plotted as a dark solid

red circle. (Bottom Left) The values of parameter A that are

within a Wasserstein distance tolerance of 0.28 for all no-rush

conditions from the no-noise model simulation. The best value

of A is shown as a dark solid blue circle, and the rest are in

light blue squares and the rest are in light red squares. (Bottom

Right) The values of parameter B that are within a Wasserstein

distance tolerance of 0.28 for all no-rush conditions from the

no-noise model simulation. The best B is shown as a dark solid

blue circle, and the rest are in light blue squares. 58

2.17 (Left) The Cube located in Virginia Tech. (Right) The rigid-body

tracking system and markers. 62

3.1 The progression of the collision is demonstrated at various

time steps including the start (top left) and the finish (bottom

right) of the simulation. From top to bottom, left to right,

the time steps shown are t = 0, 5, 7, 9, 11, 20. The number of

particles are 8,000. 68

3.2 We plot the various results of the Vicsek model’s numerical

experiment using the non-scaled parameters. (Top Row) The

global polarity is plotted on the left against the time, t, for all

xviii N. The local polarity is plotted on the right against the time, t,

for all N. (Middle Row) The fixed local polarity is plotted on

the left against the time, t, for all N. The average neighbors is

plotted on the right against the number of particles, N. (Bottom

Row) The width of school is plotted against the number of

particles, N. The unit of the number of particles, N, is in

thousands. 72

3.3 We plot the various results of the Vicsek model’s numerical

experiment using the scaled parameters. (Top Row) The global

polarity is plotted on the left against the time, t, for all N. The

local polarity is plotted on the right against the time, t, for all

N. (Middle Row) The fixed local polarity is plotted on the left

against the time, t, for all N. The average neighbors is plotted

on the right against the number of particles, N. (Bottom Row)

The width of school is plotted against the number of particles,

N. The unit of the number of particles, N, is in thousands. 74

3.4 The progression of the two school collision is demonstrated

at various time steps of the simulation for N = 32000.

From top to bottom, left to right, the time steps shown are

t = 2, 4, 5, 8, 14, and 20. 79

3.5 We plot the various results of the Vicsek model’s numerical

experiment using the scaled parameters with repulsion. (Top

Row) The global polarity is plotted on the left against the

time, t, for all N. The local polarity is plotted on the right

xix against the time, t, for all N. (Middle Row) The fixed local

polarity is plotted on the left against the time, t, for all N. The

average neighbors is plotted on the right against the number

of particles, N. The unit of the number of particles, N, is in

thousands. 80

3.6 The progression of the two school collision is demonstrated at

t = 0, 5, 8, 20 using the values of the reference parameter set,

RO = 0.125, Rr = 0.0125, and ∆t = 0.0025. 81

3.7 The progression of the two school collision is demonstrated at

t = 0, 2, 3, 4, 9, 20 using the new parameter values of RO = 0.5,

Rr = 0.05, and ∆t = 0.01. 82

3.8 We plot the various results of the Vicsek model’s numerical

experiment using the non-scaled parameters with repulsion.

(Top Row) The global polarity is plotted on the left against

the time, t, for all N. The local polarity is plotted on the right

against the time, t, for all N. (Middle Row) The fixed local

polarity is plotted on the left against the time, t, for all N. The

average neighbors is plotted on the right against the number

of particles, N. The unit of the number of particles, N, is in

thousands. 83

3.9 The set up of collision for N = 4000 is on the left most upper

corner. From left to right and top to bottom, the progression

of simulation is plotted at t = 0, 0.1, 0.4, 0.6, 1, 20. After t = 1,

xx the system stabilizes and looks like when t = 20 by the time

t = 1.5. 85

3.10 We plot the various results of the Vicsek model’s numerical

experiment using the non-scaled parameters without repulsion.

(Top Row) The global polarity is plotted on the left against

the time, t, for all N. The local polarity is plotted on the right

against the time, t, for all N. (Middle Row) The fixed local

polarity is plotted on the left against the time, t, for all N. The

average neighbors is plotted on the right against the number

of particles, N. The unit of the number of particles, N, is in

thousands. 87

3.11 We plot the various results of the Vicsek model’s numerical

experiment using the scaled parameters without repulsion.

(Top Row) The global polarity is plotted on the left against

the time, t, for all N. The local polarity is plotted on the right

against the time, t, for all N. (Middle Row) The fixed local

polarity is plotted on the left against the time, t, for all N. The

average neighbors is plotted on the right against the number

of particles, N. The unit of the number of particles, N, is in

thousands. 89

3.12 We plot the various results of the Vicsek model’s numerical

experiment using the non-scaled parameters with repulsion.

(Top Row) The global polarity is plotted on the left against

the time, t, for all N. The local polarity is plotted on the right

xxi against the time, t, for all N. (Middle Row) The fixed local

polarity is plotted on the left against the time, t, for all N. The

average neighbors is plotted on the right against the number

of particles, N. The unit of the number of particles, N, is in

thousands. 91

3.13 We plot the various results of the Vicsek model’s numerical

experiment using the scaled parameters with repulsion. (Top

Row) The global polarity is plotted on the left against the

time, t, for all N. The local polarity is plotted on the right

against the time, t, for all N. (Middle Row) The fixed local

polarity is plotted on the left against the time, t, for all N. The

average neighbors is plotted on the right against the number

of particles, N. The unit of the number of particles, N, is in

thousands. 93

4.1 (Left) The time series of entire raw data. (Right) This figure is

the time series of entire cleaned data. 112

4.2 (Left) The number of Tweets of a day is depicted by a boxplot.

Hour 1 is 12 AM, and Hour 24 is 11 PM. (Right) The number of

Tweets per day for a month is depicted by a boxplot. Day 1 is

August 1st, 2015, and Day 31 is August 31st, 2015. 113

4.3 The number of Tweets per hour from April 20th to May 3rd,

2015. The number of Tweets is in small black circles. The 97.5th

xxii quantile is in a red curve, and the 2.5th quantile is in a blue

curve. 119

4.4 The bar graph of outliers for the entire duration of data using

the 97.5th quantile. The graph starts on April 1st, 2015, and

from left to right, the red dashed lines represent the first day

of May, June, July, August, and September. The blue dashed

lines represent the start of and the violent protests,

respectively. The brown dashed lines represent the day of

arrest and death of Freddie Gray, respectively. 122

4.5 (Left) The number of positive (red), neutral (gray), and

negative (blue) scored Tweets in the entire data set. (Right) The

number of positive (red), neutral (gray), and negative (blue)

scored Tweets in the set of outliers using the 97.5th quantiles. 124

4.6 The proportions of positive (red), neutral (gray), and negative

(blue) scored Tweets per hour. Each bar represents one hour,

and the Tweets are from April 1st to April 8th, 2015. 125

4.7 The proportions of positive (red), neutral (gray), and negative

(blue) scored Tweets per hour. Each bar represents one hour,

and the Tweets are from April 26th to May 3rd, 2015. 126

4.8 (Top left) The Tweet frequency plot of topic 41, money. (Top

right) The Tweet frequency plot of topic 5, body parts and

aches. (Bottom Left) The Tweet frequency plot of topic 23,

xxiii prayers. (Bottom Right) The Tweet frequency plot of topic 24,

heartbreaks. 134

4.9 Both methods of NMF with 200 and 300 topics are able to

capture this topic, the holidays. We see the spikes on Easter

(April 5th), Mother’s Day (May 10th), Father’s Day (June 21st),

and Independence Day (July 4th). The relevant words for

this topics are:“happy”, “bday”, “makes”,“easter”, “mothers”.

The word “fathers” was ranked as the 7th relevant word, and

“4th” and “july” ranked as the 8th and 11th relevant words,

respectively. 140

4.10 The flow chart of the civil unrest prediction tool. The process

goes from the left to right. 147

4.11 We identify the outlier hours of the number of Tweets using

the 97.5th quantile from the entire day of April 26th. The 97.5th

quantile is in red curve, and the 2.5th quantile is in the blue

curve. The outlier hours are highlighted as the black circles. 148

xxiv Acknowledgements 0.1 Acknowledgements

I would like to thank my adviser, Dr. Alethea Barbaro, who drove me 1,523 miles

so that I can have the best graduate school experience. No word can describe

how grateful I am to have her as my adviser. I thank her for her endless support,

encouragement, kindness, understanding, guidance, and patience throughout the years. She is the best adviser anyone could ever ask for. I would also like to thank

Dr. Daniel Balague-Guardia,´ who taught me so many different programming lan- guages and HPC. I thank him for all of his guidance and time to help me with this dissertation.

I also thank my committee members, Dr. Jenny´ Brynjarsdottir,´ Dr. Roger H.

French, Dr. David Gurarie, and Dr. Mary Ann Horn, for their time and providing valuable comments. I thank them for being so generous on taking time out of their summer break for me. Especially to Dr. Jenny´ Brynjarsdottir,´ I appreciate her insightful suggestions for the evacuation project and for all my unannounced office visits to ask questions.

My undergraduate research advisers are one of the main reasons that I am here today. I sincerely thank Dr. Charles Lee and Dr. Laura Smith Chowdhury for taking me under their wings when I did not know a single thing about research. I do not know how to repay them for their guidance, patience, continuous support, and simply believing in me. Especially to Dr. Laura Smith Chowdhury, I thank her for buying me lunch every time I go visit and introducing me to Dr. Barbaro.

I am so thankful to be able to work with my collaborators, Dr. Nicole Abaid and Dr. Sachit Butail. Thanks for letting me be a part of such an awesome project.

xxv I appreciate their nice gestures even when I made mistakes and always making me

feel welcomed.

Lastly to my friends and family, I thank them for always being there for me.

They were there to cheer me up at my lowest of the lows, and they were also there for me to celebrate every milestone. I met life long friends 2,326.8 miles away from home, and my friends from home continuously showed me their support even when we are 2,326.8 miles apart. I can not thank them enough for making graduate school bearable. Thanks to my brother, Justin, for always buying me

Boiling Point when we are both home and making me laugh over stupid things.

My parents sacrificed everything for me, and nothing will ever be good enough to express my gratitude towards them. None of this would be possible without their unconditional love, support, and encouragement.

xxvi Abstract

Mathematical Study of Human Dynamics with Modeling of Collective Motion and Social Media

Abstract

by

HYE RIN LINDSAY LEE

0.2 Abstract

We present three projects with the underlying theme of human dynamics. In this work, we especially focus on the collective behavior and communication aspects of human dynamics. First, we mimic a real-life evacuation using the Social Force model. The Social Force model is a seminal model for the collective dynamics of pedestrian crowds, and it has been widely applied. We evaluate the Social Force model by comparing the results with experimental data. We find that changing the model’s interaction parameters is essential when fitting the model to the experi- mental data, indicating that a more nuanced application of the social force model might be necessary in evacuation scenarios. Following the theme of collective be- havior, we next perform numerical experiments to explore the open question of whether it is possible to obtain the same behavior from a particle model as the number of particles changes, by scaling the parameters, as proposed by Barbaro et al. in 2009. We focus on the Vicsek model with and without repulsion. We find that

xxvii scaling does not necessarily preserve the same behavior. Lastly, we examine the

communication aspect of human dynamics through social media. We work with

Twitter data from the 2015 protests to build a tool, using quantiles and

Nonnegative Matrix Factorization, that shows promise for predicting civil unrest

in real-time. In addition to introducing the tool, we provide thorough explanations

of background on the event, the data cleaning process, and the data itself.

xxviii 1

1 Introduction

1.1 Overview

We present three projects with the underlying theme of human dynamics. Human

dynamics is the understanding of dynamic patterns, relationships, changes, and

transitions of human activities, behaviors, and communications [5]. We especially

focus on human collective motion and communications. Collective motion, or col-

lective behavior, is a phenomenon that can be seen within social organisms where

individual action is dominated by the social influence of the others within a group

[133]. Examples of collective motion include, but not limited to, people in a queue,

flocks of birds, schools of fish, and herds of cows or zebra. Throughout this dis-

sertation, we examine social influence, collective behavior, and communications

between people. In the remaining sections of this chapter, we provide the mathe-

matical and statistical background used throughout the chapters, and we discuss

previous research related to the projects. We cover three projects, each with a dif-

ferent perspective on human dynamics in subsequent chapters.

In Chapter2, we focus on the modeling and experiment side of pedestrian

dynamics. We evaluate a model in pedestrian dynamics, called the Social Force Introduction 2 model, by fitting it to real-life experimental evacuation data. Conducting an emer- gency evacuation experiment is tricky and can become unethical; for this reason, it is important to be able to simulate a realistic pedestrian flow model to help further research on emergency evacuations. We mimic the exact experiment environment to the model simulations. As they did in the experiment, we use two types of exiting speeds, rush or no-rush, and 5 different proportions of the exiting speeds for the participants. We find that changing the model’s interaction parameters is essential when fitting the model to the experimental data.

In Chapter3, we switch gears to the more abstract side of collective motion. In the interacting particle model of pelagic fish migration by Barbaro et al., the au- thors successfully modeled the migration route of Icelandic capelin, a pelagic fish, in 2008. However, they used superindividual particles in the simulation, where one particle represents about one million fish. Our goal is to have one particle rep- resenting one fish, if possible, while maintaining the same behavior. We perform numerical experiments to see if it is possible to obtain the same behavior from the

Vicsek model by scaling the parameter sets while changing the number of parti- cles, both with and without repulsion. We find that scaling proposed by Barbaro et al. [23] does not necessarily preserve the same behavior.

We then look into the communication between people using social media in

Chapter4. Twitter is a micro-blog that can be accessed at any time of the day re- gardless of the user’s location. The Tweets, 280-word limit messages, are often used as real-time current events due to Twitter’s incredible accessibility and popu- larity. Anyone can find out what is happening around the world by simply logging Introduction 3 in to Twitter. We use the Tweets from the 2015 Baltimore protests to develop a sta- tistical tool for predicting civil unrest. We give a thorough analysis of the tweets and employ quantiles and Nonnegative Matrix Factorization to design the tool.

We successfully show promise for predicting protests in real-time using this tool.

We provide discussions and future work for each chapter. Finally, we close with the overall discussion.

1.2 Mathematical and Statistical Background

In this section, we provide the adequate background materials that are used through- out this dissertation. We use the Wasserstein 2-distance as a metric for performance comparison between two subjects in Chapter2. Imagine two distinct sand piles in different places, say sand pile A and B. The Wasserstein 2-distance measures how much energy we would need to reshape and move sand pile A to B. We now just used sand piles to portray distributions. The Wasserstein 2-distance defines a dis- tance between histograms and probability measures. Although the Wasserstein 2- distance is hard to compute in higher dimensions, it is straightforward to calculate in one-dimension [107]. Lower the Wasserstein 2-distance, the better fit between the two distributions. The range of Wasserstein 2-distance is [0 ∞).

Definition 1.2.1 (Wasserstein 2-Distance). For a measure α on R, its cumulative

distribution function (CDF) from R → [0, 1] is defined for all x ∈ R as

Z x Cα(x) = dα. −∞ Introduction 4

−1 Its pseudo-inverse is then defined to be Cα : [0, 1] → R ∪ {−∞} such that, for all r ∈ [0, 1],

−1 C (r) = min{x ∈ R ∪ {−∞} : Cα(x) ≥ r}. α x

The following equivalence then holds for the Wasserstein 2-distance:

Z 1 2 2 k −1 − −1k2 −1 − −1 W2(α, β) = Cα Cβ L2([0,1]) = Cα (r) Cβ (r) dr. 0

We will refer to the Wasserstein 2-distance as simply the Wasserstein distance

for the rest of the dissertation.

In Chapter3, we run into a problem where the point estimation is needed. We

use linear interpolation to do so.

Definition 1.2.2 (Linear Interpolation). Let x be a point such at xi < x < xi+1, which implies that the data points of x are in an ascending order. Let y be the

estimated, or interpolated, value. Then, linear interpolation at some x is given by

yi+1 − yi y(x) = yi + (x − xi) . xi+1 − xi

The following notations and definitions are from [38] and [115].

Definition 1.2.3 (σ-algebra). A collection, B, of subsets of S is called a σ-algebra

(Borel field) if the following hols:

(1) S ∈ B

(2) If A ∈ B, then A0 ∈ B, where A0 is the complement of A ∞ S (3) If A1, A2,... ∈ B, then Ai ∈ B i=1 Introduction 5

Definition 1.2.4 (Probability Function). Let S be a sample space with associated

σ−algebra B. A probability function is a function, P : B −→ R+, with B as domain

that satisfies:

(1) P(A) ≥ 0

(2) P(S) = 1

(3) If A1, A2,... ∈ B are mutually exclusive, then

∞ ∞ [ P( Ai) = ∑ P(Ai) i=1 i=1

Definition 1.2.5 (Random Variable). A random variable, X, is a function with domain S and range in R. It is simply a numerical representation of outcomes S.

Definition 1.2.6 (Cumulative Distributive Function). The cumulative distribu-

tive function (CDF) of a random variable is

FX(x) = PX(X ≤ x) ∀x ∈ R.

Theorem 1.2.1 (Properties of a Cumulative Distributive Function). A function

F(x) is a CDF if and only if the following 3 conditions hold:

(1) lim F(x) = 0 and lim F(x) = 1 x→−∞ x→∞ (2) F(x) is a nondecreasing function of x

(3) F(x) is right continuous: lim F(x) = F(x ) ∀x ∈ R + 0 x→x0 Definition 1.2.7 (Probability Density Function). A probability density function,

fX(x), (PDF) of a continuous random variable, X, is function that satisfies

Z x F(x) = f (u)du. −∞ Introduction 6

Theorem 1.2.2 (Properties of Probability Density Function). A function f (x) is a probability density function of a random variable, X, if and only if

(1) f (x) ≥ 0 ∀x R ∞ (2) −∞ f (x)dx = 1

Definition 1.2.8 (Uniform Distribution). The uniform distribution is a proba- bility distribution of a continuous random variable, x, with parameters a < b. The probability density function is given by

  1  b−a if x ∈ [a, b] f (x) =  0 otherwise.

Definition 1.2.9 (Normal Distribution). The normal distribution, or the Gauss- ian distribution, is a probability distribution of a continuous random variable, x, with the mean µ and variance σ2. The probability density function is defined as

(x−µ)2 1 − 2 f (x) = √ e 2σ2 , x, µ ∈ R, σ > 0. 2πσ

We denote the normal distribution as N(µ, σ2).

Definition 1.2.10 (Shapiro-Wilk’s Test). The Shapiro-Wilk’s test is used to test

for the normality in a data set. The test statistic, W, is calculated by

2  n  ∑i=1 aix(i) W = n 2 , ∑i=1(xi − x¯ ) where xi are the ordered random samples, x¯ is the sample size mean, and x(i) is the

ith order statistic; ai are constants generated from the variances, covariances, and means of the sample size of n from the standard normal distribution. Introduction 7

Note that the first order statistic is the minimum of the sample, and the nth

(last) order statistic is the maximum of the sample. The null-hypothesis of Shapiro-

Wilk’s test is that the population is normally distributed.

Definition 1.2.11 (Student t-Test). The student t-test is used to compare the means of two independent normally distributed groups A and B that have the same variance. The t-value is calculated by

mA − mB t = q , S2 + S2 nA nB

2 where mi is the mean value of the group i, ni is the size of the group i; S is an estimator of the pooled variance of the two groups and it calculated by

∑(x − m )2 + ∑(x − m )2 S2 = A B , d f where , d f , the degrees of freedom, is d f = nA + nB − 2.

The assumptions for Student t-test are that the data are normally distributed, and the two groups are independent and have equal variances. The null-hypothesis of this test is that the two groups’ means are equal.

Definition 1.2.12 (Welch’s t-Test). The Welch’s t-test is used to compare the means of two independent groups A and B that do not have the same variance.

The Welch’s t-test value is calculated by

mA − mB t = r , S2 S2 A + B nA nB Introduction 8

2 where mi is the mean value of the group i, ni is the size of the group i; Si is the standard deviation of the group i. The degrees of freedom is calculated by

 S2 S2 2 A + B nA nB d f = 4 4 SA SB 2 + 2 nA(nA−1) nB(nB−1)

The assumptions for Welch’s t-test are that the data are normally distributed,

and the two groups are independent. The null-hypothesis of this test is that the

two groups’ means are equal.

Definition 1.2.13 (F-Test). The F-test is used to test for homogeneity in vari- ances. The F-test value is calculated by

2 sA F = 2 sB,

2 2 2 where si is the sample variance of the group i and sA > sB.

The assumptions for F-test are that the data are normally distributed. The null- hypothesis of this test is that the two groups’ variances are equal.

Definition 1.2.14 (Quantiles). The quantiles are the cut off points that divide data into groups. For example, the median is the 50th quantile. When we divide a distribution into 100 equal parts, this type of quantile is called percentiles.

1.3 Literature Review

In this section, we review the relevant literature for Chapters2,3, and4. In Subsec- tion 1.3.1, we define the Social Force model [62, 63, 66]. Currently, there are three Introduction 9 different versions of the model. Although we utilize only one version, we still re- view all of the versions as they are insightful and very similar to one another. In

Subsection 1.3.2, we introduce the Vicsek model and the polarities. The polarities measure the alignment of the system given by the Vicsek model. We also review the capelin migration model by Barbaro et al. as we incorporate this model into the

Vicsek model for the numerical experiment [23]. Lastly, in Subsection 1.3.7, we re- view the work of Winterer [138]. Winterer fit Twitter data from the 2015 Baltimore protest to the normal linear model, generalized linear models, and quantiles.

1.3.1 Pedestrian Dynamics

Every year, many people die or get injured by a stampede of people. In the U.S. alone, there were 2 reported deaths and 32 cases of injury from 2006 to 2018 Black

Friday [44]. If we include concerts, sports games, or any event that involves a huge crowd, the toll will increase. Studying pedestrian dynamics is much needed, but using experiments to do so can be unethical. Hence, many pedestrian dynamics models have surfaced. These models are intended to simulate the dynamics of crowd disasters [31, 64, 65, 71, 121], the pedestrian behavior and flow [32, 67, 68,

81, 99, 100, 116, 123, 139], and evacuation [12, 30, 48, 77, 82, 101, 105, 131, 145].

The model that we will be focusing on is a seminal model called the Social

Force model. It has been widely applied in pedestrian dynamics since its first appearance in 1995. Since then, the Social Force model has been widely applied in various studies. In [95], the authors use the Social Force model to detect and localize abnormal crowd behavior through finding a vector field called the force

flow from images of pedestrians and using Latent Dirichlet allocation (LDA) with Introduction 10 force flows. In [90], the Social Force model is implemented to simulate terrorist attacks rather than a typical emergency evacuation. The author divides the group by two, terrorists and pedestrians. The terrorists pick their targets by the nearest pedestrians, while the pedestrians try to avoid and exit the area. The results show that the number of deaths depends on the number of terrorists and the density of pedestrians.

Despite the popularity of this seminal model, many studies have shown that the Social Force model could be improved and suggest a modified or different model. In [80], the authors show that the agents in the Social Force model make unnecessary movements. Instead, they introduce different models that do not use interaction based on the physical distance of the pedestrians. They introduce a model that uses interaction laws in terms of collision avoidance by collision pre- diction where the pedestrians predict possible future collisions with the others and avoid them in [80], and the authors propose a similar model with interaction laws of projected time to a potential collision in the near future in [81]. Another pedes- trian model by Kirchner et al. is inspired by the ideas of chemotaxis. This model de- scribes the interaction between the pedestrians with a bionics approach where the pedestrian creates a trace that corresponds to a path that a pedestrian would like to take [83]. Many modifications of the Social Force model have emerged. These modifications include but not limited to adding more features and parameters to the Social Force model to use more realistic parameter values in [87], leadership effect to the model where only the trained leaders know where the exit is in [74], and a feature that can explicitly predict the time and place collision to avoid it in Introduction 11

[142]. Other modifications implement self-stopping mechanisms of the pedestri-

ans to stop them from continuously pushing themselves over others in [103] and

adjust the desired velocity of the pedestrians in a way that they have a more sen-

sitive response to their surroundings in [140].

The Social Force model [62, 63, 66], a second-order equation, represents the in-

teraction among people through three forces: the goal, interaction, and wall forces.

The goal force, fg ∈ R2, describes the deviation of the actual velocity from the de-

2 2 sired velocity, whereas the interaction, fij ∈ R , and wall forces, fiw ∈ R , describe the interactions between an agent, or person, and the agent’s neighbors or the wall,

respectively. Here, an agent is indexed as i, the agent’s neighbors are indexed as j,

and the wall is indexed as w. Now, the Social Force model is

N dvi g mi = mifi + ∑ fij + ∑ fiw, (1.1) dt i j=1,j6=i w where the goal force is 0 0 g vi ei (t) − vi(t) fi = (1.2) τi and the interaction force is

( (rij−dij) ) B t fij = Aie i + κg(rij − dij) nij + κg(rij − dij)∆vjitij. (1.3)

0 0 Here, mi is the mass of an agent i, vi is the desired speed, ei is goal direction, vi is

the actual velocity, and τi is the adaptation time that determines the time it takes for

an agent to turn in the desired direction [77]; Ai and Bi are constants that determine the interaction strength and the characteristic length scale of the interaction range,

respectively. The size of interaction radius, rij = ri + rj, is the sum of agents radii where the diameters of agents are their shoulder lengths; dij is the relative distance Introduction 12

t between them; nij is a unit vector from j to i; tij is the tangential direction; ∆vji is the tangential velocity difference; κ and K are large constants, and g(x) is the function

that is zero when the pedestrians are not in contact (dij > rij) and otherwise equal to the argument x.

The interaction force, Equation 1.3, consists of three forces: the repulsive force,

the body force, and the sliding force. The repulsive force acts as a personal bubble

for the agents, capturing that humans do not feel comfortable when a stranger is

positioned in close proximity. The body and sliding forces active once the agents

touch each other. The body force counteracts the body compression between the

agents, and the sliding force describes the sliding friction between the agents.

Taken together,

  t fij = Ai exp[(rij − dij)/Bi] + kg(rij − dij) nij + κg(rij − dij)∆vjitij | {z } | {z } | {z } Repulsive force Body force Sliding force

The wall force, fiW, is analogous to the interaction force, Equation 1.3.

(ri−diw) B fiw = {Aie i + kg(ri − diw)}niw − κg(ri − diw)(vi · tiw)tiw, (1.4) where now diw represents the distance between an agent and the wall. We use the version of the Social Force model from [63], but the other two ver- sions of the Social Force model from [66] and [62] are also worthy of note. These three versions of the model are similar yet different. First, we look into the version in [66]. Let w~ α be the preferred velocity of a pedestrian α. The Social Force model is defined as dw~ α = ~F (t) + fluctuations (1.5) dt α Introduction 13

where ~Fα is the social force and represents the effect of the environment on the

behavior of pedestrian α. This social force is defined as

~ ~ 0 0 ~ ~ α ~ Fα(t) = Fα (~vα, vα~eα) + ∑ Fαβ(~eα,~rα −~rβ) + ∑ FαB(~eα,~rα −~rB) + ∑ Fαi(~eα,~rα −~ri, t). β B i Each term represents the force of the goal of pedestrian α, the repulsive effect be-

tween pedestrians β and pedestrian α, the repulsive effect between a boarder B and

pedestrian α, and attraction i for pedestrian α, respectively. Here, ~vα is the actual

0 velocity, vα is the desired speed, and ~eα is the desired direction of pedestrian α;~rα α is the actual position, and~rB is the location of a boarder B that is nearest to pedes- ~ 0 0 trian α. The attractive effect of a place is denoted as~ri. The first term, Fα (~vα, vα~eα), is the goal force, and it is the same as Equation 1.1. The second term describes the repulsive effects of pedestrians β from pedestrian α by

~ −∇ fαβ(~rαβ) = ~rαβ Vαβ[b(~rαβ)], where~rα is the location of pedestrian α,~rαβ = ~rα −~rβ, and b is the semiminor axis of the ellipse. The repulsive potential, or the private sphere, is denoted by Vαβ, where it is a monotonic decreasing function of b with equipotential lines of an el- lipse that is directed into the direction of motion. Normally, a pedestrian would feel increasingly uncomfortable as a stranger gets close. This term lets pedestrian α keep his/her distance from other pedestrians by creating a personal bubble, or the private sphere. The third term is analogous to the second term where the pedes- trians β are replaced by a border B, just like Equation 1.1. The last term describes the attractive effects of places ~ri and is similar to the repulsive effects but with Introduction 14

increasing monotonic potential Wαi(k~rαik, t):

~ k k −∇ k k fαi( ~rαi , t) = ~rαi Wαi( ~rαi , t), where~rαi =~rα −~ri. This term decreases over time t as the attractiveness and inter- est of pedestrian α also decline. One notable difference between the two versions is that this version has directionally-dependent weights,   1 if~e · ~f ≥ k~f k cos φ w(~e, ~f ) =  c otherwise, multiplying the repulsive and attractive effects, resulting in the final form of

~ ~ ~Fαβ(~eα,~rα −~rβ) = w(~eα, − fαβ) fαβ(~rα −~rβ)

~ ~ ~Fαi(~eα,~rα −~ri, t) = w(~eα, fαi) fαi(~rα −~ri, t).

Note that c is an influence ranging 0 < c < 1, and ~eα is the desired direction of motion of pedestrian α. The purpose of these directionally-dependent weights is for the situations where a pedestrian cannot see and have weaker influence on his/her actions.

We now look into the third version of the Social Force model. The version of

[62] is a mixture of Equations 1.5 and 1.1. The Social Force model is defined as

d~v α = ~f (t) + ~ξ (t), (1.6) dt α α where ~vα is the speed, ~fα is the overall social force, and ~ξα is the fluctuation of pedestrian α. The fluctuation term describes the random behaviors of pedestrian Introduction 15

α. The overall social force is given by

~ ~0 ~ ~ ~ fα(t) = fα (~vα) + fαB(~rα) + ∑ fαβ(~rα,~vα,~rβ,~vβ) + ∑ fαi(~rα,~ri, t), β(6=α) i where each term is the goal force, the repulsive force between pedestrian α and

a boarder B, the repulsive force between pedestrians α and β, and the attractive

forces of a place i for pedestrian α, respectively. The difference between this version

and Equation 1.5 is the equation for the repulsive force between pedestrians α and

β, while the goal force, the repulsive force between pedestrian α and a boarder B,

and the attractive force remain the same as Equation 1.5. In this paper, Helbing et

al. call this term “repulsive interaction force”, and it is defined as   1 + cos(φαβ) ~f (t) = A1 exp[(r − d )/B1]~n λ + (1 − λ ) αβ α αβ αβ α αβ α β 2

2 2 + Aα exp[(rαβ − dαβ)/Bα]~nαβ.

The newly-introduced terms are λα and φαβ: λα accounts for the anisotropic char- acter of pedestrian interactions, and φαβ is the angle between the direction of mo- tion of pedestrian α and the direction of the object (the border or pedestrians β) exerting the repulsive force. The rest of the variables are the same as Equation

1.1 with α = i and β = j. Note that the first term describes the personal bubble, or the private sphere, of a pedestrian, and the second term describes the physical interactions.

1.3.2 Interacting Particle Models

The interacting particle modeling is an approach to model collective motion. The collective motion is a macroscopic phenomenon that can be seen as the particles interact with each other at the microscopic level. The system is updated solely Introduction 16

based on the particles’ interaction with their neighboring particles and their envi-

ronment, when applicable. In Chapter3, we focus the work of Vicsek et al. [132]

and Barbaro et al. [23], while using the code based on the work of Volkin [134]. We provide a detailed discussion of these models here.

Many models within the interacting particle system study the fundamental be-

havior of collective motion of nature. In [11, 26, 36, 52, 53, 89, 97], the pattern

formation (i.e. flocks, swarms, and schools) and the collective motion within na-

ture are thoroughly studied. In [84, 135], the authors find that a ring pattern can

be formed while the particles alternate between the desire to avoid others and the

desire to stay within a cohesive swarm. Expanding from this study, the authors

perform a stability analysis of a homogeneous state and find that the low mode

instability results in the deformation of the curves, and the high mode instability

can result in the disintegration of the ring pattern [27]. The continuum kinematic

model for biological organisms that swarm is derived in [129].

The Vicsek model by Vicsek et al. from [132] is another seminal model in the

field of interacting particle systems and self-driven particles. Since its introduction, it has been widely applied to model collective motion of cells [46, 94, 126], organ- isms in three dimensions [47], and humans [120]. Another study has extended the

Vicsek model to three dimensions from two dimensions by adding local cohesion and also taking consideration of the fluid in which the particles move in [40]. Fur- thermore, the author of [41] has studied the effects of noise in the model and find that the systems switch between ordered and disordered states infinitely for any noise intensity and population density. Introduction 17

The authors of [92] present the individual-based, discrete, and stochastic model for capelin migration where one particle represents a small school of fish. The particles in this model are self-propelled, and the motion is governed by the sur- rounding particles, or neighbors, environmental factors (i.e. temperature, oceanic currents, and food availability), and a force field from an attracting spawning re- gion. This model is able to simulate the capelin migration and shows promising results. The capelin migration models in [23, 24, 141] are based on this model. The continuum algorithm for the interaction of individuals among animals (i.e. fish schools) can be found in [49]. The individuals in flocks and schools are known to repulse from others within a close range and to attract each other within a wide range. The studies of repulsive-attractive radial potentials can be found in [19–21].

In [98], the authors address the drawbacks of the seminal self-organized sys- tems model by Cucker-Smale [45] and introduce a model that addresses these drawbacks. The authors argue that the model by Cucker-Smale (C-S) only takes into consideration the distance between agents and explicitly depends on the num- ber of agents. They argue that this dependence on the number of agents is inade- quate for far-from-equilibrium scenarios. Instead, this new proposed model scales the influence between agents by their relative distance, which allows them to fix the size of an agent’s neighborhood, and the geometry in phase space is the only factor being considered. The analysis of the flocking behavior with and without the “leaders” can be found in this study as well.

Interacting particle modeling also has been used in various fields, including

Biology and Medicine [16, 25, 33, 54, 106, 119, 130, 136, 143, 144], schooling of

fish [23, 24, 28, 34, 59, 69, 70, 86, 141], territories [14, 15, 22, 61], and crime Introduction 18

modeling [78, 117, 118]. The thorough explanation of large-scale dynamics from various models of a very large number of interacting particles can be found in

[124].

1.3.3 The Vicsek Model

Self-driven particles (SDP) is a concept that describes models with autonomous

particles that use the surrounding environment to direct their motions. Since SDP

interact according to their surroundings with given social and physical rules, such

models often exhibit collective behaviors. Note that the SDP falls under the inter-

acting particle modeling. The Vicsek model [132] investigates clustering, transport,

and phase transition of SDP with a simple rule. The simple rule is, each particle

must follow its neighboring particles. In other words, each particle matches the

average direction of motion from its neighbors with some random perturbation.

The model is initialized with N randomly placed particles from the uniform

distribution on an L × L square cell with periodic boundary conditions. Let xn(t)

be the position of particle n at time t. The population density of a square cell is

N given by ρ = L2 . The neighbors that affect the decisions of a particle are those within the radius, r = 1, commonly referred to as the neighborhood of the particle.

Let the orientation of a particle n to be un, and the direction of the same particle to

be θn. The orientation of this particle is then given by   cos(θ )  n  un =   . sin(θn)

The update of the direction, orientation, and position of a particle n is given by

θn(t + ∆t) = < θ(t) >r + η, (1.7) Introduction 19

  cos(θ (t + ∆t))  n  un(t + ∆t) =   (1.8) sin(θn(t + ∆t)) , and

xn(t + ∆t) = xn(t) + cun(t + ∆t)∆t, (1.9)

2 respectively, where the noise is given by η ∼ N(0, σ ), and < θ(t) >r denotes the average direction within the neighborhood r. The model is initialized with three initial conditions:

(1) In the beginning, when t = 0, N particles are randomly distributed through-

out the square cell.

(2) Every particle has the same absolute velocity.

(3) The directions, θ, are also randomly distributed.

1.3.4 Polarities and Correlation

Studying the Vicsek model, Volkin employs three polarities to measure the system

alignment of the Vicsek model [134]. Following Volkin, we do the same in Chapter

3. The first parameter is the global polarity, GV, that describes the average amount

of alignment for the whole system. The global polarity is defined by

1 N GV(t) = k ∑ uj(t)k, (1.10) N j=1 where k · k is a standard Euclidean norm. The range of global polarity is [0 1];

GV = 1 if and only if uj = uk for all 1 ≤ j and k ≤ N, and GV ≈ 0 if the orien- tations cancel each other out. The second parameter is the average local polarity,

LV. This parameter gives a sense of how aligned particles are with their neighbor-

ing particles, instead of considering the whole system as is done with the global Introduction 20

polarity. The average local polarity is defined as

1 N 1 LV(t) = ∑ k`j(t)k, `j(t) = ∑ ui(t), (1.11) N j=1 Nj i∼j where i ∼ j signifies the set of i ∈ {1, 2, ··· , N}\{j} such that kxi(t) − xj(t)k ≤ R

and Nj is the number of elements of the set i for particle j. Like the global polarity,

this parameter’s range is [0 1]; LV = 1 if and only if uj = uj for all i ∼ j, and

LV ≈ 0 if the orientations locally cancel each other out. The last parameter is the

average local correlation magnitude, CV. This is defined by

1 N 1 CV(t) = ∑ kcj(t)k, with cj(t) = ∑ | < ui(t), uj(t) > |, N j=1 Nj i∼j where < ·, · > is the standard Euclidean inner-product. Similar to the previous pa- rameters, the range of the average correlation magnitude is [0 1]. When all particle velocities are either positively or negatively correlated in unison, the correlation becomes CV = 1. On the other hand, if the interacting particles are on average uncorrelated, then CV ≈ 0.

1.3.5 An Interacting Particle Model for Fish Migration

Lastly, we review the work of Barbaro et al., the modeling of the migration of pelagic fish [23]. The authors specifically focus on a fish species called capelin in the Iceland Sea. capelin travels hundreds of kilometers during its migration be- tween its spawning and feeding grounds, and they are essential to the Icelandic

fishing industry. For more information on capelin and its migration, see [23] and

[37]. The modeling of capelin migration is accomplished by movement towards a preferred temperature and the interaction between neighboring fish. In Chapter

3, we consider a simpler model where we solely focus on the interaction between Introduction 21

neighboring particles. For this reason, we omit the review of the environmental

factors of this model and refer the interested reader to [23].

Figure 1.1. The three zones of interaction of kth particle that is lo- cated at the center of the zones. The radii of the zones are given by rr, ro, and ra, for the zone of repulsion (Rk), zone of orientation (Ok), and zone of attraction (Ak), respectively.

The model in [23] is a three-zone model, where the interactions are classified

into 3 zones. Let the zone of repulsion be Rk(t), the zone of orientation be Ok(t),

and the zone of attraction be Ak(t) for the kth particle at time t. To see the visu- alization of these zones, see Figure 1.1 from [23]. When a particle is in the zone

of repulsion, it directs away from other particles in this zone to avoid collisions.

Fish also align their velocity to their neighbors’ in schools of fish [104]; the zone of

orientation accomplishes this alignment as a particle aligns its speed and direction with neighboring particles in this zone. Particles go directly towards their neigh-

boring particles within the zone of attraction, maintaining more cohesiveness of a

school. Introduction 22

T The model is defined as following. Let qk(t) = (xk(t), yt(t)) and vk(t) be the position and velocity of the kth particle at time t, respectively. The time step is given by ∆t. The particles update their speed by

1 vk(t + ∆t) = ∑ vj(t), (1.12) |Ok| j∈Ok and their position by   cos(φ (t + ∆t))  k  qk(t + ∆t) = qk + ∆tvk(t + ∆t)   , (1.13) sin(φk(t + ∆t)) where |Ok| is the number of particles within the zone of orientation of the kth

particle, and φk is the directional angle of the kth particle. The φk is calculated to avoid conflicts with neighboring particles and is given by   cos(φ (t + ∆t))  k  dk(t + ∆t)   = , (1.14) kdk(t + ∆t)k sin(φk(t + ∆t)) where    − cos(φk(t)) 1  qk(t) qr(t)   dk(t + ∆t) =  ∑ + ∑   |Rk| + |Ok| + |Ak| ∈ kqk(t) − qr(t)k ∈ r Rk o Ok sin(φk(t)) ! q (t) − q (t) + ∑ a k . kqa(t) − qk(t)k a∈Ak (1.15)

Similar to |OK|, |RK| and |AK| represent the number of particles within respective zones of the kth particle. Introduction 23

1.3.6 The Scaling

In [23], 50,000 particles are used to model about 50 billion fish. This implies that

each particle represents about one million fish, making it a superindividual. The

authors think of one particle as one school of fish all behaving in an identical man-

ner, and they also assume that the dynamics of a school of superindividuals is

identical to the large school of individuals. This statement leads them to consider

the scaling shown below. Let F be the actual number of fish in a migration, N be

the number of particles in a simulation, D be the size of the domain, R to be the ra-

dius of interaction, and i be the ith simulation. In the actual migration, the number

of fish within a given area can be written out as # Real Fish  # Real Fish  # Particles in simulation = Size of domain # Particles in simulation # Zones of interaction # Zones of interaction Size of domain # Particles in simulation = (Fish per particle) # Zones of interaction # Zones of interaction Size of domain   ! 2 ! F Ni D/πRi = 2 . Ni D/πRi D (1.16)

 # Particles in simulation  When the particles are uniformly distributed, the term # Zones of interaction is

close to the number of neighbors per particle, and let this term to be Mi. Then, this simplifies down to

  2 ! # Real Fish F D/πRi = (Mi) . Size of domain Ni D Introduction 24

Now, let i = 0 to be the current simulation and i = 1 to be the new simulation. As

# Real Fish the value of the term Size of domain remains the same, the equation becomes ! !  F  1  F  1 (Mo) 2 = (M1) 2 , (1.17) N0 πR0 N1 πR1 which further simplifies to ! !  1  1  1  1 (Mo) 2 = (M1) 2 . (1.18) N0 πR0 N1 πR1

If the number of interaction partners, Mi, is fixed, then 2 2 R0N0 R1 = , N1 s (1.19) N0 R1 = R0 . N1 This implies that 1 R ∝ √ . N Furthermore, to ensure the portion of the zone traversed per time step remains constant, they require

v∆t = cR, where v is the velocity, and c is the speed. They posit that the two parameters should also remains constant as they change the number of particles, N. Hence, they get the relation of 1 ∆t ∝ R ∝ √ . (1.20) N We use this scaling to see if the behavior of a system changes as we change the

number of particles in Chapter3. Introduction 25

1.3.7 Twitter

Twitter data tells many stories. The authors of [125] study the politically seg-

regated Twitter community using Retweets during the 2010 U.S. congressional

midterm elections. They find that the homogeneous political clusters are highly

segregated with extremely limited connectivity. However, at a user to the user

level, the ideologically-opposed individuals interact at a higher rate than the clus-

ters. In a completely different note, the authors of [58] automatically classify the

sentiments of tweets. The emojis are the key to the classification that resulted in

over 80% of accuracy. Furthermore, the authors of [29] also use sentiments of

tweets for their studies. However, in this study, they show that the sentiments

and the value of the Dow Jones Industrial Average (DJIA) over time are correlated.

They use two mood tracking tools to read the sentiment and to predict changes in

DJIA closing values with 86.7% accuracy. The authors of [128] find that popular

events result in a strong negative Twitter sentiment. Twitter data is used for event

detection. The authors of [137] detect events using the live stream of the tweets.

Twitter also has been used to look into Twitter communities [17, 18, 39, 43, 51, 60,

96, 127] and to detect or predict events [13, 35, 56, 57, 73, 75, 76, 85, 91, 93, 113].

Chapter4 uses the results of Winterer’s work [138], and we provide the details

here. Note that Winterer uses the same data set as this project. Winterer’s focus was to construct a linear model to predict the number of Tweets being tweeted in

a given community. The linear models are given by

6 23 Y = β0 + ∑ βi,1Xi,1 + ∑ βj,2Xj,2 + ε (1.21) i=1 j=1 Introduction 26

and 6 23 23 6 Y = β0 + ∑ βi,1Xi,1 + ∑ βj,2Xj,2 + ∑ ∑ γk,l(Xk,1Xl,2) + ε, (1.22) i=1 j=1 l=1 k=1 where β0 is the intercept, and the qualitative variables are   1 if i-th day of week Xi,1 =  0 otherwise,

  1 if j-th hour of day Xj,2 =  0 otherwise, and

  1 if i-th day of week and j-th hour of day Xi,1Xj,2 =  0 otherwise. These Equations 1.21 and 1.22 have qualitative variables that represent the num-

ber of Tweets per hour for a day or week. Equations 1.21 and 1.22 can also be

compressed from n independent experiment trials to one matrix-vector equation,

Y = Xβ + ε,         Y1 1 X1,1 ··· X1,k−1 β0 ε1          .   . . .   .   .   .  =  ......   .  +  .  .  .   . . .   .   .          Yn 1 Xn,1 ··· Xn,k−1 βk−1 εn Here, ε is a random error given by ε = Y − Xβ and is assumed to be ∼ N(0, σ2).

Winterer found that these models do not capture the data well even after the power √ transformation (Yλ), ln(Y), and Y transformation due to the violation of the nor-

mality assumption and the error term, ε, not being normally distributed with a

constant variance. Introduction 27

Generalized linear models do not assume the constant variance and normal

error term. For this reason, Winterer introduces generalized linear models. The

main generalized linear model that Winterer explored was Poisson linear model,

n n −1 Y  −1  g (Xi, β) i exp −g (Xi, β) L(β) = ∏ fi(Yi) = ∏ . i=1 i=1 Yi If the Poisson model shows that the variance of the data are greater than the mean, or over dispersion, then the negative binomial distribution,   r + x − 1   r x f (x; r, p) =   p (1 − x) , x is often used. Here, x = {0, 1, ···}, r ∈ {1, 2, ···}, and 0 ≤ p ≤ 1. For more details

about transformations and general linear models, see [138], [38], and [110].

Winterer found that the Negative Binomial linear model was able to predict

and capture data significantly better than the Poisson linear model for both models with and without interaction terms. Winterer also found that the intervals from

quantiles predicted the data just as well as the negative binomial linear model.

However, Winterer suggests that the quantiles cannot be solely relied upon when

identifying a potential period of civil unrest. There were times when the number

of Tweets exceeded the intervals given by the quantiles, but the civil unrest did not

occur. In Chapter4, we use this study’s result and use the quantiles as part of a

statistical tool to predict civil unrest. 28

2 Evaluation of the Social Force Model Using Experimental Data

In this chapter, we evaluate the performance of the Social Force Model by Hel- bing et al. [63, 64, 66] using experimental data. In Section 2.1, we discuss the motivation behind this study. We explain the evacuation experiment conditions and the procedure in Section 2.2. In Section 2.3, we discuss the method of the simulations, and we discuss the results of our evacuation modeling simulations in

Section 2.4. Lastly, in Section 2.5, we fit and compare the results of simulation with the experiment.

2.1 Motivation

For the type of evacuations that requires individuals to quickly exit out of a room, the disorderly evacuation process generally exhibits the following [64]: people move faster than normal, pushing starts, passing bottleneck (i.e. doors) becomes uncoordinated, clogging and jams build up near the exit, pressure adds up from the pushing, the individuals fall and become obstacles for the others, mass behav- ior forms, and the alternative exits are not used [112]. Well planned and orderly Evaluation of the Social Force Model Using Experimental Data 29

evacuation processes during an emergency are known to yield much lower casu-

alties and/or injuries [1,2]. Therefore, it is important to prepare the emergency

evacuation routine in any setting to prepare for all types of disasters. However, it

is unethical to put someone in danger just to plan out a better evacuation route.

This is the reason that the ability to conduct evacuations in computer simulations

is important.

The Social Force model by Helbing et al. [63, 64, 66] was first introduced in

1995 to capture the crowd dynamics. It is widely known and used, but it has been

shown that the agents of this model take unnecessary movements [80] to get to

their goals (i.e. exit), and it has been documented in a VR experiment that agents

can get unnaturally stuck since they are not able to efficiently avoid each other [79].

In this chapter, we explore how well the Social Force model performs compared to

a real-life evacuation experiment and use the result of this as a basis to propose an

alternative version of this model.

2.2 Experiment

The evacuation experiment was done by Dr. Abhishek Bhatia of Columbia Uni- versity, and the data was obtained from Dr. Sachit Butail of Northern Illinois Uni- versity, who gave us permission to work with the data.

2.2.1 Experiment conditions and Procedure

The experimental arena consisted of an 8.18 m by 4.01 m by 3.5 m room with a

single exit door that was 0.91 m wide. There was a camera on the upper left corner

of the room to record the experiment and produce data; see Figure 2.1 for the room Evaluation of the Social Force Model Using Experimental Data 30

1.34 m 0.91 m 2.84 m 0.3 m exit 0.61 m ˆ (0,0) j ˆi

general assembly area 4.01 m

8.18 m

Figure 2.1. The floor plan of assembly area, or arena, is shown as a 4 m by 4 m gray square where the participants assembled prior to the start of experiments.

layout. Since this was done at a university, the experimenter was able to find stu-

dents who volunteered to be part of this experiment in the hallway between their

classes. All of the participants gave verbal consent to this experiment.

There were a total of 7 experimental trials; each experimental trial consisted of

a group of 21 to 24 individuals exiting the room upon receiving a cue by the exper-

imenter. The varying number of participants was due to the student availability at

that time. Participants were placed in an orderly fashion within an approximately

4 m by 4 m space near the exit at the beginning of a trial. Before the participants were asked to assemble in the arena, the experimenter handed each of them an exit

instruction on a piece of paper. The instruction consisted of two options:

(1) Leave the room quickly (rush condition)

(2) Leave the room (no-rush condition). Evaluation of the Social Force Model Using Experimental Data 31

They were told not to share their own instructions with others and to not push oth-

ers for safety reasons. They were also told to walk towards the exit, leave the arena,

and keep walking until at least 20 feet away from the exit to prevent unnecessary

clogging outside of the exit.

The experimenter wanted to see if the exit speeds of the participants change as

the number of rush and no rush participants varied. For this reason, there were 5

different proportions of rush and no-rush conditions: 0(100), 25(75), 50(50), 75(25),

and 100(0). Each proportion represented the percentage of rush(no-rush), respec-

tively. Each condition had one trial except for the 25(75) and 100(0) conditions,

each of which had 2 trials. The experimental data consisted of the initial positions,

exit speed (m/s), shortest distance traveled (m), time to exit (s), and type (rush or

no-rush) for each participant. For more detailed discussion of the experiment and

the experimental results, refer to [88].

2.3 Modeling

For the simulation, we use the Social Force model introduced in Subsection 1.3.1.

The dynamics are determined by Equation 1.1:

N dvi g mi = mifi + ∑ fij + ∑ fiw, dt i j=1,j6=i w where the goal force is 0 0 g vi ei (t) − vi(t) fi = , τi the interaction force is

( (rij−dij) ) B t fij = Aie i + κg(rij − dij) nij + κg(rij − dij)∆vjitij, Evaluation of the Social Force Model Using Experimental Data 32

and the wall force is

(ri−diw) B fiw = {Aie i + kg(ri − diw)}niw − κg(ri − diw)(vi · tiw)tiw.

0 0 Here, mi is the mass of an agent i, vi is the desired speed, ei is goal direction, and

τi is the adaptation time that determines the time it takes for an agent to turn in the desired direction [77]; Ai and Bi are constants that determine the interaction strength and the characteristic length scale of the interaction range, respectively.

The size of interaction radius, rij = ri + rj, is the sum of agents radii; dij is the relative distance between them; nij is a unit vector from j to i; tij is the tangential

t direction; ∆vji is the tangential velocity difference; κ and K are large constants, and

g(x) is the function that is zero when the pedestrians are not in contact (dij > rij) and otherwise equal to the argument x. The goal force is the deviation of the actual velocity from the desired velocity of an agent i, and the interaction and wall forces

are the interactions between an agent, or person, and the agent’s neighbors or the wall, respectively. See Section 1.3 for a detailed explanation of this model.

As we have seen in Subsection 1.3.1, Helbing et al. have different versions of

the Social Force models between their papers, [66], [63], and [64]. They introduce

the additional noise term, or the fluctuation term, in the Social Force model in [66]

and [64], so that N dvi g mi = mifi + ∑ fij + ∑ fiw + ξ, (2.1) dt i j=1,j6=i w with ξ a noise term that does not exist in [63]. Helbing et al. describe the noise as

the term that takes into account random behavioral variations.

Although Helbing et al. never explicitly defines the noise term, it can be found q ∆t that ξ = Default ∆t ∗ κ ∗ η from the code of [63], where Default ∆t = 0.01, ∆t = Evaluation of the Social Force Model Using Experimental Data 33

0.01, κ ∼ N(0, 1), and η = cos(2π ∗ random number) for x or η = sin(2π ∗

random number) for y. These random numbers are generated from the uniform

distribution. We also add the noise term to the model in the simulations as it is the

default setting of the authors’ code.

2.3.1 The Code for the Social Force Model

We use the C code that is provided by Helbing et al. from [63]. This code is avail-

able at http://angel.elte.hu/~panic/. We use this provided code instead of cod- ing the model on our own because of the accuracy, since the authors used this

code to produce the results for [63]. However, we make some modifications from

the code according to the described experiment in Section 2.2. We change the di-

mensions of the arena and the exit so that they mimic the exact environment of

the experiment. In the experiment, each participant was assigned a number (1-N),

an ID, to keep anonymity. The results of this experiment also utilize these IDs to

record the assigned participants’ initial positions, rush or no-rush conditions, time

to exit, average speed, and distance traveled per trial. We implement this ID sys-

tem in the simulations as well. We assign each agent in the simulation an ID and

have it mimic exact initial conditions with the experimental participant who shares

the same ID. We feed in a text file to the code that contains the initial positions of

the experiment participants, and we assign these positions to the agents according

to their assigned ID. We determine the rush or no-rush conditions of the agents

based on their ID as well. For simplicity, we create one code per proportion of rush

and no-rush conditions and mimic its experimental environment. We discuss the

modifying process in more detail in the next subsection. Evaluation of the Social Force Model Using Experimental Data 34

2.3.2 Simulation Conditions

The spatial dimensions for simulating crowd evacuation has the exact same en- vironment as the experiment. Depending on the rush(no-rush) condition of the

simulation, the arena consists of either a 4 x 4.5 m or a 3.6 x 4.5 m grid with a 1.0 m wide exit placed at the left side of the grid. The dimensions of the simulated room

are manually adjusted so that initial positions do not collide with the boundary or with other agents. Simulations are initialized by placing N = 21 − 24 agents inside

the grid by using both the initial positions of the participants from the experiment

and observations from the video data. We describe this process in more detail

in the next section. Based on data from an anthropometric study of Indian male workers [50], the size of an agent di = 2ri is sampled from the uniform distribution with a mean 0.393 m and a standard deviation of 0.03 m.

Just like the experiment, we divide the agents into rush and no-rush conditions

based on their assigned ID and place them to their given initial positions accord-

o ingly. We fit the desired speeds vi to the experimental exit speeds of rush and no-rush participants in the conditions 0(100) and 100(0), respectively. We test wide

0 ranges of values for A, B, and vi to fit the model to the experiment; this fitting process is discussed in Section 2.3.3. The rest of the model parameters are set to the default values found in Helbing et al. [63].

0 0 Each simulation takes 6 parameters: [ARush BRush vRush ANoRush BNoRush vNoRush]. We use an ensemble of one hundred simulations per parameter set for each con-

dition corresponding to the ratio of rush to no-rush agents in the experiment. The

simulations run until all agents exit the arena or, when some or all of the agents

fail to exit, until a fixed maximum iteration. Evaluation of the Social Force Model Using Experimental Data 35

Fixing Initial Position. Because the camera sensor was placed at an angle, the ini-

tial position data of the participants did not always match the actual position that

could be seen in the video footage, see the top picture of Figure 2.2. To solve this

problem, we manually check with the image of the experiment at its initial stage

and minimally move the initial positions so that they more closely match the actual

participants’ initial positions. We move the agents’ initial positions in a way that

the agents would not touch each other when t = 0 to avoid the endless redrawing

of the shoulder lengths, 2ri, of the agents. Figures 2.2 and 2.3 show both exper- imental initial conditions (left) and the fixed initial positions (right) of agents for

the 100(0) condition. While we examine the images of each experiment condition, we have noticed that the second trial of both 25(75) and 100(0) experiments would

require more rigorous adjustments. Since we do not want to tamper with the given

data too much, we decide to neglect those two experiments.

2.3.3 Model Parameter Selection

We first run a simulation with the given parameter values from Helbing’s 2000

paper [63] to see how the initial fitting between the experiment and simulation look

like. As we see from Figure 2.4, we can determine that there are large discrepancies

in the exit speeds between the experiment and simulations even without using

any metric to measure the fit. This result leads to exploring and trying to find a

parameter set that would better fit the experimental data.

We introduce the modified model of Equation 1.1 with the rush or no-rush

conditions. The modified Social Force model remains the same as Equation 1.1

except for a few changes within the three forces and the addition of the noise term. Evaluation of the Social Force Model Using Experimental Data 36

3 3

2.5 2.5

2 2

1.5 1.5

1 1

0.5 0.5

0 0

-0.5 -0.5

-1 -1 -1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5 -1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5

Figure 2.2. The experimental data and adjusted mutual conditions: (Top row) the image of experiment initial positions of the partici- pants. (Bottom row) right: the raw initial positions data of the 100(0) condition, and left: the fixed initial positions data of the 100(0) con- dition.

If the agent i is assigned to the ID that belongs to a rush conditioned experiment participant, the agent i will be simulated using the Social Force model modified for the rush condition. The goal force of the rush conditions is

0 0 g vRushei (t) − vi(t) fi = , (2.2) τi and the interaction force of the rush conditions is     (rij − dij) t fij = ARush exp + κg(rij − dij) nij + κg(rij − dij)∆vjitij. (2.3) BRush Evaluation of the Social Force Model Using Experimental Data 37

3 3

2.5 2.5

2 2

1.5 1.5

1 1

0.5 0.5

0 0

-0.5 -0.5

-1 -1 -1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5 -1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5 3 3

2.5 2.5

2 2

1.5 1.5

1 1

0.5 0.5

0 0

-0.5 -0.5

-1 -1 -1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5 -1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5 3

2.5

2

1.5

1

0.5

0

-0.5

-1 -1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5

Figure 2.3. The initial positions from the experimental data are in the small open black circle, and the adjusted initial positions of the agents are the blue asterisk. The big red circles surrounding the small black circles represent the maximum shoulder length of the agents. From left to right, (Top Row) 0(100) and 25(75), (Middle Row) 50(50) and 75(25), and (Bottom Row) 100(0). The blue lines indicate the experiment arena dimension.

Again, the wall force for the rush conditions is analogous to Equation 2.3. While

unmodified parameters remain the same as discussed in Subsection 1.3.1, we mod-

ify the interaction strength, the characteristic length scale of interaction range, and Evaluation of the Social Force Model Using Experimental Data 38

Figure 2.4. The average speeds across the rush (red) and no-rush (blue) conditions for the experiment (in dark colors) and the simula- tion (in light colors) with parameters from the Helbing’s 2000 paper.

0 the desired speed, ARush, BRush, and vRush, respectively, just for the rush agents. For the no-rush conditions, the modified Social Force model is analogous to the

model of the rush-conditions. The goal force of the no-rush conditions is

0 0 g vNoRushei (t) − vi(t) fi = , (2.4) τi

and the interaction force of the rush conditions is     (rij − dij) t fij = ANoRush exp + κg(rij − dij) nij + κg(rij − dij)∆vjitij. (2.5) BNoRush

Again, the wall force for the no-rush conditions is analogous to Equation 2.3, and

the no-rush condition for the agents is determined by their assigned ID and the Evaluation of the Social Force Model Using Experimental Data 39 participants who they are mimicking. We assign the specific parameters A, B, and v0 to either rush or no-rush conditions, because we plan to have different values for these parameters given the rush or no-rush conditions; this is discussed in Sub- section 2.3.5.

Table 2.1. Parameters used for simulating crowd models

Parameter Description Value mi mass 80 (kg) τi adaptation time 0.5 (s) Ai interaction strength [0 4000] (N) Bi characteristic length scale of interaction range [0.0001 0.16] (m) 0 m vi desired speed [0 2] ( s )

There are many parameters to choose from the modified model, Equations 2.2,

0 2.3, 2.4, and 2.5. We explore the influence of parameters, [ARush, BRush, vRush, 0 ANoRush, BNoRush, vNoRush], as the parameters A and B heavily influence inter- actions between the agents and walls, and the desired speed, v0, contributes to agents’ exit speed. Also, the effects of some other parameters, such as the adapta- tion time τ, had already been explored by others in [81]. We decide the parameter range based on the given values from [63]; we use the given values as the center points then take a range from 0 to twice these values. The ranges of the parameters can be found in Table 2.1.

2.3.4 Latin Hypercube Sampling

Since we explore large ranges of the parameters given in Table 2.1, the computa- tional time and cost will be exceptionally high if we use a small increment between the runs. To cut down the computational cost and time, we use Latin Hypercube Evaluation of the Social Force Model Using Experimental Data 40

Sampling (LHS) as it is an efficient method to sample from a wide range of param-

eter values. The advantages of using this method besides its efficiency are that it

ensures the sampled points are spread evenly across the range of each input pa-

rameter and can be used in multiple dimensions. The idea of Latin Hypercube

Sampling comes from a Latin Square. In Figure 2.5, we see that letters A through

C are placed in each row and column of the square. A Latin Square ensures that

each letter appears exactly once in each row and column.

Figure 2.5. A simple 3 by 3 Latin Square.

We explain the Latin Hypercube Sampling from a 1 × 1 square region for the

simplicity. However, the sampling region can be extended to any size. Let us

say that we want to sample n points from the 1 × 1 square region. We divide

each axis, [0, 1], into n equally spaced intervals, [0, 1/n),..., [(n − 1)/n, 1], which

results in n2 equally sized cells in the sampling region. Now, we fill these cells with

the integers 1, 2, . . . , n to form a Latin square, while making sure that each integer

appears exactly once in each row and column of this grid of cells. We select one of

the integers at random, and for each of the n cells that contain this selected integer, we select a point at random. This results in the Latin Hypercube sampling of n

points [115]. As we see in a Latin Square, Latin Hypercube Sampling ensures that Evaluation of the Social Force Model Using Experimental Data 41

the sampled points are spread evenly over the range of each input parameter, A,

B, and v0.

2.3.5 The Process of Selecting the Parameters

For each no-rush and rush condition, we discuss the steps that are used to deter-

mine the best-fitting parameter set. First, we use Latin Hypercube Sampling (LHS)

0 to draw 600 points in the six-dimensional parameter space, [ARush, BRush, vRush, 0 ANoRush, BNoRush, vNoRush]. The ranges of these parameters can be found in Table 2.1. We choose to sample 600 points as they are space filling enough.

We simulate each parameter set per rush and no-rush condition 100 times and

find the Wasserstein distance of the experimental exit speed and the exit speed from a simulation for each of the runs. Recall that the Wasserstein distance mea- sures a distance between two distributions by calculating how much energy one would need to move and reshape one distribution to another. The Wasserstein dis- tance of 0 indicates that the two distributions are identical, and it has the range of [0

∞). Although the Wasserstein distance is hard to compute in higher dimensions, it is straightforward to calculate in one-dimension [107]. For a detailed explanation, see Section 1.2. Luckily, we are finding the Wasserstein distance between the exit speeds of the experiment and the simulation, which is in one-dimension. We, then, use the ensemble average of the 100 Wasserstein distances between the exit speeds of the experiment and the simulation to determine which parameter set gives the

0 closest fit. The best-fitting desired velocities for our model are vRush = 1.0945 and 0 vNoRush = 0.9795. Evaluation of the Social Force Model Using Experimental Data 42

Figure 2.6. The plot of the 600 values sampled from Latin Hypercube sampling. The y-axis is the characteristic length scale of interaction range, B, and the x-axis is the interaction strength, A.

Once we match the desired velocities, v0, to all rush case, 100(0), and all no- rush case, 0(100), of the experiment from the 600 parameter sets of LHS, we fix them and set them as the default desired velocities for the rush and no-rush agents accordingly across all conditions. The reason behind fixing the desired velocities is to have uniform desired speeds for all rush or no-rush agents regardless of the ex- perimental conditions; our assumption is that the desired speed of the participant should be determined by the strength of their motivation to exit the room. Evaluation of the Social Force Model Using Experimental Data 43

Next, we redraw 600 points from Latin Hypercube Sampling for the four re-

maining parameters, [ARush, BRush, ANoRush, BNoRush]. See Figure 2.6 for the vi- sualization of 600 A and B points sampled from Latin Hypercube sampling. We

redraw to eliminate the dependency of the desired speed from the previous pa-

rameter sets. We, again, run each rush and no-rush condition 100 times and find

the minimum ensemble average of the 100 Wasserstein distances of the experimen-

tal exit speeds and the simulation exit speeds to determine the overall best-fitting

parameter set.

2.3.6 Visualizing the Wasserstein Distance

The Wasserstein distance can be visualized in one dimension using the cumulative

distribution function (CDF). In Figure 2.7, we can see the CDFs for the average

speed of the experimental no-rush subjects for the 50(50) condition in dark blue,

and the experimental rush subjects in dark red. We simulate using the parame-

ter set resulting in the lowest Wasserstein distance, and the resulting CDFs of the

exit speed of the no-rush and rush agents are shown in the plot on the left in light

dashed blue and light red lines, respectively. The plot on the right shows the CDFs

for a simulation performed using the parameters producing the maximum Wasser-

stein distance; the CDF for the no-rush agents is plotted as a light dashed blue line, while the CDF for the rush agents is plotted as a light dashed red line. As we can

observe from these figures, the simulated CDFs for the minimum Wasserstein dis-

tance are much closer to the experimental CDFs than the simulated CDFs for the

maximum Wasserstein distance. In fact, the Wasserstein distance computed from

the plot on the left is 0.1804, while it is 1.7029 on the right. Evaluation of the Social Force Model Using Experimental Data 44

1 1

0.8 0.8

0.6 0.6

CDF 0.4 CDF 0.4 Experiment(NoRush) Experiment(NoRush) Experiment(Rush) 0.2 0.2 Experiment(Rush) BestSocialForce(NoRush) WorstSocialForce(NoRush) BestSocialForce(Rush) WorstSocialForce(Rush) 0 0 0.5 1 1.5 0 5 10 15 x x

Figure 2.7. The cumulative distribution functions of the exit speed for the 50(50) condition. In both figures, the blue represents no-rush conditions, and the red represents rush conditions. The experimen- tal CDF are shown as dark solid lines. The CDFs for one run using the parameter values giving the minimum Wasserstein distance is shown in light dashed lines (left), and the CDFs for a simulation per- formed using the parameters producing the maximum Wasserstein distance is in light dashed lines (right).

2.4 Modeling Result

In Table 2.2, we list the top five minimum Wasserstein distances between the exit

speeds of the experiment and simulation, together with the parameter sets that yield such Wasserstein distances. When calculating the Wasserstein distances, we weigh each term according to the proportion of rush and no-rush agents. For ex-

ample, in the 25(75) case, we have

1 3 25(75)WD = Rush WD + No-rush WD, 4 4 where WD is the Wasserstein distance of the exit speeds of the experiment and sim- ulation. Since we have different proportions of rush and no-rush agents across all the conditions, it makes sense to weigh the Wasserstein distances according to the conditions and not have each contribute to the overall value equally. We also find Evaluation of the Social Force Model Using Experimental Data 45

Conditions WD WD A B A B Rush No- Rush Rush No- No- Rush Rush Rush 100(0) 0.0430 NA 2600.8161 0.0122 NA NA 0.0432 NA 772.2899 0.0146 NA NA 0.0434 NA 3939.7681 0.0110 NA NA 0.0439 NA 3119.1939 0.0117 NA NA 0.0442 NA 1960.1753 0.0127 NA NA 75(25) 0.2752 0.1204 2532.2087 0.0021 2884.5443 0.0264 0.3087 0.1225 2975.4024 0.0045 1837.2579 0.0327 0.3101 0.1333 117.1384 0.0042 1976.2609 0.0338 0.3318 0.1060 2858.4812 0.0083 3301.1246 0.0019 0.3353 0.1071 1073.3886 0.0074 1251.6853 0.0021 50(50) 0.2686 0.0922 2057.3642 0.0075 1662.8214 0.0113 0.2635 0.1051 210.2434 0.0058 3730.4057 0.0059 0.2372 0.1329 1056.9571 0.0011 27.6546 0.0600 0.2543 0.1172 1073.3886 0.0074 1251.6853 0.0021 0.2940 0.0787 1948.6517 0.0086 8.6261 0.0578 25(75) 0.1924 0.1111 1073.3886 0.0074 1251.6853 0.0021 0.1965 0.1168 2858.4812 0.0083 3301.1246 0.0019 0.2117 0.1267 2723.7030 0.0136 3716.4583 0.0014 0.2251 0.1300 2199.6064 0.0064 1741.9421 0.0045 0.2435 0.1472 210.2434 0.0058 3730.4057 0.0059 0(100) NA 0.0497 NA NA 3.3546 0.1095 NA 0.0598 NA NA 8.6261 0.0578 NA 0.0649 NA NA 27.6546 0.0600 NA 0.0652 NA NA 417.2479 0.0186 NA 0.0657 NA NA 356.6604 0.0202 Table 2.2. Top 5 parameter sets are given for all the experimental con- ditions. The Wasserstein distance is abbreviated as ‘WD’ in the table. From top to bottom, the order goes from the best to worst for each row.

the Wasserstein distances by comparing the exit speeds of like conditions of exper-

iment and simulations. Because of weighing the Wasserstein distance according

to the proportions of the rush and no-rush agents, we can see that the minimum

Wasserstein distances for either rush or no-rush do not necessarily yield the lowest

overall Wasserstein distances. In general, the no-rush Wasserstein distances were Evaluation of the Social Force Model Using Experimental Data 46

lower than the rush Wasserstein distances. Although there is not any distinct pat-

tern for the top parameter values, we see from Table 2.2 that the model prefers

lower B values.

To get a better idea of which values of ANoRush, BNoRush, ARush, and BRush the model favors, we plot the Wasserstein distance as a function of the parameter val-

ues A and B in Table 2.3. For all of the plots, the x-axis is the values of A, and the

y-axis is the values of B. The middle column of Table 2.3 is the plots of no-rush

parameter sets, and the last column is the plots of rush parameter sets. The best

parameter set is in a magenta star, whereas the four runners-up are plotted as the

magenta diamonds. The plots are colored using dark blue for the overall lowest

Wasserstein distance as the minimum value and dark red for the overall highest

Wasserstein distance as the maximum value. We see a distinct rainbow pattern for

all the cases except for 25(75) rush and 75(25) no-rush. Like mentioned earlier, the

model clearly favors lower values of B as the dark blue dots are mostly concen-

trated on the lower values of B, and the red dots are located around the higher values of B. However, it is hard to distinguish any pattern for A as both dark blue

and red dots are spread across the x-axis. The lack of the rainbow appearance in

25(75) rush and 75(25) no-rush cases could be because the number of experiment

and simulation agents that we are fitting against is too small.

In Figure 2.8, we plot the exit speeds across all conditions for the experiment

and the simulation using the best fitting parameter sets. As usual, the rush condi-

tions are in blue, and the no-rush conditions are in red. The experimental results

are in dark lines with circle markers, and the simulation with the best fitting pa-

rameter sets are in lighter lines with square markers. We can see a discrepancy Evaluation of the Social Force Model Using Experimental Data 47

Condition rush(no-rush) A and B for No-rush Agents A and B for Rush Agents 0.15 1.5

0.1 1 B 0(100) 0.05 0.5

0 0 1000 2000 3000 4000 A

0.15 0.15 1.5 1.5

0.1 0.1 1 1 B B 25(75) 0.05 0.5 0.05 0.5

0 0 0 1000 2000 3000 4000 0 1000 2000 3000 4000 A A

0.15 0.15 1.5 1.5

0.1 0.1 1 1 B B 50(50) 0.05 0.5 0.05 0.5

0 0 0 1000 2000 3000 4000 0 1000 2000 3000 4000 A A

0.15 0.15 1.5 1.5

0.1 0.1 1 1 B B 75(25) 0.05 0.5 0.05 0.5

0 0 0 1000 2000 3000 4000 0 1000 2000 3000 4000 A A

0.15 1.5

0.1 1 B 100(0) 0.05 0.5

0 0 1000 2000 3000 4000 A Table 2.3. Results from simulations of parameter sets given by Latin Hypercube Sampling, plotted in 2D parameter space. The x−axes are the parameter A, and the y−axes are the parameter y. Here, we plot the Wasserstein distances as a colored circle at the point in parameter space where it was run. The blue schemes represent lower Wasserstein distance values, whereas the red schemes repre- sent higher values. The best parameter sets are filled with a ma- genta star, and the next top four parameter sets are filled with a magenta diamond. Since parameter space is four-dimensional, con- sisting of [ARush, BRush, ANoRush, BNoRush], we look at the Wasserstein Distances projected onto parameter space for the no-rush agents on the left, and projected onto the rush agents on the right. Evaluation of the Social Force Model Using Experimental Data 48

1.5

1 Exit Speed (m/s)

0.5

Experiment(norush) Experiment(rush) Social Force(norush) Social Force(rush) Fixed Social Force(norush) Fixed Social Force(rush) 0 0 (100) 25 (75) 50 (50) 75(25) 100 (0) % rush ( % no rush)

Figure 2.8. The exit speed of experiment (darker lines) and simula- tion (lighter lines). The red lines represent rush, and the blue lines represent no-rush. The dashed lines with ‘x’ markers are the exit speed of simulation with fixed A/B rush and no-rush across the all conditions. between the experimental results and simulations. The exit speeds for no-rush agents have a better fit than the exit speeds for the rush agents. We see that the experimental exit speed for 100(0) is significantly lower than the rest of the rush average speeds. This is due to the clogging at the exit door during the experi- ment. As stated in Section 2.1, the clogging at the bottleneck is expected for any disorderly evacuation process. Hence, we would also expect to see a significant decrease in simulation exit speeds between 75(25) rush and 100(0), but this is not captured by the model. Evaluation of the Social Force Model Using Experimental Data 49

4000 Rush 0.15 Rush No Rush No Rush 3000 0.1 A 2000 B

0.05 1000

0 0 0 (100) 25 (75) 50 (50) 75(25) 100 (0) 0 (100) 25 (75) 50 (50) 75(25) 100 (0) % Rush ( % No Rush) % Rush ( % No Rush)

Figure 2.9. Top five fits for A (left) and B (right) parameters for all the conditions from the simulation. Blue shows the no-rush parameters (ANR in the plot on the left and BNR in the plot on the right) while red shows the rush parameters (AR in the plot on the left and BR in the plot on the right). The solid lines show the values for the best fitted parameters, while the dotted lines show the top four runners up.

We further analyze the best fitting parameters through Figures 2.9 and 2.10. In

Figure 2.9, we plot the best five A values on the left and the best five B values on the right. Both ANoRush and BNoRush are in blue, and ARush and BRush are in red. The bold lines are the best-fitting values across the conditions, and the dashed lines are the parameter values that result in the four runners-up. The range for the

y-axis is from Table 2.1, and the range choices were explained in detail in Section

2.3.3. As discussed earlier, we see a more condensed marker placement around the lower ranges for the B values, but the A values seem evenly distributed. Similarly in Figure 2.10, we plot all the parameter values that yield an overall Wasserstein distance of 0.28 or lower. We choose the tolerance 0.28 as it shows enough number of parameter sets to see a pattern in the plot. The red markers are the rush pa- rameter sets, and the blue markers are the no-rush parameter sets. The best-fitting parameter sets are plotted with filled circles, and all the other sets that fall under the Wasserstein distance of 0.28 are plotted with square markers. Again, we see Evaluation of the Social Force Model Using Experimental Data 50

4000 0.15 Rush

3000 0.1 2000 A Rush B Rush 0.05 1000

Rush 0 0 0 (100) 25 (75) 50 (50) 75(25) 100 (0) 0 (100) 25 (75) 50 (50) 75(25) 100 (0) % Rush ( % No Rush) % Rush ( % No Rush) 4000 No Rush 0.15 No Rush

3000 0.1 2000 A No Rush B No Rush 0.05 1000

0 0 0 (100) 25 (75) 50 (50) 75(25) 100 (0) 0 (100) 25 (75) 50 (50) 75(25) 100 (0) % Rush ( % No Rush) % Rush ( % No Rush)

Figure 2.10. (Top Left) The values of parameter A that are within a Wasserstein distance tolerance of 0.28 for all rush conditions from the simulation. The best A is in a dark solid red circle, and the rest are in light red squares. (Top Right) The values of parameter B that are within a Wasserstein distance tolerance of 0.28 for all rush conditions from the simulation. The best B is plotted as a dark solid red circle. (Bottom Left) The values of parameter A that are within a Wasser- stein distance tolerance of 0.28 for all no-rush conditions from the simulation. The best value of A is shown as a dark solid blue cir- cle, and the rest are in light blue squares and the rest are in light red squares. (Bottom Right) The values of parameter B that are within a Wasserstein distance tolerance of 0.28 for all no-rush conditions from the simulation. The best B is shown as a dark solid blue circle, and the rest are in light blue squares.

that the B values are more concentrated around the lower values, whereas the val-

ues of A are all over the range. We also see that the no-rush B values varied more, whereas the rush B values are much more concentrated. Evaluation of the Social Force Model Using Experimental Data 51

2.4.1 Using One Parameter set

We also want to see if using one parameter set across all the conditions instead

of using the different parameter set for each condition would yield a satisfactory

result. We use the parameter set that gave the best-fitting desired velocities: this

parameter set is [ARush, BRush, ANoRush, BNoRush] = [1039.2429, 0.01236, 1.09445, 139.1037, 0.0257, 0.97955]. We use this one parameter set across all the conditions

and simulate 100 times just like before. We calculate each run’s Wasserstein dis-

tance of the exit speeds for the experiment and simulation and find the ensemble

average of them. The exit speeds with the lowest Wasserstein distance for each

condition are plotted with dashed lines and ‘x’ markers in Figure 2.8. As we can

see from this figure, having one parameter set across all the conditions does not

produce a desirable fit. This may suggest that the Social Force model requires a

different parameter set per rush and no-rush condition.

2.5 Experiment and Simulation Comparison

We now compare the experiment and simulation results directly. We use instan-

taneous speed, time to exit, and raw trajectories to do so. First, in Figure 2.11, we plot the instantaneous speed in m/s for experiment and simulation. The black

dashed line divides the experimental data from the simulation data. As usual, the

instantaneous speed for the rush is in red lines, and the instantaneous speed for

no-rush is in blue. We plotted each agent’s instantaneous speed in light lines, and

the averages over all agents is plotted in bold. There is a similarity in instantaneous

speeds between the experiment and simulations as the speed rapidly increases in

the first few milliseconds. We see this trend across all the plots. The decrease in Evaluation of the Social Force Model Using Experimental Data 52

Figure 2.11. The instantaneous speeds (m/s) for both experiment (top) and simulation (bottom). The rush agents’ instantaneous speeds are in red, and the no-rush agents’ instantaneous speeds are in blue. The average instantaneous speed is in bold, and the all the instantaneous speeds are in lighter lines. For the simulation plots, The desired speeds for rush (red) and no-rush (blue) are plotted as dashed lines.

speed over time is clearly visible in the experimental plots, as the clogging around

the exit slows the participants down. However, we generally do not see a decrease

in speed for the simulation plots. In fact, for most of the conditions, the speed

goes up slightly towards the end. While plotting the instantaneous speed for the

simulations, notice that the instantaneous speed clumps around the desired speed

(blue or red dashed lines), especially for the 0(100) and 100(0) cases. This indi-

cates that the simulation agents tend to closely replicate their desired speed while

evacuating. Evaluation of the Social Force Model Using Experimental Data 53

10 10

8 8

6 6

4 4 simulations experiments

2 2 time to exit for 18 individuals (s) time to exit for 18 individuals (s) 0 0 0 (100) 25 (75) 50 (50) 75 (25) 100 (0) 0 (100) 25 (75) 50 (50) 75 (25) 100 (0) % rush (% no rush) % rush (% no rush)

Figure 2.12. The time to exit of 18 individuals is plotted in seconds. The left plot is for the experiment, and the right plot is for the simu- lation.

In Figure 2.12, we examine the time that the first 18 agents take to exit the room in seconds. The left plot is for the experiment, and the right plot is for the simu- lation. We only consider the exit time for the first 18 agents in the group, as some agents tend to get stuck at the wall and take extra long to exit or unnecessary extra delay. Few of the participants in the experiment did not actively exit the room, the experimenter suggest that we use about 90% of the data as well. In the exper- imental results in the left figure, there are two bars for 25(75) and 100(0) to reflect the 2 trials that were held for those conditions. However, only the bars on the left should be considered when comparing to the simulations, since we use those ini- tial conditions to initialize the simulations. The error bars on the left plot account for the time to exit for all 100 simulations per condition. We see that the exit speed decreases as the proportion of rush participants increases, which does not support the idea of the “slower is faster” effect. We believe that the “slower is faster” ef- fect cannot not be seen in the experimental result because of the small number of Evaluation of the Social Force Model Using Experimental Data 54

Figure 2.13. The raw trajectories of the agents are plotted. The top plots are for the experiment, and the bottom plots are for the simula- tion. The red lines are the rush agents, and the blue lines are for the no-rush agents.

the participants. On the contrary, we see a different story in the simulation’s time

to exit for 18 agents. The exit speed shows more fluctuations of the time to exit

throughout the conditions. If the model captured the experiment results well, we would expect to see less clogging for the condition of 100(0), but we instead see an

increase in the exit speed. Although the model captures the exit time fairly well,

the simulation result brings up the question of the realism of the model.

In Figure 2.13, we plot the raw trajectories of the agents in the experiment (top)

and the simulation (bottom). The no-rush agents’ paths are in blue, and the rush

agents’ paths are in red. The small dots at the start of the trajectories are the agents’

initial positions. The exit door is located at (-1, 1) and (-1,0). For the experimental Evaluation of the Social Force Model Using Experimental Data 55 plots, the trajectories are relatively straight near the exit compared to the simula- tion plots. We believe that the bends and curves of the trajectories are due to the clogging. The more interesting trajectories are from the simulation. We see that the agents go straight towards the exit, and when they get near it, they start to take unnecessary movements. These unnecessary movements can be seen in all the conditions, and we suspect that this is due to the repulsive force of Equations

2.3 and 2.5. We can tell from the raw trajectories that the simulation agents take unnecessary movements near the exit, unlike the experiment participants.

2.6 No Noise Model vs. Noise Model

In this section, we compare Models 2.1 and 1.1 to see the effects of noise. We now neglect the noise term for the Social Force model. For a fair comparison, the same sets of parameters are used for both models. We also use the same methods and procedures that we use for the noise model to produce the results for the no-noise model.

Comparing Figures 2.8 and 2.14, we do not see a big difference in the results of noise and no-noise models, respectively. In fact, both models’ desired speed

0 0 for rush agents is vRush = 1.0945 and for the no-rush agents is vNoRush = 0.9795. However, we do see that the no-noise model performed more poorly on no-rush of 50(50), and it performs slightly better on no-rush of 75(25). Just like the noise model, we still see the no-noise model favoring lower values of B, and it does not care much for the values of A from Figures 2.15 and 2.16. The conditions 25(75) and

0(100) results were very similar to the noise model. The only difference was that the top 2 best parameter sets were flipped for 25(75), and the top 3 best parameter Evaluation of the Social Force Model Using Experimental Data 56

1.5

1 Exit Speed (m/s)

0.5

Experiment(NoRush) Experiment(Rush) SocialForce(NoRush) SocialForce(Rush) 0 0 (100) 25 (75) 50 (50) 75(25) 100 (0) % Rush ( % No Rush)

Figure 2.14. The exit speed of experiment (darker lines) and simula- tion using the no-noise model (lighter lines). The red lines represent rush, and the blue lines represent no-rush.

sets for 0(100) were the same for both models. In general, we can see that few of

the same parameter sets appear in the top five sets of both models from Table 2.4

and Table 2.5.

As we do not see a big difference between the two models, we cannot make a

case for using one version or the other. One notable difference was the simulation

running time. When running 10 trials for the entire 600 parameter sets, the noise

model would take approximately 2 hours per condition, but the no-noise model would take approximately an hour and 20 minutes. When running the entire sim-

ulation for 10 trials, the no-noise model would take about 2 hours and 40 minutes Evaluation of the Social Force Model Using Experimental Data 57

4000 Rush 0.15 Rush No Rush No Rush 3000 0.1 A 2000 B

0.05 1000

0 0 0 (100) 25 (75) 50 (50) 75(25) 100 (0) 0 (100) 25 (75) 50 (50) 75(25) 100 (0) % Rush ( % No Rush) % Rush ( % No Rush)

Figure 2.15. Top five fits for A (left) and B (right) parameters for all the conditions from the no-noise model simulation. Blue shows the no-rush parameters (ANR in the plot on the left and BNR in the plot on the right) while red shows the rush parameters (AR in the plot on the left and BR in the plot on the right). The solid lines show the values for the best fitted parameters, while the dotted lines show the top four runners up.

less. The reason why we choose to present results from the noise model instead of

the no-noise model is that the main plots, Figures 2.8 and 2.14. The noise model’s

main plot, Figure 2.8, looks slightly better than the no-noise model’s, Figure 2.14.

Although Helbing et al. do not include the noise term in [63], its code default is set

to turn on the noise term as well.

2.7 Discussion

In this chapter, we have analyzed and compared the Social Force model with a

real-life evacuation experiment. Equation 1.1 has been widely used since its debut.

To measure its capability, we compared its results with the experimental results

given the same evacuation environment. Although there were many parameters

in Equation 1.1 to choose to analyze, the agents’ desired velocity, vo, the interaction strength, A, and the characteristic length scale of interaction range, B, appear to be Evaluation of the Social Force Model Using Experimental Data 58

4000 0.15 Rush

3000 0.1 2000 A Rush B Rush 0.05 1000

Rush 0 0 0 (100) 25 (75) 50 (50) 75(25) 100 (0) 0 (100) 25 (75) 50 (50) 75(25) 100 (0) % Rush ( % No Rush) % Rush ( % No Rush) 4000 No Rush 0.15 No Rush

3000 0.1 2000 A No Rush B No Rush 0.05 1000

0 0 0 (100) 25 (75) 50 (50) 75(25) 100 (0) 0 (100) 25 (75) 50 (50) 75(25) 100 (0) % Rush ( % No Rush) % Rush ( % No Rush)

Figure 2.16. (Top Left) The values of parameter A that are within a Wasserstein distance tolerance of 0.28 for all rush conditions from the no-noise model simulation. The best A is in a dark solid red cir- cle, and the rest are in light red squares. (Top Right) The values of parameter B that are within a Wasserstein distance tolerance of 0.28 for all rush conditions from the no-noise model simulation. The best B is plotted as a dark solid red circle. (Bottom Left) The values of parameter A that are within a Wasserstein distance tolerance of 0.28 for all no-rush conditions from the no-noise model simulation. The best value of A is shown as a dark solid blue circle, and the rest are in light blue squares and the rest are in light red squares. (Bottom Right) The values of parameter B that are within a Wasserstein dis- tance tolerance of 0.28 for all no-rush conditions from the no-noise model simulation. The best B is shown as a dark solid blue circle, and the rest are in light blue squares. the most important parameters. Also, the effects of some other parameters, such as the adaptation time τ, had already been explored by others in [81].

We explored a wide range for each parameter and used Latin Hypercube sam- pling to optimize the sample values. We found that the parameter A did not show Evaluation of the Social Force Model Using Experimental Data 59

Conditions WD WD A B A B Rush No- Rush Rush No- No- Rush Rush Rush 100(0) 0.0383 NA 497.2877 0.0120 NA NA 0.0396 NA 1960.1753 0.0127 NA NA 0.0416 NA 596.8615 0.0185 NA NA 0.0423 NA 1735.0502 0.0147 NA NA 0.0437 NA 409.0711 0.0203 NA NA 75(25) 0.3000 0.1134 80.2920 0.0010 250.6851 0.05482 0.3115 0.1189 2975.4024 0.0045 1837.2579 0.0327 0.2865 0.1970 2532.2087 0.0021 2884.5443 0.0264 0.3144 0.1162 1056.9571 0.0011 27.6546 0.0600 0.3100 0.1349 117.1384 0.0042 1976.2609 0.0338 50(50) 0.2227 0.1294 2723.7030 0.0136 3716.4583 0.0014 0.2301 0.1333 1056.9571 0.0011 27.6546 0.0600 0.2851 0.0825 1948.6517 0.0086 .6261 0.0578 0.2752 0.0925 2057.3642 0.0075 1662.8214 0.0113 0.2446 0.1237 1073.3886 0.0074 1251.6853 0.0021 25(75) 0.1939 0.1102 2858.4812 0.0083 3301.12461 0.0019 0.1776 0.1247 1073.3886 0.0074 251.6853 0.0021 0.1823 0.1362 2723.7030 0.0136 3716.4583 0.0014 0.2267 0.1266 2199.6064 0.0064 1741.9421 0.0045 0.2263 0.1424 210.2434 0.0058 3730.4057 0.0059 0(100) NA 0.0530 NA NA 3.3546 0.1095 NA 0.0582 NA NA 8.6261 0.0578 NA 0.0594 NA NA 27.6546 0.0600 NA 0.0705 NA NA 356.6604 0.0202 NA 0.0746 NA NA 1567.8079 0.0179 Table 2.4. Top 5 parameter sets are given for all the rush and no-rush conditions. The Wasserstein distance is abbreviated as ‘WD’ in the table. From top to bottom, the order goes from the best to worst for each row.

any patterns when it came down to the values that yield most fitting against the

experiment results. On the other hand, the parameter B clearly showed that it fa- vors lower values. In the experiment, we could not see the “slower is faster” effect,

especially from the sharp decrease in the exit speed for the 100(0) condition. This is

due to the small number of participants. However, the “slower is faster” effect was Evaluation of the Social Force Model Using Experimental Data 60

Condition rush(no-rush) A and B for No-rush Agents A and B for Rush Agents 0.15 1.5

0.1 1 0(100) B 0.05 0.5

0 0 1000 2000 3000 4000 A

0.15 0.15 1.5 1.5

0.1 0.1 1 1 25(75) B B 0.05 0.5 0.05 0.5

0 0 0 1000 2000 3000 4000 0 1000 2000 3000 4000 A A

0.15 0.15 1.5 1.5

0.1 0.1 1 1 50(50) B B 0.05 0.5 0.05 0.5

0 0 0 1000 2000 3000 4000 0 1000 2000 3000 4000 A A

0.15 0.15 1.5 1.5

0.1 0.1 1 1 75(25) B B 0.05 0.5 0.05 0.5

0 0 0 1000 2000 3000 4000 0 1000 2000 3000 4000 A A

0.15 1.5

0.1 1 100(0) B 0.05 0.5

0 0 1000 2000 3000 4000 A Table 2.5. Results from simulations of parameter sets given by Latin Hypercube Sampling, plotted in parameter space. Here, we plot the Wasserstein distances as a colored circle at the point in param- eter space where it was run. The blue schemes represent lower Wasserstein distance values, whereas the red schemes represent higher values. The best parameter sets are filled with a magenta star, and the next top four parameter sets are filled with a magenta diamond. Since parameter space is four-dimensional, consisting of [ARush, BRush, ANoRush, BNoRush], we look at the Wasserstein Dis- tances projected onto parameter space for the no-rush agents on the left, and projected onto the rush agents on the right. Evaluation of the Social Force Model Using Experimental Data 61

more obvious in the result of the Social Force model as the exit time increased due

to the clogging. This suggests that the Social Force model misses some important

features relevant to the experiment.

Although the results are mostly satisfactory given that the parameter sets are

condition dependent, we still see some faults within the Social Force model. One

of the biggest flaws of this model is that it treats the agents as spheres. It does not

take into consideration of body movements or human psychology during evacua-

tion. We also see the simulation agents making unnecessary movements that we,

the humans, would not normally make. Lastly, we only explore the effects of 6

different parameter values; however, the Social Force model contains many more

parameters than that. We can choose to fit more parameter values, but it is unclear

if this will result in a better fit. The computation cost of this simulation is already

high, and as we add more parameters to fit, the cost will increase even more.

2.8 Future Work

There are many routes to analyze this model further. Although we chose to explore

the parameter sample space using Latin Hypercube sampling, we could also make

this into an inverse problem or even take a Bayesian approach. We can also dif-

ferentiate the parameters that we chose to analyze. We could choose a completely

different set of parameters or an extension of the parameter set by adapting the

model to include more parameters.

Ultimately, we believe that there could be a better pedestrian model that has

more realistic features. When we walk, we have a lot of shoulder movements.

The angle of the shoulders tells different stories too. For example, when we are Evaluation of the Social Force Model Using Experimental Data 62

Figure 2.17. (Left) The Cube located in Virginia Tech. (Right) The rigid-body tracking system and markers.

scared, we tend to bring the shoulders toward the body as we curl up. When we

are trying to get by a narrow or small space, we tend to turn our upper body.

On top of shoulder movements, we believe that the stress levels of pedestrians

are important as well. Referring back to the 5 conditions of the experiment, the

participants should feel a lot more stressed in the case of 100(0) (all rushing out)

than 0(100) (no one rushing out). We think that it would be interesting to see how

the stress levels play into pedestrian dynamics.

To gather these data, we would like to do more and bigger experiments. We

plan on holding experiments at the Cube located at Virginia Polytechnic Institute

and State University (Virginia Tech), see Figure 2.17. The Cube is a 50 ft by 40 ft by

32 ft multi-floored theater that has 24 cameras and 128 speakers around the facility

[4]. The Cube’s cameras have a rigid-body tracking system, see the right side of

Figure 2.17. This will allow us to track participants’ trajectories, time to exit, and

any body movements. We performed a preliminary experiment in September 2018, which included playing tag among the participants and exiting the arena with 3

different door sizes (narrow, medium, and wide) while measuring the participants’ Evaluation of the Social Force Model Using Experimental Data 63

stress levels. We had them play tag while exiting is to see the different stress levels:

they should experience more stress while playing tag than calmly exiting the arena.

We would like to expand this preliminary experiment to gather data for our next

step. When the analysis of the new experimental data is done, we would like to

build an upgraded pedestrian dynamic model. 64

3 Examining the Effects of Parame- ter Scaling in a Model for Collective Motion

In this chapter, we numerically explore what happens to the collective dynam- ics when the number of particles in an interacting particle model changes. In Sec- tion 3.2, we discuss the proposed scaling by Barbaro et al., we describe the Vicsek model, and we introduce the metric we use for the system alignment. In Section

3.3, we introduce one of our experiment conditions. We scale the parameters in

Section 3.4 and discuss the results in Section 3.5. We discuss a variation of the

Vicsek model, following the model of Barbaro et al., in Section 3.6. In Section 3.7, we introduce our other experimental conditions. Finally, we perform a statistical analysis of the results for these experimental conditions in Section 3.8.

3.1 Motivation

In the work of Barbaro et al. [23], the authors successfully capture the migration route of Icelandic capelin, a pelagic fish, in the year 2008 as well as two previous years. In this particular simulation of their interacting particle model, they used roughly 50,000 particles to represent 50 billion fish. Each particle is considered Examining the Effects of Parameter Scaling in a Model for Collective Motion 65

to be a superindividual where one particle presents about one million fish. The

question that comes up naturally after a successful prediction using the superindi- vidual particles is whether the system will yield the same result as the number

of particles is increased to have each particle represent fewer fish. It is important

see whether it is possible to have the system perform the same as we decrease the

number of fish per particle. Eventually, the goal would be to have one particle

representing one fish, if possible.

3.2 The Proposed Scaling

We revisit the proposed scaling of Barbaro et al. from Subsection 1.3.6. Let F be the

actual number of fish in a migration, N be the number of particles in a simulation,

D be the size of the domain, R to be the radius of interaction, and let index i refer to the ith simulation. The number of fish within a given area can be denoted by Mi, the number of neighbors per particle. The number of fish within a circle of radius

Ri is given by   2 ! # Real Fish F D/πRi = (Mi) . Size of domain Ni D

Using this equation, and holding Mi as a constant across simulations, derive the relationship equation between two simulations, indexed by 0 and 1, as

2 2 R0N0 R1 = , N1 s N0 R1 = R0 . N1 This implies that 1 R ∝ √ . N Examining the Effects of Parameter Scaling in a Model for Collective Motion 66

Furthermore, let v be the velocity, and c be the speed. They require

v∆t = cR to ensure the portion of the zone traversed per time step remains constant. Barbaro et al. posit that the two parameters, v and c, should also remains constant as they change the number of particles, N. Hence, they get the proposed scaling that we are investigating, 1 ∆t ∝ R ∝ √ . N See Subsection 1.3.2 for a detailed derivation.

Equation 1.20 suggests that the time step ∆t is proportional to the radius of the interaction R, and the radius is proportional to √1 , where N is the number of N particles. We test this proposed scaling by using the Vicsek model (Equations 1.7,

1.9, and 1.8). Recall that the direction, orientation, and position of an nth particle of the Vicsek model is updated by

θn(t + ∆t) = < θ(t) >r + η,   cos(θ (t + ∆t))  n  un(t + ∆t) =   , and sin(θn(t + ∆t))

xn(t + ∆t) = xn(t) + cun(t + ∆t)∆t, respectively. We let the speed c = 1 for all the simulations for simplicity. We use the global polarity (Equation 1.10)

1 N GV(t) = k ∑ uj(t)k, N j=1 Examining the Effects of Parameter Scaling in a Model for Collective Motion 67

and local polarity (Equation 1.11)

1 N 1 LV(t) = ∑ k`j(t)k, `j(t) = ∑ ui(t), N j=1 Nj i∼j to measure whether the system is performing the same as we vary the number of particles. To see a detailed explanation of the Vicsek model, global polarity, and local polarity, see Subsection 1.3.2. As a reminder, the global and local polarities measure the alignment for the system at the overall and local levels, respectively.

We also introduce another measurement called the fixed local polarity,

1 N 1 FV(t) = ∑ k`j(t)k, `j(t) = ∑ ui(t), (3.1) N j=1 Nj i∼j where i ∼ j means the set of i ∈ {1, 2, ··· , N}\{j} such that kxi(t) − xj(t)k ≤

RFixed and Nj is the number of the set i for particle j. The fixed local polarity is very similar to the local polarity. The difference is that we fix the radius, RFixed, across all N to measure the alignment of particles within a neighborhood of fixed size. All the polarities take on values in the interval [0 1], where 1 means that the particles are perfectly aligned, and 0 means that the orientation of the particles cancel each other. We compare the global, local, and fixed local polarities from the scaled and non-scaled parameters to see whether scaling preserves the system behavior.

3.3 Introduction of the Numerical Experiment

The easiest way to see a disturbance in the global, local, and fixed local polarities is when the particles collide with each other. When they collide, the alignment between the particles gets distorted, causing the polarities to react accordingly.

Therefore, to explore the effects of scaling on the behavior of the system, we pur- posely let two schools collide. Examining the Effects of Parameter Scaling in a Model for Collective Motion 68

20 20

15 15

10 t = 0 10 t = 5

5 5

0 0 0 5 10 15 0 5 10 15 20 20

15 15

10 t = 7 10 t = 9

5 5

0 0 0 5 10 15 0 5 10 15 20 20

15 15

10 t = 11 10 t = 20

5 5

0 0 0 5 10 15 0 5 10 15

Figure 3.1. The progression of the collision is demonstrated at var- ious time steps including the start (top left) and the finish (bottom right) of the simulation. From top to bottom, left to right, the time steps shown are t = 0, 5, 7, 9, 11, 20. The number of particles are 8,000.

Consider a rectangular 0 ≤ x ≤ 15, 0 ≤ y ≤ 20 system. We initialize the particles into two schools located in the upper left and right corners. Each school has a width of 3 and a height of 1. We randomly place the first half of the particles Examining the Effects of Parameter Scaling in a Model for Collective Motion 69

in a school located at the upper left-hand corner of a system using the Uniform

distribution. We do the same to the second half of the particles and place them at

a school located at the upper right-hand corner. We initialize every particle in the

7π left school to have the angle of θ = 4 , and every particle in the right school to 5π have the initial angle of θ = 4 ; See Figure 3.1 for the visualization of the collision for N = 8000. Starting from the upper left plot and going from left to right and top to bottom, we show the simulation at various t. The upper left plot is when t = 0,

and the bottom right plot is the last step, t = 20, of the simulation. The schools

start coming at their given initial angles, and they eventually collide and merge as

t increases. From t = 11 and on, the merged school travels straight down until the end of the simulation, t = 20. The codes that are used in this study can be found

at http://doi.org/10.17605/OSF.IO/R37ST.

Given the initial setting, we use the Vicsek model, Equations 1.7, 1.9, and 1.8, to update the position, orientation, and angle for the time interval 0 ≤ t ≤ 20. We

turn off any small noise, η, added to the angle for the precise measurement of the

global, local, and fixed local polarities. We let c = 1 for all simulations.

3.4 Scaling of R and ∆t

To see if the proposed scaling works, we compare the simulation results of the scaled and non-scaled parameter of the Vicsek model. The parameters that we are scaling is the radius, R, and the time step, ∆t. We directly follow Equation 1.19, s N0 R1 = R0 , N1 Examining the Effects of Parameter Scaling in a Model for Collective Motion 70

to scale the radius, R. As a reminder, the subscript i = 0 means the current simu-

lation, and i = 1 means the new simulation. We also employ the same equation to

scale the time step, ∆t, by s N0 ∆t1 = ∆t0 . N1 For the simplicity, we choose the number of particles, N, to be N = 2000 ∗ 2i for

i = 0, 1, ··· , 8. In another word, we start from N = 2000 and double the number

of particles until we get to N = 64000. In the following Table 3.1, we display the

scaled R and ∆t for each N.

N R ∆t 2000 0.5 0.01 4000 0.3536 0.07 8000 0.25 0.005 16000 0.1768 0.00354 32000 0.125 0.0025 64000 0.0884 0.00177 Table 3.1. The scaled parameters using Equation 1.19. The first col- umn is the number of particles, the second column is the radius, and the last column is the time step.

In Table 3.1, we pick the parameter set of N = 32000 to be the reference set.

We obtain the values of the reference set from the capelin migration model [23].

We also use the reference set for the non-scaled parameter cases. For the non- scaled parameter cases, we use the same number of particles, N, as of the scaled

parameter cases. However, we do not change the parameter values of R and ∆t

as we vary N. In other words, we let R = 0.125 and ∆t = 0.0025 for all N in the

non-scaled parameter cases. Regardless of the scaling, we let RFixed = 0.55 for all N. Examining the Effects of Parameter Scaling in a Model for Collective Motion 71

3.5 The Result of the Scaled and Non-Scaled Parameters

3.5.1 The Non-scaled Case

We first discuss the result of the non-scaled parameter cases. As a reminder, we

use R = 0.125, Rfixed = 0.55, and ∆t = 0.0025 across all N. In Figure 3.2, from left to right, we display the global and local polarities on the top row, the fixed local

polarity and the average number of neighbors on the middle row, and the width

of school on the bottom row. For the rest of this chapter, we present this same

type of figure for different cases. We calculate each polarity at every t. We can see

that the schools collide around t = 6, as the polarities get disrupted. The schools merge between 6 ≤ t ≤ 10, and they stabilize again after t = 10. We see that all polarities from the different number of particles are very similar to one another as they overlap in the plots. In Table 3.2, we show the polarity differences between one N to another. For example, (1,1) of the table is the polarity differences between

N = 2000 and 4000. We list the absolute average differences of the global, local, and fixed local polarity, respectively, per cell. We find every possible combination of varying N, and we calculate the difference at each t per polarity. We, then, find the average of these differences to find the average polarity difference between the different numbers of particles. We see that the average differences of the local polarity are the smallest out of all the polarities. We also see that the differences between any N are rather similar. In general, the polarity differences between varying N are minimal.

We also calculate the average number of neighbors within the radius, R =

0.125, to see how many neighbors fall into the neighborhood (R) on an average for Examining the Effects of Parameter Scaling in a Model for Collective Motion 72

1 1 N=2 N=2 N=4 N=4 0.95 N=8 N=8 N=16 N=16 0.9 N=32 0.9995 N=32 N=64 N=64 0.85

0.8 Local Polarity 0.999 Global Polarity

0.75

0.7 0.9985 0 5 10 15 20 0 5 10 15 20 t t 1 1500 N=2 N=2 N=4 N=4 0.995 N=8 N=8 N=16 N=16 N=32 1000 N=32 0.99 N=64 N=64

0.985 500

Fixed Local Polarity 0.98 Average Number of Neighbors 0.975 0 0 5 10 15 20 0 5 10 15 20 t t 2.5 N=2 N=4 2.4 N=8 N=16 N=32 2.3 N=64

2.2 School Width

2.1

2 0 10 20 30 40 50 60 N

Figure 3.2. We plot the various results of the Vicsek model’s nu- merical experiment using the non-scaled parameters. (Top Row) The global polarity is plotted on the left against the time, t, for all N. The local polarity is plotted on the right against the time, t, for all N. (Middle Row) The fixed local polarity is plotted on the left against the time, t, for all N. The average neighbors is plotted on the right against the number of particles, N. (Bottom Row) The width of school is plotted against the number of particles, N. The unit of the number of particles, N, is in thousands. Examining the Effects of Parameter Scaling in a Model for Collective Motion 73

N 2000 4000 8000 16000 32000 4000 4.0904e-04 4.5224e-06 - - - - 1.1065e-04 8000 6.7905e-04 2.7165e-04 6.3383e-06 2.6020e-06 - - - 1.6793e-04 6.0423e-05 16000 4.6960e-04 9.2085e-05 2.3021e-04 6.8209e-06 2.4179e-06 2.2239e-06 - - 1.7024e-04 6.2343e-05 4.4129e-05 32000 3.8736e-04 1.0541e-04 3.1227e-04 8.3955e-05 5.2836e-06 2.1443e-06 3.2139e-06 1.8458e-06 - 1.6951e-04 6.2577e-05 5.1607e-05 1.3119e-05 64000 3.8870e-04 1.2744e-04 3.0949e-04 8.8219e-05 2.7846e-05 5.6866e-06 2.1791e-06 3.1592e-06 1.9005e-06 5.1244e-07 1.7771e-04 7.0642e-05 5.2179e-05 1.8577e-05 1.0642e-05 Table 3.2. The average difference of the global, local, and fixed local polarities of the non-scaled parameters cases between the varying number of particles. For each cell, the first element is the difference of the global polarities between the two Ns, the second element is the difference of the local polarities, and the last element is the difference of the fixed local polarities.

all particles. As the number of particles increases, the average number of neigh-

bors also increases. It is expected for the average neighbors to go up as we fix the

size of the radius yet increase the number of particles. We examine the width of

merged schools as well. The width is calculated at t = 20, which gives the school

enough time to merged and stabilize. In the most bottom plot of Figure 3.2, the width does not vary much from one N to another, as it remains between the width

of 2.1 and 2.15. These results suggest that the system behaves similarly and pre-

serves behavior as we vary N without scaling of the parameters. Examining the Effects of Parameter Scaling in a Model for Collective Motion 74

1 1 N=2 N=2 N=4 N=4 0.95 N=8 N=8 N=16 0.998 N=16 0.9 N=32 N=32 N=64 N=64 0.85 0.996

0.8 Local Polarity Global Polarity 0.994 0.75

0.7 0.992 0 5 10 15 20 0 5 10 15 20 t t 1 1000 N=2 N=2 N=4 N=4 0.995 N=8 N=8 N=16 800 N=16 N=32 N=32 0.99 N=64 N=64 600 0.985

400 Fixed Local Polarity 0.98 Average Number of Neighbors 0.975 200 0 5 10 15 20 0 5 10 15 20 t t 4 N=2 N=4 3.5 N=8 N=16 3 N=32 N=64 2.5

2 School Width

1.5

1 0 10 20 30 40 50 60 N

Figure 3.3. We plot the various results of the Vicsek model’s numer- ical experiment using the scaled parameters. (Top Row) The global polarity is plotted on the left against the time, t, for all N. The local polarity is plotted on the right against the time, t, for all N. (Middle Row) The fixed local polarity is plotted on the left against the time, t, for all N. The average neighbors is plotted on the right against the number of particles, N. (Bottom Row) The width of school is plot- ted against the number of particles, N. The unit of the number of particles, N, is in thousands. Examining the Effects of Parameter Scaling in a Model for Collective Motion 75

3.5.2 The Scaled Case

We, now, examine the scaled parameter cases. As a reminder, we use the param-

eter values from Table 3.1. In Figure 3.3, from left to right, we display the global

and local polarities on the top row, the fixed local polarity and the average number

of neighbors on the middle row, and the width of school on the bottom row. Since

t = 0, 1, ··· , 20 is not necessarily divisible by every scaled ∆t, we calculate the po-

larities as close as we can get to t. We, then, use linear interpolation to approximate

the values at t = 0, 1, . . . , 20. Looking at the plots, the schools collide around t = 6 and finish merging and stabilizing around t = 10 like the non-scaled parameter cases. However, unlike them, the polarities no longer overlap each other. In the plot of the global polarity (first row, left), the system takes longer to align as the number of particles grows. In the plot of local polarity (first row, right), the av- erage local alignment increases as the number of particles also increases. On the other hand, the fixed local polarity (middle row, left) decreases as the number of the particles increases. The average number of neighbors (middle row, right) starts closer to one another than the non-scaled parameter cases, but the number grows significantly as N increases. For the width of merged school (bottom row), the school gets skinnier as N grows. These results suggest that scaling the parameters does not preserve the system behavior as we vary N.

We also look at the average absolute difference of the polarities of the scaled- parameter cases in Table 3.3. We, again, list the absolute average difference of the global, local, and fixed local polarity, respectively. We see the effects of scaling as the global polarity’s average differences are roughly 0.002 away from the next im- mediate N as we go down the columns. The average difference of local polarity Examining the Effects of Parameter Scaling in a Model for Collective Motion 76

N 2000 4000 8000 16000 32000 4000 0.0022 0.0001 - - - - 0.0002 8000 0.0041 0.0019 0.0002 0.0001 - - - 0.0004 0.0002 16000 0.0069 0.0047 0.0028 0.0003 0.0001 0.0001 - - 0.0007 0.0005 0.0003 32000 0.0089 0.0067 0.0048 0.0020 0.0003 0.0002 0.0001 0.0000 - 0.0010 0.0008 0.0006 0.0003 64000 0.0114 0.0092 0.0073 0.0045 0.0025 0.0003 0.0002 0.0001 0.0001 0.0000 0.0014 0.0012 0.0010 0.0007 0.0004 Table 3.3. The average difference of the global, local, and fixed local polarities of the scaled parameters cases between the varying num- ber of particles. For each cell, the first element is the difference of the global polarities between the two Ns, the second element is the difference of the local polarities, and the last element is the difference of the fixed local polarities.

increases as N increases within a column. However, the local polarity again re- mains the lowest polarity out of the three. The case for the average difference of the fixed local polarity shows similar results although we do not scale RFixed. For each column going top to bottom, we see that the average differences of the fixed

local polarity increase as N increases within a column as well. Comparing Tables

3.2 and 3.3, the differences in the non-scaled parameter cases are much smaller

than the scaled parameter cases. This confirms that the scaling parameters of the

Vicsek model does not preserve the system behavior as we change the number of

particles. Examining the Effects of Parameter Scaling in a Model for Collective Motion 77

3.6 Implementing the Zone of Repulsion

As we see that the scaling does not preserve the system behavior of the Vicsek

model, we add in the zone of repulsion from the work of Barbaro et al. to the

Vicsek model to see if scaling will behave differently with the zone of repulsion

implemented. In Subsection 1.3.2, we discuss in detail the three different zones

that the capelin migration model has. Here, we add the zone of repulsion to the

Vicsek model. This will allow the particles to avoid collisions with their neighbors

in this zone. Recall that the Vicsek model updates its direction, θ, by taking the

arctan of the average velocity within the radius of the neighborhood. This radius

of the neighborhood is equivalent to the radius for the zone of orientation, or RO.

Note that we do not add the zone of attraction to the model as it is not the focus of

this study. In Equations 3.2 and 3.3, we display the updated orientation with the

zone of repulsion.

  cos(θ (t + ∆t))  k  dk(t + ∆t)   = , (3.2) kdk(t + ∆t)k sin(θk(t + ∆t)) where    − cos(θk(t)) 1  qk(t) qr(t)   dk(t + ∆t) =  ∑ + ∑   . (3.3) |Rk| + |Ok| ∈ kqk(t) − qr(t)k ∈ r Rk o Ok sin(θk(t))

Here, Rk is the zone of repulsion, and |Rk| is the number of particles within the zone of repulsion of particle k; Ok is the zone of orientation, and |Ok| is the number

of particles within the zone of orientation of particle k; qk is the position of the kth

particle; and θk is the direction of the kth particle. Examining the Effects of Parameter Scaling in a Model for Collective Motion 78

3.6.1 The Results of the Numerical Experiment

We use the same set up of Section 3.3 to measure the global, local, and fixed local

polarities. We also use the same sets of scaled and non-scaled parameters from

Table 3.1, and we introduce the new parameter the radius of repulsion, Rr, in Table

3.4 along with the radius of orientation, RO, and time step, ∆t. Note that RO from

Table 3.4 and R from Table 3.1 are the same; we assign it a new name as we intro-

RO duce another radius. Notice that Rr = 10 . We use the same scheme from the work of Barbaro et al. to determine Rr.

N RO Rr ∆t 2000 0.5 0.05 0.01 4000 0.3536 0.03536 0.07 8000 0.25 0.025 0.005 16000 0.1768 0.01768 0.00354 32000 0.125 0.0125 0.0025 64000 0.0884 0.00884 0.00177 Table 3.4. The scaled parameters using Equation 1.19. The first col- umn is the number of particles, the second column is the radius for the zone of orientation, the third column is the radius for the zone of repulsion, and the last column is the time step.

For the cases with repulsion, we decrease the width of the system to 0 ≤ x ≤ 10,

as the schools do not collide if the original dimensions are kept. However, we still

5π 7π initialize the same conditions including the same initial angles, θ = 4 and 4 . We discuss the result of the scaled parameter cases first. From Figure 3.4, although the schools collide and merge, they “melt” away rather than staying in the merged form as we have seen in Figure 3.3. For this reason, the measured polarities are not as nice as of the non-repulsion cases. In Figure 3.5, we plot the global, local, and

fixed local polarities. Since the schools “melt” after they collide, we see the effects Examining the Effects of Parameter Scaling in a Model for Collective Motion 79

Figure 3.4. The progression of the two school collision is demon- strated at various time steps of the simulation for N = 32000. From top to bottom, left to right, the time steps shown are t = 2, 4, 5, 8, 14, and 20.

of that in the plots where the polarities decrease after the collision impact or are

unstable as t increases.

The non-scaled parameter cases also show different behavior with repulsion.

We again use the parameter set of N = 32000 as a reference set for the non-scaled

parameter cases. In Figure 3.6, we plot the simulation of N = 8000 at t = 0, 5, 8, 20.

Notice that although we start the simulation the same way as Figure 3.1, both

schools travel up. This can be also seen when N = 4000 and 16000. Since the Examining the Effects of Parameter Scaling in a Model for Collective Motion 80

1 1 N=2 N=2 0.9 N=4 N=4 N=8 N=8 0.8 N=16 0.998 N=16 N=32 N=32 N=64 0.7 N=64 0.996 0.6 Local Polarity Global Polarity 0.5 0.994 0.4

0.3 0.992 0 5 10 15 20 0 5 10 15 20 t t 1 600 N=2 N=2 N=4 N=4 0.995 N=8 500 N=8 N=16 N=16 0.99 N=32 N=32 N=64 400 N=64 0.985 300 0.98

Fixed Local Polarity 200 0.975 Average Number of Neighbors 0.97 100 0 5 10 15 20 0 5 10 15 20 t t Figure 3.5. We plot the various results of the Vicsek model’s numer- ical experiment using the scaled parameters with repulsion. (Top Row) The global polarity is plotted on the left against the time, t, for all N. The local polarity is plotted on the right against the time, t, for all N. (Middle Row) The fixed local polarity is plotted on the left against the time, t, for all N. The average neighbors is plotted on the right against the number of particles, N. The unit of the number of particles, N, is in thousands. schools do not collide, we impose a new reference set to be the parameter set of

N = 2000. We let RO = 0.5, Rr = 0.05, and ∆t = 0.01.

From Figures 3.7 and 3.8, we see similar results from the simulation and the polarities as the non-scaled parameters without repulsion. In Figure 3.7, we can see the repulsion in its full effect. The two schools never fully merge as seen by the visible gap between the two. The particles in the inner edges of the schools are constantly repelling each other. The polarities from Figure 3.8 overlap each other, Examining the Effects of Parameter Scaling in a Model for Collective Motion 81

25 25

20 20

15 15 t = 0 t = 5 10 10

5 5

0 0 0 5 10 0 5 10 25 30 20 25

15 20 t = 8 15 t = 20 10 10 5 5

0 0 0 5 10 15 0 10 20

Figure 3.6. The progression of the two school collision is demon- strated at t = 0, 5, 8, 20 using the values of the reference parameter set, RO = 0.125, Rr = 0.0125, and ∆t = 0.0025.

suggesting that the system behaves similarly to one another. However, we can not

conclude whether scaling works or not in these cases. The original reference set

of N = 32000 makes the non-scaled parameter cases behave completely out of the ordinary, and we force the radii, RO and Rr, to be big enough to let the schools

collide. Having big radii for the bigger N is not ideal as the average number of

neighbors exponentially grows. In the case of N = 64000, we have seen that the Examining the Effects of Parameter Scaling in a Model for Collective Motion 82

20 20

15 15

10 t = 0 10 t = 2

5 5

0 0 0 5 10 0 5 10 20 20

15 15

10 t = 3 10 t = 4

5 5

0 0 0 5 10 0 5 10 20 20

15 15

10 t = 9 10 t = 20

5 5

0 0 0 5 10 0 5 10

Figure 3.7. The progression of the two school collision is demon- strated at t = 0, 2, 3, 4, 9, 20 using the new parameter values of RO = 0.5, Rr = 0.05, and ∆t = 0.01. Examining the Effects of Parameter Scaling in a Model for Collective Motion 83

1 1 N=2 N=2 0.95 N=4 N=4 N=8 N=8 0.998 0.9 N=16 N=16 N=32 N=32 N=64 N=64 0.85 0.996 0.8 Local Polarity Global Polarity 0.75 0.994 0.7

0.65 0.992 0 5 10 15 20 0 5 10 15 20 t t 1 12000 N=2 N=2 N=4 N=4 10000 0.998 N=8 N=8 N=16 N=16 N=32 8000 N=32 0.996 N=64 N=64 6000 0.994 4000

Fixed Local Polarity 0.992 2000 Average Number of Neighbors 0.99 0 0 5 10 15 20 0 5 10 15 20 t t Figure 3.8. We plot the various results of the Vicsek model’s numeri- cal experiment using the non-scaled parameters with repulsion. (Top Row) The global polarity is plotted on the left against the time, t, for all N. The local polarity is plotted on the right against the time, t, for all N. (Middle Row) The fixed local polarity is plotted on the left against the time, t, for all N. The average neighbors is plotted on the right against the number of particles, N. The unit of the number of particles, N, is in thousands. average number of neighbors within RO to be around 250 to 1500 from Figures

3.2, 3.3, and 3.5. However, in Figure 3.8, we see the average neighbors range from around 6,000 to 10,000. For this reason, we introduce another set up of the numer- ical experiment in the next section to better measure the polarities.

The reason behind the melting and schools traveling up shown in Figures 3.4 and 3.6 is that the particles have too few neighbors in RO. In the case of the non- scaled parameter with repulsion of N = 4000, there are 563 particles that have 1 Examining the Effects of Parameter Scaling in a Model for Collective Motion 84

to 3 neighbors in the zone of repulsion. Out of these particles, 281 particles are in

the left school, and 54 of them have less than 10 neighbors in RO. This is about

19.2% of the particles with the neighbors in Rr for the left school. Now, recall that

the schools of the scaled parameters of N = 4000 that behave normally. For this

case, there are 2,559 particles that have 1 to 7 neighbors in the zone of repulsion.

Out of these particles, 1274 particles are in the left school, and only 11 of them

have less than 10 neighbors in the RO. This is about 0.86% of the particles with the

neighbors in Rr for the left school. When we let RO = 0.5 and Rr = 0.05 to get

the schools to collide for the case of non-scaled parameters for N = 4000, there are

3,212 particles that have 1 to 12 neighbors within Rr. Out of these, 1,599 particles

are in the left school, and only 8 of them have less than 10 neighbors within RO.

This is about 0.5% of the particles with the neighbors in Rr for the left school. This

indicates that as there are too few neighbors in the zone of orientation to average

out the orientation of the particle in question. If few particles start to repulse away

from their neighbors in the zone of repulsion, the neighboring particles in the zone

of orientation will also start to head in another direction due to the small size. The

ripple effect happens as the particles update their direction by taking the average

direction of their neighbors within the zone of orientation.

3.7 Different Types of Collision

As we have seen that the two schools colliding with repulsion can produce unin-

tended behavior, we introduce different collision conditions. We shrink the system

dimension to be a square 0 ≤ x, y ≤ 5 and randomly place the particles in the Examining the Effects of Parameter Scaling in a Model for Collective Motion 85

5 5

4 4

3 3 t = 0 t = 0.1 2 2

1 1

0 0 0 1 2 3 4 5 0 1 2 3 4 5 5 5

4 4

3 3 t = 0.4 t = 0.6 2 2

1 1

0 0 0 1 2 3 4 5 0 1 2 3 4 5 5 5

4 4

3 3 t = 1 t = 20 2 2

1 1

0 0 0 1 2 3 4 5 0 1 2 3 4 5

Figure 3.9. The set up of collision for N = 4000 is on the left most upper corner. From left to right and top to bottom, the progression of simulation is plotted at t = 0, 0.1, 0.4, 0.6, 1, 20. After t = 1, the system stabilizes and looks like when t = 20 by the time t = 1.5. Examining the Effects of Parameter Scaling in a Model for Collective Motion 86

square using the uniform distribution. If the particles are placed in the first quad-

5π rant, we let the initial angle to be θ = 4 . If they are placed in the second quadrant, 7π π we let θ = 4 . The particles in the third quadrant have the initial angle of θ = 4 , 3π and the particles in the fourth quadrant have the initial angle of θ = 4 . (See Fig- ure 3.9 for the visualization of the conditions.) We purposely set the initial angles

in a way that the particles will collide with one another as t increases. We also implement periodic boundary conditions in this system.

3.7.1 The Results of Collisions

We run four different simulations. We test the Vicsek model with the scaled and non-scaled parameter sets without repulsion under the new collision set up. We also test the Vicsek model with the scaled and non-scaled parameter sets with re- pulsion. We use the same scaled parameter sets as Tables 3.1 and 3.4 including

RFixed, and we, again, let the reference set to be the parameter set of N = 32000 regardless of the repulsion.

Non-scaled Without Repulsion. We first discuss the results of the Vicsek model

of the non-scaled parameters without repulsion. In Figure 3.10, we plot the polar-

ities and the average number of neighbors. We can see that the polarities differ as we vary N for all. Although the dips in the curves of the Local and Fixed Local polarities happen around the same time, we can still conclude that the system does not preserve its behavior between the different N. The average number of neigh-

bors has different initial values for all N. This makes sense since RO is fixed for all

N, and more particles will be inside of the zone of orientation as we increase N.

As expected, the average neighbors increases as N increases. In Table 3.5, we list Examining the Effects of Parameter Scaling in a Model for Collective Motion 87

1 1 N=2 N=2 N=4 0.995 N=4 0.8 N=8 N=8 N=16 0.99 N=16 N=32 N=32 0.6 N=64 N=64 0.985

0.4 0.98 Local Polarity Global Polarity 0.975 0.2 0.97

0 0.965 0 5 10 15 20 0 5 10 15 20 t t 1 400 N=2 N=2 N=4 N=4 N=8 N=8 N=16 300 N=16 0.95 N=32 N=32 N=64 N=64 200

0.9 100 Fixed Local Polarity Average Number of Neighbors 0.85 0 0 5 10 15 20 0 5 10 15 20 t t Figure 3.10. We plot the various results of the Vicsek model’s numer- ical experiment using the non-scaled parameters without repulsion. (Top Row) The global polarity is plotted on the left against the time, t, for all N. The local polarity is plotted on the right against the time, t, for all N. (Middle Row) The fixed local polarity is plotted on the left against the time, t, for all N. The average neighbors is plotted on the right against the number of particles, N. The unit of the number of particles, N, is in thousands. the absolute average difference of the global, local, and fixed local polarity, respec- tively. The differences between the global polarities are rather random compared to the results of another collision version in Tables 3.2 and 3.3. We also saw the local and fixed local polarities increase as we go down each column in these tables as well. However, we no longer see that scheme with the non-scaled parameter cases without repulsion. This may be explained by the clumping of the different

N seen in the global polarity. We see that N = 2000, 4000, and 16000 are grouped Examining the Effects of Parameter Scaling in a Model for Collective Motion 88

together, and N = 8000, 32000, and 64000 also grouped together in the beginning.

We do not know why this clumping happens, but this can be verified by looking

at the average differences in Table 3.5; the differences within these two groups are

much lower than the differences between the members of the two groups. N 2000 4000 8000 16000 32000 4000 0.0094 0.0001 - - - - 0.0017 8000 0.0334 0.0364 0.0003 0.0002 - - - 0.0029 0.0041 16000 0.0122 0.0055 0.0411 0.0002 0.0001 0.0002 - - 0.0019 0.0008 0.0046 32000 0.0258 0.0290 0.0111 0.0338 0.0003 0.0003 0.0001 0.0002 - 0.0018 0.0031 0.0012 0.0035 64000 0.0387 0.0429 0.0114 0.0474 0.0178 0.0004 0.0003 0.0001 0.0003 0.0001 0.0030 0.0043 0.0014 0.0047 0.0016 Table 3.5. The average difference of the global, local, and fixed lo- cal polarities of the non-scaled parameters without repulsion cases between the varying number of particles. For each cell, the first el- ement is the difference of the global polarities between the two Ns, the second element is the difference of the local polarities, and the last element is the difference of the fixed local polarities.

Scaled Without Repulsion. In Figure 3.10, we plot the polarities and the average

number of neighbors for the scaled parameter cases without repulsion. We can

again visually tell that the system does not preserve its behavior as N increases

as well. Comparing the figures of the non-scaled parameter cases without repul-

sion, we see that these cases have much smoother curves. Unlike the non-scaled

parameter cases, the average number of neighbors starts around the same for all

N. However as t increases, the average number of neighbors also increases. The Examining the Effects of Parameter Scaling in a Model for Collective Motion 89

1 1 N=2 N=2 N=4 N=4 0.8 N=8 N=8 N=16 N=16 N=32 0.95 N=32 0.6 N=64 N=64

0.4

Local Polarity 0.9 Global Polarity 0.2

0 0.85 0 5 10 15 20 0 5 10 15 20 t t 1 300 N=2 N=2 N=4 N=4 N=8 250 N=8 N=16 N=16 0.95 N=32 N=32 N=64 200 N=64

150 0.9

Fixed Local Polarity 100

0.85 Average Number of Neighbors 50 0 5 10 15 20 0 5 10 15 20 t t Figure 3.11. We plot the various results of the Vicsek model’s numer- ical experiment using the scaled parameters without repulsion. (Top Row) The global polarity is plotted on the left against the time, t, for all N. The local polarity is plotted on the right against the time, t, for all N. (Middle Row) The fixed local polarity is plotted on the left against the time, t, for all N. The average neighbors is plotted on the right against the number of particles, N. The unit of the number of particles, N, is in thousands.

local polarity stabilizes faster than the case of non-scaled parameters. The non- scaled parameter cases stabilize around t = 5, whereas these cases stabilize be- fore t = 2.5. We also see clumping of the different N in the global and fixed lo- cal polarities. We see that N = 2000, 4000, and 8000 are grouped together, and

N = 16000, 32000, and 64000 also form a different group. This again can be con-

firmed by the average absolute difference of the polarities in Table 3.6. We see a Examining the Effects of Parameter Scaling in a Model for Collective Motion 90

bigger difference between the members of the two groups compared to the differ-

ences within the group members. N 2000 4000 8000 16000 32000 4000 0.0022 0.0011 - - - - 0.0003 8000 0.0033 0.0040 0.0017 0.0005 - - - 0.0004 0.0004 16000 0.0292 0.0297 0.0260 0.0023 0.0012 0.0007 - - 0.0040 0.0041 0.0037 32000 0.0195 0.0199 0.0163 0.0099 0.0023 0.0011 0.0006 0.0005 - 0.0034 0.0034 0.0030 0.0010 64000 0.0194 0.0201 0.0162 0.0103 0.0028 0.0023 0.0012 0.0007 0.0007 0.0002 0.0034 0.0035 0.0031 0.0011 0.0009 Table 3.6. The average difference of the global, local, and fixed local polarities of the scaled parameters without repulsion cases between the varying number of particles. For each cell, the first element is the difference of the global polarities between the two Ns, the second element is the difference of the local polarities, and the last element is the difference of the fixed local polarities.

Non-scaled With Repulsion. We, now, look into the results of the cases with re-

pulsion. For the non-scaled parameter cases with repulsion, we see that the two

biggest number of particles, N = 32000 and 64000, deviate away from the rest for

all polarities in Figure 3.12. Between those two, they start out about the same as

they overlap, but N = 32000 deviates further away. The average number of neigh-

bors is similar to the case of non-scaled parameters without repulsion. They start with a different initial amount of average neighbors as we fix RO across all N and

grow the neighbors until the system stabilizes. In Table 3.7, we list the average ab-

solute differences of the polarities. We see that the differences between N = 32000 Examining the Effects of Parameter Scaling in a Model for Collective Motion 91

1 1 N=2 N=2 N=4 0.995 N=4 0.8 N=8 N=8 N=16 0.99 N=16 N=32 N=32 0.6 N=64 N=64 0.985

0.4 0.98 Local Polarity Global Polarity 0.975 0.2 0.97

0 0.965 0 5 10 15 20 0 5 10 15 20 t t 1 350 N=2 N=2 N=4 300 N=4 N=8 N=8 N=16 250 N=16 0.95 N=32 N=32 N=64 N=64 200

150 0.9 100 Fixed Local Polarity 50

0.85 Average Number of Neighbors 0 0 5 10 15 20 0 5 10 15 20 t t Figure 3.12. We plot the various results of the Vicsek model’s nu- merical experiment using the non-scaled parameters with repulsion. (Top Row) The global polarity is plotted on the left against the time, t, for all N. The local polarity is plotted on the right against the time, t, for all N. (Middle Row) The fixed local polarity is plotted on the left against the time, t, for all N. The average neighbors is plotted on the right against the number of particles, N. The unit of the number of particles, N, is in thousands. and the rest are the biggest, as it deviates the most from the group. However, for N that do not deviate, the differences between them are smaller. This, again, suggests that the system does not preserve its behavior as we change N.

Scaled With Repulsion. Lastly, we discuss the case of the scaled parameters with repulsion. In Figure 3.13, we, again, plot the polarities and the average number of neighbors. The grouping is also seen in the global and fixed local polarities.

N = 64000 and 16000 are clumped together, while the rest of N are in another Examining the Effects of Parameter Scaling in a Model for Collective Motion 92

N 2000 4000 8000 16000 32000 4000 0.0010 0.0000 - - - - 0.0004 8000 0.0027 0.0017 0.0001 0.0001 - - - 0.0010 0.0006 16000 0.0055 0.0045 0.0028 0.0001 0.0001 0.0000 - - 0.0012 0.0009 0.0003 32000 0.0377 0.0366 0.0349 0.0321 0.0004 0.0004 0.0003 0.0003 - 0.0053 0.0050 0.0044 0.0041 64000 0.0238 0.0228 0.0211 0.0183 0.0207 0.0003 0.0003 0.0002 0.0002 0.0001 0.0034 0.0031 0.0025 0.0022 0.0020 Table 3.7. The average difference of the global, local, and fixed local polarities of the non-scaled parameters with repulsion cases between the varying number of particles. For each cell, the first element is the difference of the global polarities between the two Ns, the second element is the difference of the local polarities, and the last element is the difference of the fixed local polarities.

group. The local polarity seems very similar to the non-scaled with repulsion cases

of Figure 3.12. The average number of neighbors show similar behavior as the

other cases of scaled parameters. All N start around the same, and as t increases, the average number of neighbors also increases. However unlike the other cases,

N = 16000 has the highest average number of neighbors. In fact, N = 64000 has an even lower average number of neighbors compared to the case of N = 32000, and it has the third highest neighbors. The neighbors across all N are closer to one another compared to the other 3 cases that we have discussed so far. This suggests that implementing scaling with repulsion may preserve the system behavior better than the other 3 cases. However, this does not indicate that the system behavior Examining the Effects of Parameter Scaling in a Model for Collective Motion 93

1 1 N=2 N=2 N=4 0.98 N=4 0.8 N=8 N=8 N=16 0.96 N=16 N=32 N=32 0.6 N=64 N=64 0.94

0.4 0.92 Local Polarity Global Polarity 0.9 0.2 0.88

0 0.86 0 5 10 15 20 0 5 10 15 20 t t 1 160 N=2 N=2 N=4 N=4 N=8 140 N=8 N=16 N=16 0.95 N=32 N=32 N=64 120 N=64

100 0.9

Fixed Local Polarity 80

0.85 Average Number of Neighbors 60 0 5 10 15 20 0 5 10 15 20 t t Figure 3.13. We plot the various results of the Vicsek model’s nu- merical experiment using the scaled parameters with repulsion. (Top Row) The global polarity is plotted on the left against the time, t, for all N. The local polarity is plotted on the right against the time, t, for all N. (Middle Row) The fixed local polarity is plotted on the left against the time, t, for all N. The average neighbors is plotted on the right against the number of particles, N. The unit of the number of particles, N, is in thousands.

is preserved across all N, as the absolute average differences of the polarities are rather different from one another as seen in Table 3.8. Examining the Effects of Parameter Scaling in a Model for Collective Motion 94

N 2000 4000 8000 16000 32000 4000 0.0043 0.0009 - - - - 0.0004 8000 0.0019 0.0031 0.0013 0.0005 - - - 0.0005 0.0003 16000 0.0164 0.0123 0.0151 0.0018 0.0010 0.0006 - - 0.0030 0.0027 0.0025 32000 0.0059 0.0048 0.0046 0.0148 0.0017 0.0010 0.0005 0.0005 - 0.0014 0.0011 0.0010 0.0019 64000 0.0137 0.0130 0.0126 0.0104 0.0088 0.0018 0.0011 0.0006 0.0006 0.0002 0.0025 0.0022 0.0020 0.0011 0.0012 Table 3.8. The average difference of the global, local, and fixed local polarities of the scaled parameters with repulsion cases between the varying number of particles. For each cell, the first element is the difference of the global polarities between the two Ns, the second element is the difference of the local polarities, and the last element is the difference of the fixed local polarities.

3.8 Comparison of the Repulsion Cases

We compare the four cases from Subsection 3.7.1. In Tables 3.5, 3.6, 3.7, and 3.8, we list the absolute average differences of the global, local, and fixed local polari-

ties for the cases of non-scaled and scaled parameters without and with repulsion.

Although the differences between the cases are rather similar to one another, we

can see that the cases with repulsion produce slightly smaller differences than the

cases without repulsion. We also mention that the scaled parameter with repul-

sion may be better at preserving the system behavior that the rest. We now use

the independent t-test between the absolute average differences of these cases to

see if there is a significant difference between them. If there is, then one case may Examining the Effects of Parameter Scaling in a Model for Collective Motion 95

be better at preserving the system behavior than the others; See Section 1.2 for the

detailed explanation of the statistical tests used in this section.

In Table 3.9, we display the summary statistics of the four cases from Subsection

3.7.1: NSNR, SNR, NSR, and SR. NSNR stands for the non-scaled parameter set with no repulsion, and SNR stands for the scaled parameter set with no repulsion.

Similarly, NSR stands for the non-scaled parameter set with repulsion, and SR

stands for the scaled parameter set with repulsion.

N Mean Std NSNR GP 15 0.008595 0.01349 LP 15 0.01172 0.01650 FLP 15 0.009005 0.01361 SNR GP 15 0.007039 0.009830 LP 15 0.005805 0.007050 FLP 15 0.005939 0.008696 NSR GP 15 0.005995 0.01191 LP 15 0.008908 0.01295 FLP 15 0.005469 0.008454 SR GP 15 0.004399 0.005247 LP 15 0.003117 0.003928 FLP 15 0.004456 0.005411 Table 3.9. We list the summary statistics for each case. In each cell, we list the number of data, N, mean, and standard deviation (std) of the absolute average differences of global (GP), local (LP), and fixed local (FLP) polarities, respectively. NSNR stands for the non-scaled parameter set with no repulsion, and SNR stands for the scaled pa- rameter set with no repulsion. Similarly, NSR stands for the non- scaled parameter set with repulsion, and SR stands for the scaled parameter set with repulsion.

To use the independent t-test, we need to check the normality of the data being

used. The Shapiro-Wilks test is used to test the normality. Let the null hypothesis, Examining the Effects of Parameter Scaling in a Model for Collective Motion 96

Raw Data Transformed Data W p-value W p-value NSNR 0.67556 0.0001378 0.93849 0.3638 0.72256 0.0004378 0.92253 0.2105 0.69911 0.0002432 0.92712 0.247 SNR 0.69418 0.0002155 0.95449 0.5976 0.72203 0.0004319 0.9397 0.3786 0.6684 0.0001164 0.95823 0.6617 NSR 0.54253 7.914e-06 0.9678 0.8242 0.70092 0.0002542 0.93495 0.3231 0.64257 6.439e-05 0.93083 0.2808 SR 0.73076 0.0005408 0.94143 0.4007 0.68408 0.0001688 0.92175 0.2048 0.75051 0.0009112 0.95887 0.6727 Table 3.10. We list the test statistic (W) and p-values from the Shapiro-Wilk’s test between the cases using the raw (first two columns) and log transformed (last two columns) data. In each cell, we list the mentioned values of the absolute average differences of global, local, and fixed local polarities, respectively. NSNR stands for the non-scaled parameter set with no repulsion, and SNR stands for the scaled parameter set with no repulsion. Similarly, NSR stands for the non-scaled parameter set with repulsion, and SR stands for the scaled parameter set with repulsion.

H0, to be that the absolute average differences are normally distributed, and the

alternative hypothesis, Ha, to be that the absolute average differences are not nor-

mally distributed. We use the significance level of α = 0.05. In the first column of

Table 3.10, we list the p-values from the Shapiro-Wilk’s test of the absolute aver-

age differences of global, local, and fixed local polarities, respectively. We see that

all of them are less than the significance level of α = 0.05, and we reject the null

hypothesis. This indicates that the data are significantly different from the normal

distribution. One way to gain normality is by transforming the data. We use the

log transformation, log(data), and check the p-values for the Shapiro-Wilk’s test

of them. In the second column of Table 3.10, all the p-values are now greater than Examining the Effects of Parameter Scaling in a Model for Collective Motion 97

the significance level of α = 0.05. This indicates a successful transformation to nor-

mality, and we fail to reject the null hypothesis implying that the distribution of

the data is not significantly different from the normal distribution. We use the log

transformed data for the remaining statistical tests, and we assume the normality.

NSNR F df p-value 95% CI Lower Upper SNR 0.4845 14 0.1875 0.1626 1.4430 0.3774 14 0.0788 0.1267 1.1242 0.4807 14 0.1829 0.1614 1.4319 NSR 1.1277 14 0.8252 0.3786 3.3590 0.9133 14 0.8676 0.3066 2.7203 0.8660 14 0.7915 0.2907 2.5794 SR F df p-value 95% CI Lower Upper SNR 0.7150 14 0.5384 0.2400 2.1295 0.6634 14 0.4523 0.2227 1.9760 0.9212 14 0.8801 0.3093 2.7438 NSR 0.3071 14 0.03468 0.1031 0.9148 0.2742 14 0.02125 0.09204 0.8166 0.5114 14 0.2219 0.1717 1.5232 Table 3.11. We list the statistic (F), degrees of freedom (df), p-values, and 95% confidence interval (CI) from the F-test between the two cases. In each cell, we list the said values of the absolute average differences of global, local, and fixed local polarities, respectively. NSNR stands for the non-scaled parameter set with no repulsion, and SNR stands for the scaled parameter set with no repulsion. Sim- ilarly, NSR stands for the non-scaled parameter set with repulsion, and SR stands for the scaled parameter set with repulsion.

We also need to carry out F-test first to see if there is no significant difference between the variances of the two sets of data; the t-test assumes equality of the two variances. If the variances are unequal, we use the Welch’s t-test. Let the

2 2 null hypothesis, H0, to be H0 : σA = σB, and the alternative hypothesis, Ha, to be Examining the Effects of Parameter Scaling in a Model for Collective Motion 98

2 2 2 Ha : σA 6= σB, where σi is the variance of a case i. We use the significance level of α = 0.05. In Table 3.11, we list the statistic (F), degrees of freedom (df), p-values, and 95% confidence interval (CI) from the F-test between the log absolute average differences between the global, local, and fixed local polarities, respectively. We only test the cases sharing a common condition: the scaled and non-scaled param- eter sets without repulsion (SNR and NSNR), the scaled and non-scaled parameter sets with repulsion (SR and NSR), the scaled parameter sets with and without re- pulsion (SNR and SR), and the non-scaled parameter sets with and without repul- sion (NSNR and NSR). To see the one-way ANOVA across all cases, see Appendix

B. We see that the p-values for the F-test between the log absolute average differ- ences of the global and the local polarities of (SR,NSR) are less than the significance level α = 0.05. This indicates that there is a significant difference between the vari- ances of the two, and we reject the null hypothesis. We use the Welch’s t-test for the this pair. For the other pairs, since the p-values are greater than the significance level α = 0.05, we fail to reject the null hypothesis. We conclude that there is no sig- nificant difference between the variances of them. We use the classic independent t-test which assumes equality of the two variances for these.

We list the statistic (t), degrees of freedom (df), p-values, and 95% confidence interval (CI) from the appropriate t-tests in Table 3.12 between the cases. Let the null hypothesis, H0, to be H0 : mA = mB, and the alternative hypothesis, Ha, to be Ha : mA 6= mB, where mi is the mean value of a case i. We, again, use the significance level α = 0.05. We see that all the p-values of the log absolute average differences of the polarities are greater than the significance level α = 0.05, and we fail to reject the null hypothesis. This indicates that there is no significant difference Examining the Effects of Parameter Scaling in a Model for Collective Motion 99

NSNR F df p-value 95% CI Lower Upper SNR 0.6336 28 0.5315 -0.9246 1.7528 0.0920 28 0.9273 -1.2341 1.3501 0.2101 28 0.8351 -1.2017 1.4763 NSR -0.8688 28 0.3923 -2.2825 0.9229 -0.2670 28 0.7915 -1.7213 1.3244 -0.5942 28 0.5572 -1.9391 1.0671 SR F df p-value 95% CI Lower Upper SNR -0.4401 28 0.6633 -1.2166 0.7863 -1.0926 28 0.2839 -1.3376 0.4070 -0.2853 28 0.7775 -1.2048 0.9102 NSR 1.3492 21.858 0.1911 -0.4724 2.2298 -0.3601 21.14 0.7223 -1.4140 0.9964 0.6932 28 0.4939 -0.8328 1.6849 Table 3.12. We list the statistic (t), degrees of freedom (df), p-values, and 95% confidence interval (CI) from the t-test between the two cases. In each cell, we list the said values of the absolute average differences of global, local, and fixed local polarities, respectively. NSNR stands for the non-scaled parameter set with no repulsion, and SNR stands for the scaled parameter set with no repulsion. Sim- ilarly, NSR stands for the non-scaled parameter set with repulsion, and SR stands for the scaled parameter set with repulsion.

between the mean values of the compared cases. This suggests that none of the cases are better at preserving the system behavior than the others as we vary N, as expected.

3.9 Discussion

We examine the effects of scaling parameter sets using the Vicsek model. The pa- rameter scaling is suggested by the work of Barbaro et al. as their hope of reducing Examining the Effects of Parameter Scaling in a Model for Collective Motion 100

simulations with superindividual particles to simulations where a particle repre-

sents one fish while preserving the system behavior as the number of particles

increase. The proposed scaling, Equation 1.19, is tested using two different types

of simulations. We measure the system alignment globally and locally by using

the global, local, and fixed local polarities.

The easiest way to disturb the system alignment is when the particles collide with one another. For our first conditions, we initialize two schools and let them collide using the Vicsek model. We have seen that the system preserved its behav- ior as we increase N when we do not scale the parameters. To further analyze, we implement the zone of repulsion to the Vicsek model and run the same simula- tion again. In the simulations with the implemented zone of repulsion, we witness odd and “melting” behavior from the schools due to the lack of neighbors within the zone of orientation. As this odd behavior makes it difficult to compare the alignment measurements, we propose a different type of collision.

In the new collision setting, we spread out the particles in a square system, and initialize them to head toward each other. We test four different conditions with this new set up: the non-scaled and scaled parameter sets without repulsion, and the non-scaled and scaled parameter sets with repulsion. The polarities suggest that system behavior is not the same as we vary N visually and numerically for all the cases. We use t-tests to see if there is any significant difference between the mean values of the log absolute average differences of the polarities for the cases. As the p-values are greater than the significance level for all mean values, we decide that there is no significant difference between the mean values of these Examining the Effects of Parameter Scaling in a Model for Collective Motion 101

cases. This suggests that neither of them are better at preserving the behavior than

the others.

Note that the case of the non-scaled parameter without repulsion in the condi-

tions of two schools colliding is able to preserve the behavior, while that same case

is not able for the different collision conditions. This may indicate that the align-

ment measurement is heavily dependent on the conditions of simulations, and the

measurement might be different in another different setting. However as none of

the scaled parameter sets performed better than the non-scaled parameter sets, we

conclude that the scaling does not preserve the system behavior as N changes.

Another thing to note is that the number of neighbors is changing as the num-

ber of particles changes in all of the cases. This was contrary to the assumptions

used to derive the scaling laws.

3.10 Future Work

We still believe that producing the same system behavior while changing the num-

ber of particles is important. This would allow us to model the simulation in a

more realistic way. Before we fully reject the idea of scaling, we can explore many

other options. We have yet to try the scaling with the implementation of the zone

of attraction along with the other zones. Since the alignment measurement may be

dependent of the simulation set up, we can also use the conditions for the work of

Barbaro et al. to test the scaling or another new conditions of collision.

We question the global, local, and fixed local polarities as the metric for the

system behavior. Recall that all the mentioned polarities are the averages of the

particle orientation at a global or local level. As the total number of particles, or Examining the Effects of Parameter Scaling in a Model for Collective Motion 102

N, varies from one simulation to another, the polarities are averaged by different

N as well. This may not be the best way to measure how aligned the system is and may require us to rethink the approach. The new approach of measuring the overall and local alignment may provide more ideal results. Lastly, proposing a brand new scaling may be possible once we have a consistent and promising data from new simulations. 103

4 Predicting Civil Unrest Using Twit- ter Data from the 2015 Baltimore Protest

In this chapter, we discuss and analyze the Twitter data from the Baltimore up- rising in 2015 with a goal of building a statistical tool that will predict any future uprisings. In Section 4.1, the background of the Baltimore uprising is explained, and in Sections 4.2 and 4.3, we explain the background and cleaning of data, re- spectively. We perform different analyses of our data from Section 4.4 to 4.8. We examine the time series, hashtags, outliers using the quantiles, sentiments, and the topics from Nonnegative Matrix Factorization (NMF) in these sections. We pro- pose a tool using quantiles and NMF in Section 4.9 and test its abilities to predict the civil unrest. Finally, we finish this chapter with a discussion and future work in Sections 4.10 and 4.11.

4.1 Motivation

Unfortunately, it is not unusual to see some form of uprisings or protests in the current events. In 2019 alone, there were about 20 different known protests around the globe [10]. Some turned violent, whereas some remained peaceful; some were Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 104

demanding democracy, whereas some were seeking fair elections [102]. For what-

ever the protesters’ reason may be, the citizens around the globe are actively par-

ticipating to get their voices heard. When the tensions run high and things escalate

quickly, violent protests are bound to happen and are a great threat to society. If we can predict the civil unrest in its early stage, the authorities can take appropri-

ate measures to lessen the damage. In this chapter, we propose to do so by using

tweets.

Twitter is a micro-blog that can be accessed at any time of the day regardless of

the user’s location. The tweets, 280-word limit messages, are often used as a real-

time current event due to Twitter’s incredible accessibility and popularity. Anyone

can find out what is happening around the world by simply logging in to Twitter.

Twitter is often used to express the Twitter users’ thoughts or to get any type of

messages or information spread around the world. Twitter is an excellent platform

to use during protests, and the public Tweets from those times are available for us

to analyze. We believe that certain words get used more frequently during the

protests, and we would like to build a statistical tool that will be able to predict

any future protests by analyzing Tweets.

4.2 Data Background

In this section, we discuss the background of our data set, such as where and when

the Tweets were sent out. We also discuss how and why we clean up the data set.

4.2.1 Data Description

The data set consists of the Tweets from Baltimore, from April 1, 2015,

to September 4, 2015. There are 45 tab-separated value (TSV) files that contain Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 105

approximately 50,000 Tweets per file. Each file has 9 different information on a

Tweet (9 columns): Tweet ID, Tweet, Twitter user ID, an unidentified sequence of

number, Twitter user’s bio (usually their locations), date and time, geo-coordinates

(longitude and latitude), and another unidentified number that is usually a 6 or 10.

This data set was distributed at the ICERM Predictive Police workshop in 2016, and the permission was granted by P. Jeffrey Brantingham.

4.2.2 Freddie Gray and Baltimore Uprising

The Tweets that we have are from 11 days before Freddie Gray’s arrest and about 4 months after the official ending of the Baltimore protest. We now go more in-depth of the death of Freddie Gray and the Baltimore protest from [111], [7],[9], [8], [109],

[122], and [72].

Freddie Gray was a 25-year-old African American male. He lived in Gilmor

Homes neighborhood, the area known for poverty, drugs, and violent crimes in

Baltimore. At the time of Gray’s arrest, he was on the streets of his neighborhood.

He was arrested after making eye contact with a lieutenant while he was on a

bicycle neighborhood patrol along with 3 other police officers on April 12, 2015.

Gray was arrested for illegal possession of a switchblade knife after a short pursuit.

In the official charging document, it states that an officer noticed that he had his

knife clipped to the inside of the right front pocket [8]. However, when the knife was retrieved, it turned out to be a spring assisted knife, which is legal under

Maryland law. Yet, he was told that it was a violation and was arrested. A police van was requested to transport Gray to the police station. While the officers claim

that he voluntarily got into the van, the witnesses have told the media that his Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 106

legs looked bent and that he was beaten with a baton when getting on the vehicle.

What we do know for a fact was that Gray requested his inhaler while he was

getting in the van. En route to the police station, we know that the van made

multiple stops, but we do not know the reason for most of those. By the time Gray

arrived at the Western Police District police station, the paramedics were called in

for an unconscious male, and Gray was rushed to the University of Maryland R

Adams Cowley Shock Trauma Center. He received a double surgery for his three

fractured vertebrae, injured voice box, and spine that was 80% severed at his neck.

Unfortunately, Gray remained unconscious until his death, a week later on April

19, 2015.

This arrest was made public by a news conference held by the police on April

13, 2015. By April 18th, the protests began outside of the Western District police

station. As more news conferences were held and more information was flowing

out about the arrest, the protest intensified. Although the Baltimore police ac-

knowledged their mistakes and faults regarding the death of Gray on April 24th,

the protesters turned violent starting on the 26th. They were damaging police ve-

hicles, clashing with or injuring the police officers, looting local businesses, and

committing multiple arsons. To combat the violence, the weeklong city-wide cur-

few was placed, a was declared, and the National Guard was

called in. Despite the city’s efforts, the protests did not seem to cease. To miti-

gate the violence, many public figures, including President and the

musician , spoke out to the public or held peace calling concerts. On April

30th, the State attorney ruled Gray’s death as a homicide, and on May 1st, the 6

police officers were charged in Gray’s death including manslaughter and murder. Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 107

However, all 6 officers’ charges were eventually dropped. May 3rd is the official

end date for the Baltimore protest as the city-wide was lifted on this date,

and the national guard withdrew from the city on the following day, May 4th.

4.3 Cleaning Data

The data has to be cleaned as not all the raw data have the desired format. Two files were already corrupted when we acquired the data, and we assume that someone

had opened these corrupted files with MS Excel. As a result, all the Tweet ID

and date/time formats are distorted, and the character “∧M” (carriage return) is

introduced in the place of “\n” (new line). The corruption also changed the file

format, and all the emojis used in the Tweets turned into an unrecognizable format.

We also require a Tweet and its information to be in the same row for all the data

sets. However, some of the Tweets, especially the ones in another language, are

broken into multiple rows.

The easiest and fastest way to clean the data is to use the combination of Sed

and Awk, Shellscripting, and Regular Expressions. We use two different scripts to

clean the corrupted and uncorrupted files. The codes that are used in this study

can be found at http://doi.org/10.17605/OSF.IO/R37ST.

4.3.1 Cleaning of Corrupted File

As mentioned earlier, the file format changed at the time of corruption. We first

convert the format to UTF-8. Then, we begin our extensive cleaning process. Since

“∧M”, a carriage-return character, is introduced to the corrupted files, we remove

all the “∧M” occurrences. We condense the Tweets that are divided into multiple Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 108

lines to one line by replacing the new line command (\n) with a single space. The

next step is to rewrite the Tweet ID. Since we do not have any information on the

corrupted Tweet IDs, we use the last known Tweet ID from the previous uncor-

rupted file. The 18-digit Tweet ID is too long for Awk to register all the digits as a variable, so we divide the number into half and assign them as two different vari-

ables, say lastID1 and lastID2, respectively. We, then, add one to lastID2 per Tweet

and print lastID1 and lastID2 together to create a new Tweet ID for the corrupted

files. We also have to change the format of the date and time. The date and time

format changed from the desired format, YYYY-MM-DD HH:MM:SS, to DD/M-

M/YY HH:MM during the corruption. We use Regular Expressions to grab the

date and time information and change the format by

(1) adding “20” in front of the year (YY)

(2) switching around the year and date positions

(3) replacing the slash (/) with a dash (-)

(4) adding :00 in the place for seconds.

4.3.2 Cleaning of Uncorrupted Files

Unlike the corrupted files, the cleaning of uncorrupted files is relatively simple.

We have noticed some ASCII characters in a place of a tab at some places in the

files. Just like the corrupted files, there are Tweets in multiple lines instead of a

single line, and “∧M” also exists. We simply remove ASCII characters and “∧M”

and condense the multiple lines into a line. Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 109

4.3.3 Cleaning the Tweets

We also clean the Tweets while cleaning the format of the files. This is to prepare

the Tweets for the term frequency-inverse document frequency (tf-idf) matrix and

Nonnegative Matrix Factorization that we use to analyze the Tweets. We provide

a detailed explanation of them in Section 4.8. We, first, print only the Tweets to

another file. The Tweet cleaning process for both types of files is the same except

for one extra step for the corrupted files. We remove all the punctuation, change

the upper case letters to the lower case, and remove the leading and ending white

spaces. As the emojis are unreadable in the corrupted file, we delete anything that

is not an alphabet or a number. We, then, remove all the stop words. For exam-

ple, if the Tweet states “The weather app says that it will be raining tomorrow”,

removing the stop words would result in “weather app raining tomorrow”.

We demonstrate the cleaning algorithm for the corrupted and noncorrupted

files, respectively, as the following:

FOR each corrupted file .tsv

Convert to UTF−8

Remove ˆM

Replace multiple lines with a single space

Print Tweets to another file

FOR each Tweet

Remove all the punctuation

Change upper case to lower case

Remove anything that is not alphabet Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 110

or number

Remove stop words

Remove leading and ending white spaces

END

Rewrite cleaned Tweets to the original file

Check field number == 9

LastID1 = Last tweetID in the previous file[1:11]

LastID2 = Last tweetID in the previous file[12:end]

FOR each row:

LastID2 = LastID2 + 1

NewID = print(LastID1 ,LastID2)

END

Replace DD/MM/YY HH:MM to YYYY−MM−DD HH:MM:0 0

Delete lines where the Tweets are empty

END

FOR each noncorrupted file .tsv

Remove ASCII characters

Remove ˆM

Replace multiple lines with a single space

Print Tweets to another file Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 111

FOR each Tweet

Remove all the punctuation

Change upper case to lower case

Remove stop words

Remove leading and ending white spaces

END

Rewrite cleaned Tweets to the original file

Check field number == 9

Delete lines where the Tweets are empty

END

The field number from the code above is the number of columns in a file.

4.4 Time Series

As mentioned before, the entire set of data is from Tweets dated April 1st, 2015 to

September 4th, 2015. Before cleaning the data, there are 2,250,251 Tweets, and after

the cleaning, there are 2,207,180 Tweets. We plot the time series of both raw (left)

and cleaned (right) data in Figure 4.1. We can see the number of Tweets rise and

fall repeatedly over time, and the unusual spikes and dips are presented as well.

In both figures, we see that some hours have 0 Tweets around the 2000 hour mark.

These particular dates are from June 24th to 26th, and we do not know why there is

not any data available for these dates. The data set completely omits Tweets from

June 24th to 6 pm of 26th, but we have added those two dates in the data for the

complete time series. Comparing the raw and cleaned time series, we can see that Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 112 Number of Tweeets Number of Tweeets 0 500 1000 1500 2000 2500 3000 0 500 1000 1500 2000 2500

0 1000 2000 3000 0 1000 2000 3000

Hours Hours

Figure 4.1. (Left) The time series of entire raw data. (Right) This fig- ure is the time series of entire cleaned data.

the two dips near the hour 2000 and 3000 are from the corrupted files as many of the Tweets from them got deleted. We can also confirm whether the deleted Tweets are from the corrupted files with the dates. The corrupted Tweets are from June

29th to July 2nd and July 27th to 30th; which are the hours 2136 to 2208 and the hours 2808 to 2880 from April 1st, 2015.

We look into how the number of Tweets changes in a day by the left plot of

Figure 4.2. Hour 1 is right after midnight, 12 AM, and hour 24 is 11 PM. Each boxplot represents how many Tweets were tweeted per minute for each hour. We see that the number of Tweets significantly decreases from 4 AM to 8 AM, as most of us tend to sleep around that time. The number of Tweets increases during the day, and we see a big jump from 9 PM to 10 PM. From the left plot of Figure

4.2, we can see that Twitter users tend to Tweet more at night. The right plot of

Figure 4.2 shows a month-long boxplot of the number of Tweets per hour per day. Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 113 Tweets Tweets 0 5 10 15 20 25 30 0 500 1000 1500 2000 2500

1 3 5 7 9 11 13 15 17 19 21 23 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31

Hours Days

Figure 4.2. (Left) The number of Tweets of a day is depicted by a boxplot. Hour 1 is 12 AM, and Hour 24 is 11 PM. (Right) The number of Tweets per day for a month is depicted by a boxplot. Day 1 is August 1st, 2015, and Day 31 is August 31st, 2015.

Day 1 is August 1st, and Day 31 is August 31st. Note here that August 1st is a

Sunday. We purposely picked August to show the month-long boxplot, because this month would produce the most standard boxplot out of all the months. April and May would show an unusual amount of Tweets as these months are when the Baltimore protest happened. The corrupted files are parts of the Tweets from

June and July, and the boxplots of these months would show too little of Tweets.

From the right plot of Figure 4.2, we can see that, in general, Twitter users Tweet more on the weekdays than the weekends. The sharp decrease in Tweets from

Fridays to Saturdays is shown as well. The outliers for Day 31 are not expected as the only important event that happened in the US on that day was the Obama administration renaming Mt. McKinley to Denali. Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 114

4.5 Looking into Hashtags

The hashtags are keyword phrases that do not contain any spaces and start with a

pound, #, sign. One can place hashtags anywhere in one’s Tweets. Twitter lets its

users search Tweets based only on hashtags, and the users can also check which

hashtags are trending at any time of the day. Hence, it makes sense for us to look

into just hashtags.

4.5.1 Extracting Hashtags

To extract the hashtags from the Tweets, the process is rather similar to the data

cleaning algorithm. We demonstrate the extracting algorithm for the cor-

rupted and noncorrupted files, respectively, as the following:

FOR each corrupted file .tsv

Convert to UTF−8

Remove ˆM

Replace multiple lines with a single space

Print Tweets to another file

FOR each Tweet

Change upper case to lower case

Remove anything that is not alphabet

or number

Remove all but phrases starting with #

Remove leading and ending white spaces

Remove all the punctuation Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 115

END

Rewrite cleaned Tweets to the original file

Check field number == 9

LastID1 = Last tweetID in the previous file[1:11]

LastID2 = Last tweetID in the previous file[12:end]

FOR each row:

LastID2 = LastID2 + 1

NewID = print(LastID1 ,LastID2)

END

Replace DD/MM/YY HH:MM to YYYY−MM−DD HH:MM:0 0

Delete lines where the Tweets are empty

END

FOR each noncorrupted file .tsv

Remove ASCII characters

Remove ˆM

Replace multiple lines with a single space

Print Tweets to another file

FOR each Tweet

Change upper case to lower case

Remove all but phrases starting with # Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 116

Remove leading and ending white spaces

Remove all the punctuation

END

Rewrite cleaned Tweets to the original file

Check field number == 9

Delete lines where the Tweets are empty

END

Again, the field number from the codes above is the number of columns in a file.

The reason behind deleting all the punctuation after extracting the hashtag is

that the program R does not read in the files properly when the hashtag contains

a quote, “, at the end of the phrase. Also, if we have #Ilovedogs! and #Ilovedogs,

the word counter that we use for the tf-idf will count them as two separate words.

Hence, we delete all the punctuation after extracting hashtags.

4.5.2 Results of Hashtags

After extracting the hashtags, we count how many times each hashtag occurs.

There are 235,466 Tweets using one or more hashtag, and 87,725 unique hashtags

are used. We list the top 10 most frequently used hashtags from the entire data in

the following Table 4.1.

In Table 4.1, ’orioles’ is Baltimore’s baseball team, and ’hhtfitness’ is the local

gym. ’lrt’ is the abbreviation of last retweet, referring to showing one’s response

to a retweet. A retweet is when a user shares someone else’s Tweet on their pro-

file. ’msnbc’ and ’morningjoe’ are the local TV news and talk shows, respectively.

Lastly, ’birdland’ is a membership program for Orioles. As we can see from the Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 117

Hashtag Count baltimore 12898 orioles 5993 hhtfitness 3269 lrt 3152 msnbc 2680 freddiegray 2361 personaltrainer 2324 sportsroadhouse 2323 morningjoe 2231 birdland 1911 Table 4.1. The first column of the table is the top 10 most used hash- tags from the entire data, and the second column represents how fre- quent the hashtags appeared in the Tweets.

most used hashtags, this is not a good source to summarize the events that oc-

curred during the entire duration of data collection. However, this may be a good

method when we are only focusing on a day or so.

Now, we only focus on hashtags from one file, which contains about 3 days’ worth of Tweets. The dates that we are focusing on is from April 25th to 27th,

2015, when the violent protests was about to start and were at their peaks. There are a total of 4,367 unique hashtags used from those 3 days. The following is the top 10 hashtags from the dates listed in Table 4.2.

Again, ‘baltimore‘ was the most used hashtag. However, we now see more

relevant hashtags that are related to the death of Freddie Gray and the Baltimore

protests. These hashtags include ‘freddiegray‘, ‘baltimoreriots‘, ‘prayforbaltimore‘,

‘blacklivesmatter‘, and ‘justiceforfreddiegray‘. This shows that the hashtags are a

good source for the event detection once the dates are narrow down. Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 118

Hashtag Count baltimore 916 freddiegray 691 baltimoreriots 334 orioles 232 prayforbaltimore 152 blacklivesmatter 98 lrt 94 mdtraffic 88 birdland 55 justiceforfreddiegray 51 Table 4.2. The first column of the table is the top 10 hashtags from the 3-day data, and the second column represents how frequent the hashtags appeared in the Tweets.

4.6 Outlier Tweets

As we see from Section 4.5, it is more useful to extract hashtags in a shorter time

frame. In this section, we determine when there is an unusual Twitter activity

by using quantiles on the number of Tweets and analyze hashtags of the unusual

hours of Twitter activities.

4.6.1 Quantiles

From Winterer [138], we know that the quantiles work just as well as the proposed

linear models at detecting periods of unusual Twitter activities. To define these

periods, we do so by identifying the outliers of the number of Tweets per hour

using the quantiles. As these unusual activities may or may not reflect the civil

unrest, Winterer suggests that we manually check them.

In Figure 4.3, we plot the number of Tweets per hour from April 20th to May

3rd, 2015. Note that April 20th on a Monday. The upper limit, the 97.5th quantile,

is in a red curve, and the lower limit, the 2.5th quantile, is in a blue curve. We Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 119 Number of Tweets 0 500 1000 1500 2000

0 50 100 150 200 250 300

Hours

Figure 4.3. The number of Tweets per hour from April 20th to May 3rd, 2015. The number of Tweets is in small black circles. The 97.5th quantile is in a red curve, and the 2.5th quantile is in a blue curve. calculate the quantiles using the data from August 1st to September 4th, 2015. The reason for choosing this date interval is that we do not expect any abnormal Twit- ter activities within these dates. The number of Tweets from these dates is more standard and normal. We find the quantiles by collecting data for each day of a Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 120 week (i.e. Monday through Sunday), then calculating appropriate quantiles per day per hour. The clear distinction of each day can be seen by the spikes. We have mentioned that Twitter users Tweet during the weekdays more than the week- ends. We can see that again in the quantiles. The weekends, 6th and 7th higher spikes between the hours 100 and 150, are much lower than the first five higher spikes. Also, it is interesting to see that as the weekday goes by, the upper limit increases then reaching its highest on Fridays, 5th higher spike near the hour 100.

We can also see that the Twitter activity is more prominent in the late night and early mornings. The importance of this plot is the outliers, as they represent the unusually high amount of Tweets. There are many outliers around the 200 hour mark. The first few of them are from 8 - 11 pm on April 27th. We now look into the hashtags only from these hours. There are a total of 650 Tweets that use hashtags, and 376 of them are unique. The top 10 most used hashtags are listed in Table 4.3.

Hashtag Count baltimore 184 baltimoreriots 119 freddiegray 111 prayforbaltimore 58 orioles 16 pray 11 breaking 9 mondawmin 7 ripfreddiegray 7 blacklivesmatter 6 Table 4.3. The first column of the table is the top 10 hashtags from 8 to 11 PM of April 27th, and the second column represents how frequent the hashtags appeared in the Tweets.

From Table 4.3, it seems that all the hashtags except for ‘orioles’ are related to

the death of Freddie Gray and Baltimore protest. ‘mondawmin’ is a local Baltimore Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 121

mall where another violent protest started on this date, the day that the funeral for

Freddie Gray was held [55]. This shows that narrowing down and focusing on a

small time frame using outliers is an effective way to detect the current event.

Lastly, in Figure 4.4, we plot the outlier counts for the entire duration of data

per day using the 97.5th quantile. The graph starts on April 1st, 2015, and from

left to right, the red dashed lines represent the first day of May, June, July, Au-

gust, and September. The blue dashed lines represent the start of protests and the violent protests, respectively. The brown dashed lines represent the day of arrest

and death of Freddie Gray, respectively. As expected, we see a significant increase

toward the end of April, where we call the peak period of violent protests. The

tallest bar in June is from the 29th. We suspect that this is caused by the baseball

game between the and Texas Rangers, where the Orioles lost by

the score of 8 to 1. The missing bars at the end of June are from the days where

there are not any data available. We can conclude that the protests can be detected

by the outliers.

4.7 The Sentiment Analysis

The motivation behind the sentiment analysis is that we should see more nega-

tive sentiments around the time of civil unrest. We perform sentiment analysis on

the uncleaned Tweets using Python’s Natural Language Toolkit (NLTK) package.

NLTK produces sentiment scores [-1 1] given a sentence or word, where -1 is a

negative sentiment (i.e. displeased), 0 is a neutral sentiment (i.e. indifferent), and

1 is a positive sentiment (i.e. delighted). We use the uncleaned Tweets, because

NLTK takes into consideration of punctuation when determining the sentiment Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 122

Month Protests Freddie Gray Outlier Frequency 0 2000 4000 6000 8000 4/01 5/01 6/01 7/01 8/01 9/01

Days

Figure 4.4. The bar graph of outliers for the entire duration of data using the 97.5th quantile. The graph starts on April 1st, 2015, and from left to right, the red dashed lines represent the first day of May, June, July, August, and September. The blue dashed lines represent the start of protests and the violent protests, respectively. The brown dashed lines represent the day of arrest and death of Freddie Gray, respectively.

score. NLTK has no problem with emojis, hence not much cleaning is needed be- sides compressing single Tweets that are split into multiple lines to a single line. Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 123

In Table 4.4, we present a few sentences and their sentiment scores to provide an idea of how NLTK assigns scores.

Tweets Sentiment Score “How delightful” and ”Im happy!” 1 Im happy 0.8 im good 0.7 i love chocolate 0.5 fortunately 0.4 this is not bad 0.35 my dog is so pretty 0.25 staying alive 0.1 “i like ice cream” and “my tummy hurts” 0 “justice for freddie gray” and “check out mathstats.case.edu” 0 -0.17 im tired -0.4 im so sad -0.5 im unhappy -0.6 im mad -0.625 im mad! -0.78125 this is the worst! -1 Table 4.4. We provide examples of the possible Tweets (first column) and their sentiment scores (second column) given by NLTK.

In Figure 4.5, each of the bars represents how many Tweets there are in such sentiment for the entire data (left) and outliers of the 97.5th quantile using the en- tire data (right). We see an overwhelming amount of neutral sentiment Tweets compared to the positive and negative ones. As we have seen from Table 4.4, if a Tweet contains a link to a website, which the majority of the spam Tweets do,

NLTK assigns a score of 0. We have also seen that NLTK assigns the neutral scores to unexpected Tweets, such as “i like ice cream” and “ my tummy hurts”. It makes more sense for the Tweet “i like ice cream” to be categorized as a positive senti- ment Tweet, and “my tummy hurts” should be a negative sentiment Tweet. NLTK might be assigning a neutral score to the Tweets that should not be categorized Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 124 Sentiment Score Frequency Sentiment Score Frequency 0 10000 20000 30000 40000 50000 0e+00 2e+05 4e+05 6e+05 8e+05 1e+06 Positive Neutral Negative Positive Neutral Negative

Figure 4.5. (Left) The number of positive (red), neutral (gray), and negative (blue) scored Tweets in the entire data set. (Right) The number of positive (red), neutral (gray), and negative (blue) scored Tweets in the set of outliers using the 97.5th quantiles.

as one. The resulting number of neutral sentiment Tweets may be explained by a combination of countless spam Tweets in the data set and misjudgment of NLTK.

To further the analysis, we look into sentiment scores by hours. We plot dif- ferent periods when the protests has not started and during the peak of violent protest. In Figure 4.6, the Tweets are from April 1st to April 8th. Note that the arrest of Freddie Gray happened on April 12th. Similarly to the proportion shown in Figure 4.5, we see that the majority of the Tweets have a neutral sentiment score followed by the positive and negative sentiment scores. Now, when looking at the peak period of violent protest, from April 26th to May 3rd, in Figure 4.7, we do see a significant increase in Tweets compared to Figure 4.6. Again, this bar plot follows the same proportion of Figure 4.5. Between the hours 40 and 51, we see a huge spike with increased proportions for both neutral and negative sentiment Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 125

Positive Neutral Negative 0 200 400 600 800

1 9 18 29 40 51 62 73 84 95 107 121 135 149 163

Hours

Figure 4.6. The proportions of positive (red), neutral (gray), and neg- ative (blue) scored Tweets per hour. Each bar represents one hour, and the Tweets are from April 1st to April 8th, 2015. scored Tweets. The fact that NLTK recognizes “justice for freddie gray” as a neutral sentiment Tweet, this might explain the increase of the neutral sentiment Tweets compared to other hours. As NLTK wrongfully categorizes some Tweets for this data, this calls for the need to retrain the program based on our given data. Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 126

Positive Neutral Negative 0 500 1000 1500 2000

1 9 18 29 40 51 62 73 84 95 107 121 135 149 163

Hours

Figure 4.7. The proportions of positive (red), neutral (gray), and neg- ative (blue) scored Tweets per hour. Each bar represents one hour, and the Tweets are from April 26th to May 3rd, 2015.

4.8 Detecting Events Using Nonnegative Matrix Factorization

We use Nonnegative Matrix Factorization (NMF) to form the topics based on the

Tweets. These topics will tell us the important events, sports, TV shows, or even Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 127

politics that are relevant to the Tweets. We believe that NMF will be able to form a

topic on the matter of Freddie Gray and the Baltimore protest.

Nonnegative Matrix Factorization, NMF, is known for factoring high dimen-

sional vectors into a low dimensional representation and forces the coefficients to

be non-negative. This non-negativity makes the interpretation and inspection of

the results much easier. This method allows us to divide the Tweets further into its

topics. We want to find matrices W and H such that A = WH, where A is a n × n

Tweet by word matrix, W is a n × k Tweet by topic matrix, and H is a k × n topic by word matrix. Then, we want

n m 1 2 2 kA − WHkF = ∑ ∑(Aij − (WH)ij) . 2 i=1 j=1 Using the gradient descent method, H and W can be found as

T (W A)ij Hij := Hij T (W WH)ij + e

T (AH )ij Wij := Wij T , (WHH )ij + e where e is a small number to avoid dividing by zero. As a result, we obtain

Word Word 1 Word 2 ··· Word n Tweet

Tweet 1 ∗ ∗ ··· ∗ , Tweet 2 ∗ ∗ ··· ∗ ......

Tweet n ∗ ∗ ··· ∗ | {z } =An×n Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 128

Topic Topic 1 Topic 2 ··· Word k Tweet

Tweet 1 ∗ ∗ ··· ∗ , and Tweet 2 ∗ ∗ ··· ∗ ......

Tweet n ∗ ∗ ··· ∗ | {z } =Wn×k

Word Word 1 Word 2 ··· Word n Topic

Topic 1 ∗ ∗ ··· ∗ , where k is the number of top- Topic 2 ∗ ∗ ··· ∗ ......

Topic k ∗ ∗ ··· ∗ | {z } =Hk×n ics. Note that W and H are sparse matrices.

NMF requires the Tweet by word matrix, A, and the number of desired topics as an input. There are few steps needed to obtain the desired input matrix for NMF.

The document term matrix, or dtm, is used to put Tweets into a matrix. As the name suggests, it is a sparse matrix that has the Tweets as its rows and the terms, or words, as its columns. For example, say that we have three Tweets saying “I love Math”, “My favorite subject was Calculus 1”, and “I love cats and dogs too!”.

After the cleaning, these Tweets would read “love math”, “favorite subject calculus

1”, and “love cats dogs”. The dtm based on these Tweets would be, Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 129

Word 1 calculus love cats favorite dogs subject math Tweet

Tweet 1 0 0 1 0 0 0 0 1 .

Tweet 2 1 1 0 0 1 0 1 0

Tweet 3 0 0 1 1 0 1 0 0

We use a method called the term frequency - inverse document frequency, or tf-

idf, to create a sparse matrix that will determine which words are most frequently

used from the dtm [114][108]. The tf-idf is the product of term frequency (t f ) and

inverse document frequency (id f ), as the name suggests. Let t ∈ d be the term,

d ∈ D be the Tweets, and D be the document. First, the term frequency is defined

as Number of times term t appears in a Tweet t f (t, d) = . Total number of terms in the Tweet The inverse document frequency is defined as

 N  id f (t, D) = log , Total number of Tweets that contains the term, t where N is the total number of Tweets in the document, |D|. Then, we obtain the

input matrix for the Nonnegative Matrix Factorization by

t f − id f (t, d, D) = t f (t, d) · id f (t, D).

From the dtm of cleaned data, we obtain 1,078,717 unique words.

4.8.1 Choosing Topic Number and Post Processing of NMF

Choosing the “good” number of topics for the input of NMF is an area that is still

being explored in the field of numerical methods. Although there is an R package Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 130

available called nmfEstimateRank that provides the optimal number of topics, our data is too big for the package to handle. Instead, we guess and check to see if the desired number of topics is capturing the topics well. We first start with 300 topics for the entire set of data then decrease the topic number to 200 and 100 to see if the smaller numbers of topics have better results.

After NMF is done and produces matrices H and W as a result, the matrices

require a little bit of post-processing. We first look into the topic by words ma-

trix, H. To determine the most relevant words per topic, we sort the rows of H

in a decreasing manner. NMF does not explicitly express nor summarize the top-

ics. The investigators need to manually figure out the topics by the most relevant words. For example, if the 5 most relevant words of a topic from H are “Euler”,

“Bernoulli”, “Gauss”, “Pythagoras”, and “Cantor”, we can safely determine that the topic is about famous mathematicians. Note that not all the topics are infor- mative. Some may be composed of words that do not deliver any meanings when put together. For example, we might have the most relevant words from a topic as listed: “cutes”, “add”, “lips”, “twins”, “fav”, and “happened”. All these words combined do not summarize to a topic. Similarly, when we post-process the Tweets by topic matrix, W, we use the same order of sorting from the rows of H to sort the

corresponding column of W. That is, when we sort the first row of H, we use that

same order of sorting to sort the first column of W. When sorting the columns, we

can see which Tweets are most relevant to a topic. Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 131

4.8.2 NMF of Tweets

We perform NMF on the Tweets to further analysis. We use 300, 200, and 100 topics

to see which topic number gives the best topics. The reason behind not trying

a higher number of topics is the high computation cost and time. The biggest

drawback of NMF is that the user has to manually decide the topic based on the

most relevant words. There is also no guarantee that every, or even half, of the

topic would make sense. In Table 4.5, we lay out the proportion of understandable

topics within each number of topics. Note that the number of understandable

topics may vary depending on the person who is doing the analysis as the topics

are manually determined.

Total Number of Topics Number of Understandable Topics Proportions 300 71 71/300 ≈ 0.237 200 49 49/200=0.245 100 19 19/100=0.19 Table 4.5. We calculate the proportions of understandable topics from the topics given by NMF. The first column lists the number of topics declared in NMF. The second column lists the number of un- derstandable topics, and the third column calculates the proportions of the understandable topics within all topics.

From Table 4.5, we see that NMF performed with the 100 topics does not pro-

duce as good of a result compared to the other two. The 300 and 200 topics yield

similar proportions with the 200 topics performing slightly better than the 300.

Although the 200 topics produces slightly more understandable topics, we still

believe that the 300 topics is better. We discuss the reasons in the following para-

graphs. Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 132

First, we discuss the result of 300 topics. We selectively list the most relevant words and their topic in the following Table 4.6. We purposely leave out any top- ics that contain any illegal substances and explicit and curse words. NMF is also capable of creating a topic from spam Tweets, and the topic number 16 is the per- fect example of that. Although the most relevant words depict fitness, these words are from spam Tweets that are trying to promote a local gym in Baltimore. In Ta- ble 4.1, we see that there are 3269 counts of hashtags for “hhtfitness” and another

2324 counts of hashtags for “personaltrainer” in the entire data set. Considering that there are 229,642 hashtags, about 2% of the hashtags is from the same account.

Each hashtag is the third and seventh most used hashtags in the entire data, re- spectively.

Another way to analyze these topics is to plot the number of Tweets that fall

into each topic over time given a cut-off threshold value of W. As the sorted values

of Tweets in the matrix W get smaller, the Tweets become irrelevant to the topic.

Hence, we set the threshold as 0.01 to filter out any irrelevant Tweets to a topic. If

there is a spike in the plot, this indicates a sudden increase of the Twitter activity

regarding a topic. We, then, can assume that something unusual is happening

during those times. From Table 4.6, the topic number 41 was about money. In the

upper left plot of Figure 4.8, we see that there is a spike near April 31st. Note that

Tax Day of 2015 was on April 15th. We believe that the cause of the spike is from

the combination of tax season and the first payday after Tax Day for those who get

paid at the end of a month.

The topic numbers 5, 23, and 24 from Table 4.6 could fall into the time when the

Baltimore protest was happening as they describe body parts and aches, prayers, Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 133

Topic Number Relevant Words Topic crying #4 laughing Emotions started tears omfg hurt Body parts #5 stomach and aches feet body legs hhtfitness Fitness and #16 halfbamhalfamazintraining Spam llc personaltrainer personaltraining god #23 bless Prayers blessing dear pray heart #24 broke Heartbroken question broken breaking money #41 spend Money making spending save Table 4.6. 6 out of 300 topics are listed. The left column lists the topic number, the center column lists the 5 most relevant words, and the right column lists the topic. We exclude any topics that contain illegal substances, explicit words, or curse words.

and heartbreaks, respectively. We, again, turn to the Tweet frequency plots for

these. Note that the protest turned very violent and reached its peak around

April 26th to April 30th. The plot of the topic number 5 that describes body parts Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 134

Topic Number 41 Topic Number 5 Tweet Numbers Tweet Numbers Tweet 40 60 80 100 120 140 160 20 40 60 80 100 120 140 160

4/1 4/30 5/31 6/30 7/31 8/31 4/1 4/30 5/31 6/30 7/31 8/31

Days Days

Topic Number 23 Topic Number 24 Tweet Numbers Tweet Numbers Tweet 40 60 80 100 120 140 40 60 80 100 120 140 160

4/1 4/30 5/31 6/30 7/31 8/31 4/1 4/30 5/31 6/30 7/31 8/31

Days Days

Figure 4.8. (Top left) The Tweet frequency plot of topic 41, money. (Top right) The Tweet frequency plot of topic 5, body parts and aches. (Bottom Left) The Tweet frequency plot of topic 23, prayers. (Bottom Right) The Tweet frequency plot of topic 24, heartbreaks. and aches is located on the upper right plot of Figure 4.8. We do see a slight spike around the end of April, which may indicate the possible injuries from the protests. However, the plot is rather flat compared to the plot of the topic number

41 (money) located on the upper left side. This suggests that we can not conclude that this topic solely represents the protest. Similarly, the plot of the topic number

23 located on the lower-left corner of Figure 4.8 is rather flat as well. This is not surprising as many individuals are religious in the US. On the other hand, the plot Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 135 of the topic number 24 located on the bottom right of Figure 4.8 clearly shows a spike near the end of April. This suggests that the Baltimoreans were heartbroken by the , the death of Freddie Gray, and the casualties of the violent protests. Unfortunately, the hashtags that represented the death of Freddie Gray, freddiegray, justiceforfreddigray, or baltimoreriots, did not make the cut of 20 most relevant words for all 300 topics.

Table 4.7. Five interesting topics found by the NMF with the 300 topics.

Topic Relevant Words Tweet Frequency Plot

Mother’s day Topic Number 152

and mothers

Father’s fathers

day pay Tweet Numbers Tweet

end 200 400 600 800

4/1 4/30 5/31 6/30 7/31 8/31 Days Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 136

Prom prom Topic Number 170

season dress

date

pictures Tweet Numbers Tweet

pics 0 50 100 150 200 4/1 4/30 5/31 6/30 7/31 8/31 Days

Floyd fight Topic Number 222

May- wanted

weather tryna

Vs. Manny win Tweet Numbers Tweet

Pacquiao mayweather 0 100 200 300 400 500 4/1 4/30 5/31 6/30 7/31 8/31 Days

Bet bet Topic Number 227

Awards awards

ared

ciara Tweet Numbers Tweet 50 100 150 200 lovingg

4/1 4/30 5/31 6/30 7/31 8/31 Days Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 137

Release of watch Topic Number 269

OITNB netflix

tv

movies Tweet Numbers Tweet

rt 0 100 300 500 700 4/1 4/30 5/31 6/30 7/31 8/31 Days

In the following Table 4.7, we list interesting events that NMF with 300 topics

detected. The first row of Table 4.7 is about Mother’s and Father’s day. They were on May 10th and June 21st of 2015, respectively. We see a huge spike on

both of those days in the Tweet frequency plot, which confirms the most relevant words for this topic. The second row is about prom season. Many high schools

tend to have proms around April and May. We see spikes throughout April and

May, and the plot instantly flattens once we reach June and onward. All five most

relevant words, “prom”, “dress”, “date”, “pictures”, and “pics”, also describe the

prom perfectly as well. The third row is about a boxing match between Floyd

Mayweather and Manny Pacquiao. Many described this match to be “the fight of

century”. This event happened on May 2nd as shown by the huge spike on the

plot. The fourth row is about the Bet Awards that happened on June 28th. The top

two relevant words, “bet” and “awards”, perfectly describe the topic. The third word, “ared”, is slang for alright that originated from , and “ciara” is

a female musician who was a nominee in the Bet Awards. The last row is about

the release of popular Netflix show Orange is the New Black (OITNB). This show’s

season 3 was released on June 11th. We suspect that the word “rt”, an abbreviation Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 138

of a retweet, was used often for a Tweet about OITNB and its advertisement. The

actual word “ointb” was ranked as a 12th relevant word.

Notice that the topic numbers of the events in Table 4.7; they all fall in the sec-

ond half of 300. As a reminder, we sorted the topics in a decreasing manner during

the post-processing to prioritize the more important topics to the entire data. These

listed events in Table 4.7 happened for a day or two with an exception of the prom

season topic. This indicates that even though they are important enough to form

a topic, they are not as important of a topic for the entire data. Referring back to

Figure 4.8, notice that all 4 topics fall within the top 50 sorted topics. Although we

can distinguish the spikes for some of the plots, the spikes are not as obvious as

the ones in Table 4.7. This confirms that performing NMF on the entire data favors

the topics that are relevant to the entire duration of data set rather than one day worth of an event.

Lastly, we discuss the result of the 200 topics, and why we think that using the

300 topics is better to analyze the data. There are many overlapped topics between

the results of 200 and 300 topics. About 109 topics out of 200 are shared between

the two. The only difference within those shared topics are the rankings of relevant words. They usually have the same most relevant word, and the rest would be

different. We display the same topics from Table 4.7 that can be also found in the

200 topics.

Unfortunately, NMF of 200 topics is not able to form a topic on the boxing

match of Floyd Mayweather vs. Manny Pacquiao and prom season. Comparing

Tables 4.8 and 4.7, we see that both rank the same first word for all the topics’ rele- vant words. However, the rest of the relevant words are different. In Table 4.8, we Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 139

Table 4.8. We list the same topics from Table 4.7 that were also found from 200 topics.

Topic Relevant Words Tweet Frequency Plot Mother’s day Topic Number 152 and long Father’s mothers day beautiful great Tweet Numbers Tweet 200 400 600 800

4/1 4/30 5/31 6/30 7/31 8/31 Days

Bet bet Topic Number 153 Awards ard awards ared ciara Tweet Numbers Tweet 50 100 150 200 250

4/1 4/30 5/31 6/30 7/31 8/31 Days

Release watch Topic Number 117 of 1 OITNB movie netflix show Tweet Numbers Tweet 0 200 400 600 4/1 4/30 5/31 6/30 7/31 8/31 Days

have “day”, “long”, “mothers”, “beautiful”, and “great” for the topic of Mother’s

and Father’s Day. Looking at the most relevant words alone, it is arguable that

this topic is only about Mother’s Day as “fathers” did not make the cut. The way we know that this topic also includes Father’s Day is by looking at the Tweet fre-

quency plot, which is the same as of Table 4.7. The word “fathers” is ranked as

the 7th most relevant word. Looking at the Bet Awards in Table 4.8, we see that Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 140

Topic Number 189 Tweet Numbers Tweet 100 300 500 700

4/1 4/30 5/31 6/30 7/31 8/31 Days

Figure 4.9. Both methods of NMF with 200 and 300 topics are able to capture this topic, the holidays. We see the spikes on Easter (April 5th), Mother’s Day (May 10th), Father’s Day (June 21st), and Independence Day (July 4th). The relevant words for this topics are:“happy”, “bday”, “makes”,“easter”, “mothers”. The word “fa- thers” was ranked as the 7th relevant word, and “4th” and “july” ranked as the 8th and 11th relevant words, respectively.

the rank of the word “awards” lowered by one compared to Table 4.7. Also, an-

other word “ard” has been introduced to the list; this word has the same meaning

as “ared”. Similarly for the topic of the release of OITNB, we see that the word

“1” and “show” have been introduced to the list. Although “show” gives more information about the topic than “rt”, the overall ranking of the words are not as informative as the 300 topics’. The actual title of the show “oitnb” did not make it to the list of top 20th relevant words. If we do not have the information from the

300 topics, we would not have known the specifics of this topic. Although some Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 141

Total Number of Topics Number of Understandable Topics Proportions 300 100 100/300 ≈ 0.333 200 105 105/200=0.525 100 61 61/100=0.61 Table 4.9. We calculate the proportions of understandable topics from the topics given by NMF. The first column lists the number of topics declared in NMF. The second column lists the number of un- derstandable topics, and the third column calculates the proportions of the understandable topics within all topics.

of the same informative topics with the same rankings of relevant words between

the two topic numbers could be found, see Figure 4.9, the overall results of the 300

topics yield much better and informative rankings of the relevant words.

4.8.3 The NMF of Hashtags

Another way to analyze the data is to perform NMF on only hashtags. To see

how we extract hashtags from the Tweets, see Section 4.5. The hashtags may be

more informative than the Tweets as they only contain key phrases or themes. The

drawback of using hashtags on NMF is that it limits the analysis of data only to

the Tweets that contain hashtags. Out of 2,207,180 cleaned Tweets, only 235,466

Tweets contained hashtags. Similar to NMF of entire data, we use 100, 200, and

300 topics to see which number of topics gives the best result.

In Table 4.9, we list the proportions of understandable topics for each 100, 200,

and 300 topics. Note that the number of understandable topics is subjective to the

analyzer. Unlike NMF of the entire data, the 300 topics perform poorly compared

to the other two, and the 100 topics perform the best. Between the 100 and 200

topics, we, again, see many overlapping topics. 59 out of 100 topics overlap. Al-

though the 100 topics produce the best result, there are many important topics that Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 142

it misses that the other two are able to form. For this reason, we focus on the result

of the next best number, the 200 topics.

Performing NMF using 200 topics on the hashtags is able to form all the topics

from Table 4.7. Furthermore, it is able to find events that NMF using the 300 topics

on the Tweets is not able to find. There are many new topics of TV shows including

Pretty Little Liars, Bad Girls Club, Love & Hip Hop: Atlanta, Teen Wolf, Fear the Walking

Dead, Grey’s Anatomy, and Game of Thrones, which NMF on the Tweets is not able to catch. It also forms new topics on politics, news channels, various sports, and social issues other than the death of Freddie Gray. None of the relevant words for these new topics are in the 20 relevant words for all 300 topics for the NMF Tweet analysis. The two social issues that 200 topics of hashtags are able to detect are the and Charleston church shooting. Note that the 100 topics of hashtags and the 300 topics of Tweets are not able to catch these two social issues.

To read more about these social issues, see AppendixA.

On top of these social issues, the 200 topics of NMF on the hashtags is able to form 6 topics on the death of Freddie Gray. In Table 4.10, we list the relevant hash- tags and their Tweet frequency plots per topic. We only show 5 out of 6 topics, as we are not able to provide explanations for some relevant hashtags in the un- listed topic. The Tweet frequency plots, located in the second column of Table 4.10, show spikes near the mid and end of April. Again, the protests for the death of

Freddie Gray started on April 18th, and they got violent around the 26th. We can also see a smaller spike in early September from the plots of second, fourth, and

fifth row of Table 4.10. The pretrial of the six police officers who were involved in the death of Freddie Gray started on September 2nd. We provide explanations Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 143

for some of the relevant hashtags that are not straightforward. Once the protests

got violent, there were involving looting and arson; hence, the hashtag “bal-

timorelootcrew” was used. We believe that the hashtag “social” comes from so-

cial issues, and “” is one of the many TV channels that covered the Baltimore

protest. In the fourth row of Table 4.10, the hashtag “nellawarephotography” is a

photographer who captured the Baltimore protests and its aftermath on camera.

The hashtag “blackspring” is a movement where who were

underprivileged coming together and advancing new solutions, new visions, and

new demands to create a new world where Black peoples lives matter [42]. Lastly, we are not certain, but the hashtag “michaeljohnson” may be a neighbor of Freddie

Gray who was involved in many interviews regarding the protests.

Table 4.10. The selected topics on the death of Freddie Gray.

Relevant Hashtags Tweet Frequency Plot

baltimoreriots Topic Number 17

baltimorepolice

baltimorelootcrew

social Numbers Tweet

cnn 0 100 300 500 700 4/1 4/30 5/31 6/30 7/31 8/31 Days Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 144

freddiegray Topic Number 39

baltimoreprotests

baltimorepolice

breaking Numbers Tweet

bmoreunited 0 50 150 250 350 4/1 4/30 5/31 6/30 7/31 8/31 Days

prayforbaltimore Topic Number 96

baltimorestrong

prayforpeace

justice Numbers Tweet

pray 0 50 100 150 200 4/1 4/30 5/31 6/30 7/31 8/31 Days

baltimoreuprising Topic Number 168

nellawarephotography

bmoreunited

justice Numbers Tweet

blackspring 0 50 100 150 200 4/1 4/30 5/31 6/30 7/31 8/31 Days Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 145

blacklivesmatter Topic Number 193

alllivesmatter

justice

justiceforfreddie Numbers Tweet

michaeljohnson 0 50 100 150 4/1 4/30 5/31 6/30 7/31 8/31 Days

Comparing the two different input data, Tweets and hashtags, of NMF, we can

safely say that the hashtags provide more informative topics on the events that

happened during the data time frame. However, as the hashtags tend to focus

more on the events, TV shows, and sports, it fails to provide any information on

Twitter users’ opinions, thoughts, or feelings. The Tweets are at better use when it

comes to the user thoughts, such as being able to form a topic on heartbreak and

body aches. The one drawback of hashtags is the possible data unavailability. As

mentioned before, not every Tweet contains hashtags. If we were to perform NMF

of the hashtags for a short period, we may not have enough hashtags to do so. We

look into the result of NMF using one day’s worth of data for both hashtags and

Tweets in the next section.

4.9 Building the Prediction Tool

In the previous sections, we have shown the identifications of outliers using quan-

tiles and the Twitter data analysis using NMF. We now combine all the previously

mentioned methods to create a tool that is able to predict a civil unrest. Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 146

The flow chart in Figure 4.10 outlines the process of the tool that will ulti-

mately predict civil unrest. The first step is to identify any outliers within the

data. Depending on the data availability, one may choose as many previous days

and weeks of data to calculate the quantiles. However, at least one full day of

data is required. The reason behind this is that the number of Tweets varies as the

day progresses, as shown in Figure 4.2. We recommend using data from one prior week or more, if possible, as it averages out the unusual and unexpected Tweet

numbers. The quantiles can be calculated similarly as in Section 4.6.1; the quantile

calculations are done hour by the hour using the week-long information. We ex-

tract the Tweet number of the same hour from all 7 days in the past, then calculate

appropriate quantiles and repeat this for all 24 hours. This way, the quantiles that we obtain are more representative of each hour. Once we have the quantiles, we

identify the outliers by finding which hour(s) exceeded the 97.5th quantiles from

the current data. We chose to use the 97.5th quantile as it is able to filter out more

than the 95th quantile but not as extreme as the 99th quantile. We assume that the

data is flowing in simultaneously, and we are using the data from the same day

that it was accessed. If there are unusual amounts of Tweets highlighted by the

outliers of quantiles, this may indicate a significant event in the examined commu-

nity. However, there is a possibility that the unusual activity is caused by spam

accounts or for no particular reason. Hence, we need to analyze the Tweets in de-

tail to determine whether there is any significant event going on. To do so, we use

NMF as it forms relevant topics of the Tweets. Using the topics from NMF is much

more efficient in terms of time and computation cost than parsing through all the

Tweets. The next step is to obtain the input matrix for NMF. After identifying the Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 147

outlier hour, we extract the data from 24 hours prior to that outlier hour. The rea-

son behind using one day’s worth of data is that there are not enough Tweets for

NMF to form sensible topics if we feed in any fewer Tweets than a day. We, then,

proceed to clean the data as shown in Section 4.3. We create a dtm and tf-idf matri-

ces from the cleaned data, and finally, feed it into NMF. Since the number of Tweets

being analyzed is significantly smaller than the number of Tweets of Section 4.8.2,

NMF requires a much smaller number of topic numbers as well. We tried various

number of topics and found that 30 topics yielded the best topics.

Obtain Identify input Clean Read topics data NMF outliers data

Figure 4.10. The flow chart of the civil unrest prediction tool. The process goes from the left to right.

4.9.1 Testing the Tool

We now test the tool to see if it is able to predict the Baltimore protest. We specif-

ically focus on the start of violent protests as they are more of a threat to society

than the peaceful protests. Recall that the violent protests started on April 26th.

We perform this tool using the Tweets from April 26th. In Figure 4.11, we plot

the number of Tweets per hour from April 26th. We calculate the 97.5th quantile

hourly using the number of Tweets from April 18th to 25th. The outlier hours are

2, 4, 5, 6, 7, 14, 15-18, and 20-21, as indicated by the black circles in the figure. We

look more in detail of hours 2, 14, and 21 by performing NMF and finding topics

related to the Baltimore protest. Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 148 Number of Tweets 200 400 600 800 1000 1200

5 10 15 20

Hours

Figure 4.11. We identify the outlier hours of the number of Tweets using the 97.5th quantile from the entire day of April 26th. The 97.5th quantile is in red curve, and the 2.5th quantile is in the blue curve. The outlier hours are highlighted as the black circles.

We also investigate April 25th at 11 pm, an outlier from the 97.5th quantile, to

see the progression of the civil unrest. However, there are not any topics related

to Freddie Gray nor Baltimore protests. In Table 4.11, we list the ten most relevant words for a topic on Freddie Gray and the Baltimore protest. From the left to right

column, the words are from the outlier hours of 2, 14, and 21. As a reminder, we Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 149

4/26 2 am 4/26 2 pm 4/26 11 pm crazy baltimore baltimore baltimore crazy city downtown city freddiegray city freddiegray wild people downtown md freddiegray protest trending md wild httptcomcml2wymlo protest md protest smh trending praying girl httptcomcml2wymlo safe Table 4.11. We list the ten relevant words from the topics of NMF. From left to right column, these relevant words are from the outlier hours 2 am, 2 pm, and 11 pm of April 26th.

extract data from 24 hours prior to the examination hour to use as an input matrix

for NMF. For example, we used the Tweets from April 25th, 2 am to April 26th,

2 am to obtain the topic of Freddie Gray and its relevant words from NMF. The word “md” stands for Maryland, and “smh” is an abbreviation for shake my head.

We did not check the link in the table as it is most likely spam. We can see that

the word “freddiegray” becomes more relevant as the day progresses. It first starts

out as the 6th most relevant word at 2 am to the 3rd most relevant word at 11

pm. This indicates that the Tweets including the hashtag “freddiegray” increased

throughout the day.

This tool successfully found a topic of Freddie Gray and the Baltimore protests

by 2 am on the day the violent protests started. If this tool is implemented to

predict civil unrest, it can be run as often as one needs as the whole process takes

less than 3 minutes. When the results of this tool seem alarming, the authorities

can take appropriate measures to prepare for the probable civil unrest. Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 150

Notice that we do not specify whether we only used Tweets or hashtags for

the input matrix of NMF. Since we are only looking at one day worth of data,

or approximately 12,000 to 15,000 Tweets, there are not enough Tweets to extract

hashtags and perform NMF that would yield informative topics. Not all Tweets

contain hashtags, in fact, only about 10% of the Tweets in our data set contained

hashtags. Using this information, it indicates that there are about 1,200 to 1,500

Tweets that contain hashtags per day. We can not be certain that all those Tweets’

hashtags are unique, which further brings down the number of unique hashtags as well. Instead, as there are not too many Tweets, we expect to see important hash-

tags come up in the topics along with relevant regular words used in the Tweets.

This is confirmed by Table 4.11 as “freddiegray” is one of the hashtags that Bal-

timoreans used in the Tweets about the death of Freddie Gray and the Baltimore

protest.

4.10 Discussion

The goal of this chapter is to build a tool that will be able to predict civil unrest.

Any upcoming or ongoing events can be identified by examining public Tweets.

However, it is also important to be efficient in time and computational cost during

the examination. Instead of parsing through every Tweet, Winterer has shown

that the quantiles are a good method to identify the possible civil unrest in [138].

We further the development of the tool by implementing pre-processing steps and

NMF. We also provide a thorough analysis of the given Twitter data.

We clean the data to prepare it for NMF and explore the different sources of

input matrix for NMF. Although the hashtags are from the Tweets, the results of Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 151

NMF are vastly different between the two. When using the Tweets as the input, we see that the topics are more opinions and feelings of the Twitter users oriented.

On the other hand, when the hashtags are used, the topics are much more events,

TV shows, and sports oriented. These results are not surprising as the hashtags are

heavily used to promote such topics. Although NMF of the Tweets do not fail to

form topics on the events, TV shows, or sports, it just is not able to capture as many

as the hashtags. We also explore the optimal number of topics to be used in NMF.

We discover that while many of the topics overlap between the topic numbers in

question, the 300 topics for the Tweets and the 200 topics for the hashtags form the

most informative topics.

We also perform the sentiment analysis on the data set. Our goal for this is

that, if the sentiment analysis kit is able to correctly identify the sentiments of the

Tweets, we can also use the sentiment score to detect the civil unrest. If the Twitter

community is happy, the sentiment score should be closer to 1. If they are neutral,

the sentiment score should be closer to 0. Lastly, if the community is unhappy,

the sentiment score should be closer to -1. Our thought is that as the protests get violent, the sentiment score should also decrease. Note that the protests started

peacefully and quickly turned violent. However, the problem is that the sentiment

analysis tool kit that we used does not correctly identify the Tweets that are related

to the death of Freddie Gray as a negative sentiment. Instead, it identifies most of

them as a neutral sentiment. We do see a huge increase in the neutral sentiment

during the time of violent protest, but we can not heavily rely on the scores as

the majority of the Tweets, in general, scored 0. These neutral sentiment Tweets

include some non-protest related Tweets that we think they should score in other Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 152

categories. To effectively use and incorporate the sentiment analysis into the pre-

diction tool, we would need to relabel data and train the sentiment analysis kit

again.

We lastly put together the methods to create a tool to predict civil unrest. The

process proceeds as follows:

(1) Calculate the 97.5th quantile using the information from the past

(2) Identify outliers of the current data using the quantiles

(3) Prepare the data in question

(a) Extract data from 24 hours prior to the hour when the outlier occurred

(b) Clean the extracted data

(4) Perform NMF

(5) Analyze the topics by searching keywords

We test this tool on the day the violent protest began, and we successfully capture

the start of violent protests. The time of data that we found such alarming topics

is at 2 am. This would give enough time for the authorities to take appropriate

measures as we predict the probable civil unrest at such early hours.

4.11 Future Work

Although we successfully created a tool that shows promise for predicting civil

unrest in real-time, there are many parts that could be improved. First, the data

could be cleaned further. Stemming and lemming the words could strip down the words to their most basic form. We are not able to do so, as this brought up more

complications. However, if we have more time, stemming and lemming words

could cut down the list of unique words and possibly resulting in more precise and Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 153

accurate topics from NMF. Recall that we remove anything that is not an alphabet

or numbers, which includes emojis. The analysis of emojis could be interesting as well. We also have seen the website links come up in the topics. This indicates

that the links are being tweeted enough to make it in the most relevant words. For

this project, we have assumed that all the links are spams and virus downloaders,

and we never check the links out of fear. As much as this is plausible, there is

also a chance that these links are related to an event in question. Twitter users can

Tweet links to an article or website related to an event. Further analysis of these

links can be useful as long as we have a way to tell whether the link is hazardous

beforehand.

Recall that our data set includes much more information than the Tweets and

their time stamp. It also includes the geo-locations and the user information given

in their small biography section. Although all the Tweets are from Baltimore, the

geo-locations allow more precise locations of where these Tweets were from. We

can use geo-locations to form hotspots. If one area has more traffic than the oth-

ers, this may indicate where the significant event may be happening. Not every

Twitter user provides their information in the biography section. Even if they do,

the content may not be informative. However, this may be used to filter out the

spam accounts, or this may provide more details about the users who are using a

hashtag that is related to a significant event.

The biggest disadvantage of NMF is the topic identification by the investigator.

We have consistently mentioned that the number of understandable topics may vary when analyzing the topics. As there are many Tweets about TV shows and current events in the entertainment world, if the investigator is not up to date, the Predicting Civil Unrest Using Twitter Data from the 2015 Baltimore Protest 154

total number of understandable topics will significantly vary from one investigator

to another. It would be nice to see a program that takes in words and summarizes

them by outputting a key phrase. Another disadvantage of NMF is determining

the optimal topic number. This is an active research topic, and the program R has a

package called nmfEstimateRank that provides the optimal number of topics using residual, Cophenetic correlation, and residual sum of squares. However, we are not able to utilize this package as our data set was too big. Instead of guessing and checking the number of topics to find an optimal number of topics, it would be much more reliable to come up with a method that will be able to determine such value.

As mentioned before, the lack of correct sentiment score categorization of the sentiment analysis calls for the kit to be retrained according to our own data set.

We believe that when the retraining is done, the sentiment analysis of the Tweets will be much more insightful. 155

5 Conclusions

We presented three projects with the underlying theme of human dynamics.

We especially focused on human collective motion and communications. In one of the collective motion projects, Chapter2, we compared and matched the Social

Force model by Helbing et al. with a real-life evacuation experiment. The lack of

social influence within the particles of the Social Force model was shown as the

results could not match the experimental data as well. The model failed to show

a “slower is faster” effect, which suggested that the model left something to be

desired and failed to capture the essence of the real-life experiment. We had also

shown the parameter B, the characteristic length scale of interaction range, was

more important to the model than the parameter A, the interaction strength. It was clearly shown that the model favored lower values of B, whereas A did not

show any particular patterns within the best fit parameter sets.

We presented another project on the collective motion in Chapter3. We tested

out the scaling claim by Barbaro et al. using the Vicsek model. We hoped to see

the system maintaining its behavior as we scale the parameter sets while changing

the number of particles. We used two different simulations involving particle col-

lisions to measure the system alignment. We found that the non-scaled parameter Conclusions 156 sets preserved the system behavior, but the scaled parameter sets were not able to. We also implemented repulsion by Barbaro et al. to the Vicsek model and car- ried out another type of collision. Through statistical testing, we concluded that regardless of the scaling and implementing repulsion, the system behavior did not preserve as the number of particles changed. We also found that none of the cases for scaling and repulsion performed better than the others. Hence, our research indicated that the scaling claim was not valid as stated.

Lastly, we discussed the communication part of human dynamics using social media in Chapter4. We focused on Twitter and the Tweets from the 2015 Baltimore protests. We detected several events within the data using Nonnegative Matrix

Factorization (NMF). We also built a tool that predicted civil unrest in its early stage using the combination of thorough data cleaning, detecting unusual Twitter activity by quantiles, and using NMF to detect the civil unrest. This tool was fast and did not require a heavy computation cost when predicting civil unrest. Appendix 157

Appendix A Social Issue Events Detected by NMF

We present additional social issues that NMF detected using 200 topics in Chap-

ter4. In Table A.1, we list the topic, relevant hashtags, and tweet frequency plots

for both social issues. We honor and remember the victims by covering these two

topics. The first social issue is about the death of Sandra Bland that happened on

July 13th, 2015. Sandra Bland was a 28-year-old female African American who was arrested and charged for assault of a police officer and died 3 days after her

arrest in a jail in Texas. She was originally pulled over for a minor traffic violation,

and she was found hanging at the time of death. It is believed that police brutal-

ity was involved in this case, and nationwide protests were invoked. The hashtag

Table A.1. The two social issues found by NMF using hashtags.

Topic Relevant Hashtags Tweet Frequency Plot Death of sandrabland Topic Number 42 Sandra Bland justiceforsandrabland whathappenedtosandrabland ripsandrabland Tweet Numbers Tweet 0 20 40 60 80 100 4/1 4/30 5/31 6/30 7/31 8/31 Days

Charleston charlestonshooting Topic Number 153 church charleston shooting dylannroof ameshooting spawnofsatan Tweet Numbers Tweet 50 100 150 200 250

4/1 4/30 5/31 6/30 7/31 8/31 Days Appendix 158

“sayhername” is a social movement that seeks to raise awareness for black female victims of police brutality and anti-black violence in the United States [3]. We see

a significant spike around the second half of July. The protests regarding Sandra

Bland’s death happened from July 15th to 29th. We also see a smaller spike around

mid to end of April, the peak time of Baltimore protests. Some of the overlapping

hashtags are about police brutality, which was the main reason of the protests for

the death of Freddie Gray.

The second social issue is about the Charleston church shooting that happened

on June 17th, 2015. This mass shooting occurred at the Emanuel African Methodist

Episcopal Church in Charleston, South Carolina that resulted in 9 deaths and 1

injury. This church is one of the oldest black churches in the United States. The

shooter, , was a white supremacist, and his motive was to start a racial war [6]. The hashtag in Table A.1 “ameshooting” stands for African Methodist

Episcopal shooting, and Dylann Roof was often referred to as spawn of Satan, as

one of the relevant hashtags suggests. Appendix 159

Appendix B One-Way Analysis of Variance (ANOVA) of the Four Cases

In Chapter3, we only statistically test the cases with a common condition (i.e. scaling and/or repulsion). However, in this Appendix, we use one-way ANOVA to determine whether there are any statistically significant differences between the means of these cases. Recall that the raw data from these cases are not normally distributed. As one-way ANOVA also require normality from the data, we use the log transformation again. Let mi to be the mean value of a case i, the null hypothesis, H0, to be H0 : m1 = m2 = m3 = m4, and the alternative hypothesis,

Ha, to be Ha : Means are not all equal. We use the significance level of α = 0.05, and the total number of transformed data is n = 60.

df Sums of Squares Mean Squares F p-value GP 3 10.08 3.3599 1.0526 0.3766 Residuals 56 178.76 3.1921 LP 3 2.004 0.66809 0.2427 0.8662 Residuals 56 154.147 2.75263 FLP 3 2.778 0.92616 0.3068 0.8204 Residuals 56 169.048 3.01872 Table B.1. We list the degrees of freedom (df), sum of squares, mean squares, statistic (F), and p-values from one-way ANOVA between all cases. We list the said values of the log absolute average differences of global, local, and fixed local polarities, respectively.

In Table B.1, we list the degrees of freedom (df), sum of squares, mean squares, statistic (F), and p-values from one-way ANOVA between all cases. We see that all the p-values of the log absolute average differences of the polarities are greater than the significance level α = 0.05, and we fail to reject the null hypothesis. This in- dicates that there is no significant difference between the mean values of all cases. Appendix 160

This suggests that none of the cases are better at preserving the system behavior

than the others as we vary N, as expected.

Recall that few of the data did not have homogeneity variances, and one-way

ANOVA also assumes the homogeneity variances. We do not have to worry about

going against the assumption as F is very close to 1 for the global polarity. The

statistic is calculated by finding the ratio between the sample variances of the cases.

F being close to 1 means that the variances are very similar to one another, and we

can assume the homogeneity. For the local and fixed local polarity, we see the the

F-values are not close to 1. There is a rule of thumb for one-way ANOVA that it is

robust to the heterogeneity of the variances as long as

Biggest Variance < 4 × Smallest Variance.

This rule of thumb holds for our data as it can be seen in Table 3.9, and we, again,

can assume the homogeneity of variances for the local and fixed local Polarities. Bibliography 161

Complete References

[1] Emergency Action Plan- Evacuation Elements. https://www.osha.gov/SLTC/ etools/evacuation/evac.html. Accessed: 2019-12-10.

[2] Emergency Planning. https://www.ccohs.ca/oshanswers/hsprograms/ planning.html. Accessed: 2019-12-10.

[3] #SayHerName: Reisisting Police Brutality Against Black Women. https:// aapf.org/sayhernamereport/. Accessed: 2020-04-08.

[4] The Cube. https://icat.vt.edu/studios.html. Accessed: 2020-03-20.

[5] (2014). The Center for Human Dynamics in the Mobile Age. https:// humandynamics.sdsu.edu/index.html. Accessed: 2020-05-03.

[6] (2015). Church shooting suspect Dylann Roof captured amid hate crime inves- tigation. https://www.washingtonpost.com/news/morning-mix/wp/2015/06/ 17/white-gunman-sought-in-shooting-at-historic-charleston-african- ame-church/. Accessed: 2020-04-08.

[7] (2015). Freddie Gray: A Timeline From His Arrest To Today. https: //baltimore.cbslocal.com/2016/05/23/freddie-gray-a-timeline-from- his-arrest-to-today/. Accessed: 2019-12-16.

[8] (2015a). PDF: Charging documents for Freddie Gray . https://www. baltimoresun.com/news/crime/bal-charging-documents-for-freddie-gray- 20150420-htmlstory.html. Accessed: 2019-12-16.

[9] (2015b). Timeline: Freddie Gray’s arrest, death and the aftermath. http:// data.baltimoresun.com/news/freddie-gray/. Accessed: 2019-12-16.

[10] (2019). The Story of 2019: Protests in Every Corner of the Globe. https:// www.newyorker.com/news/our-columnists/ the-story-of-2019-protests-in- every-corner-of-the-globe. Accessed: 2019-12-10.

[11] Albi, G., Balague,´ D., Carrillo, J., and von Brecht, J. (2013). Stability analysis of flock and mill rings for second order models in swarming. SIAM Journal on Applied Mathematics, 74(3):794–818.

[12] Alizadeh, R. (2011). A dynamic cellular automaton model for evacuation pro- cess with obstacles. Safety Science, 49(2):315–323. Bibliography 162

[13] Alsaedi, N., Burnap, P., and Rana, O. (2017). Can we predict a ? disruptive event detection using twitter. ACM Transactions on Internet Technology, 17(2):1– 26.

[14] Alsenafi, A. (2016). Segregation Dynamics Motivated by Territorial Markings: The Transition from a Particle to a Continuum Model. PhD thesis, Case Western Reserve University.

[15] Alsenafi, A. and Barbaro, A. (2018). A convection-diffusion model for gang territoriality. Physica A: Statistical Mechanics and its Applications, 510:765–786.

[16] An, G., Mi, Q., Dutta-Moscato, J., and Vodovotz, Y. (2009). Agent-based mod- els in translational systems biology. Wiley Interdisciplinary Reviews: Systems Biology and Medicine, 1(2):159–171.

[17] Aramaki, E., Maskawa, S., and Morita, M. (2010). Twitter catches the flu: detecting influenza epidemics using twitter. Proceedings of the conference on empirical methods in natural language processing, pages 1568–1576.

[18] Bakshy, E., Hofman, J., Mason, W., and Watts, D. (2011). Everyone’s an influencer: quantifying influence on twitter. Proceedings of the fourth ACM international conference on Web search and data mining, pages 65–74.

[19] Balague,´ D. and Carrillo, J. (2012). Aggregation equation with growing at in- finity attractive-repulsive potentials. In Hyperbolic Problems: Theory, Numerics and Applications, 2:136–147.

[20] Balague,´ D., Carrillo, J., Laurent, T., and Raoul, G. (2013a). Dimensionality of local minimizers of the interaction energy. Archive for Rational Mechanics and Analysis, 209(3):1055–1088.

[21] Balague,´ D., Carrillo, J., Laurent, T., and Raoul, G. (2013b). Nonlocal interac- tions by repulsiveattractive potentials: radial ins/stability. Physica D: Nonlinear Phenomena, 260:5–25.

[22] Barbaro, A., Chayes, L., and D’Orsogna, M. (2013). Territorial develop- ments based on graffiti: A statistical mechanics approach. Physica A: Statistical Mechanics and its Applications, 391(1):252–270.

[23] Barbaro, A., Einarsson, B., Birnir, B., Sigurosson, S., Valdimarsson, H., Palsson,´ O., Sveinbjornsson,¨ S., and Sigurosson, P. (2009a). Modelling and simu- lations of the migration of pelagic fish. ICES Journal of Marine Science, 66(5):826– 838. Bibliography 163

[24] Barbaro, A., Taylor, K., Trethewey, P., Youseff, L., and Birnir, B. (2009b). Dis- crete and continuous models of the dynamics of pelagic fish: application to the capelin. Mathematics and Computers in Simulation, 79(12):3397–3414.

[25] Bauer, A. L., Beauchemin, C. A., and Perelson, A. S. (2009). Agent-based modeling of host-pathogen systems: The successes and challenges. Information sciences, 179(10):1379–1389.

[26] Bernoff, A. and Topaz, C. (2011). A primer of swarm equilibria. SIAM Journal on Applied Dynamical Systems, 10(1):212–250.

[27] Bertozzi, A., Kolokolnikov, T., Sun, H., Uminsky, D., and Von Brecht, J. (2015). Ring patterns and their bifurcations in a nonlocal model of biological swarms. Communications in Mathematical Sciences, 13(4):955–985.

[28] Birnir, B., Einarsson, B., Bonilla, L., and Cornejo-Donoso, J. (2017). Ordered, disordered and partially synchronized schools of fish. International Journal of Nonlinear Sciences and Numerical Simulation, 18(2):163–174.

[29] Bollen, J., Mao, H., and Zeng, X. (2011). Twitter mood predicts the stock mar- ket. Journal of computational science, 2(1):1–8.

[30] Boltes, M., Zhang, J., Tordeux, A., Schadschneider, A., and Seyfried, A. (2019). Empirical results of pedestrian and evacuation dynamics. Complex Dynamics of Traffic Management, pages 671–699.

[31] Bonabeau, E. (2002). Agent-based modeling: Methods and techniques for simulating human systems. Proceedings of the national academy of sciences, 99:7280–7287.

[32] Bourgois, L. and Auberlet, J.-M. (2014). Pedestrian agent based model suited to heterogeneous interactions overseen by perception. In Pedestrian and Evacuation Dynamics 2012, pages 847–859. Springer.

[33] Brubaker, D., Barbaro, A., Chance, M., and Mesiano, S. (2016). A dynamical systems model of progesterone receptor interactions with inflammation in human parturition. BMC systems biology, 10(1):79.

[34] Butail, S., Bartolini, T., and Porfiri, M. (2013). Collective response of zebrafish shoals to a free-swimming robotic fish. PLoS One, 8(10):e76123.

[35] Cadena, J., Korkmaz, G., Kuhlman, C., Marathe, A., Ramakrishnan, N., and Vullikanti, A. (2015). Forecasting social unrest using activity cascades. PloS one, 10(6). Bibliography 164

[36] Camazine, S., Deneubourg, J., Franks, N., Sneyd, J., Bonabeau, E., and Ther- aula, G. (2003). Self-organization in biological systems. Princeton university press, 7.

[37] Carscadden, J., Nakashima, B., and Frank, K. (1997). Effects of fish length and temperature on the timing of peak spawning in capelin (mallotus villosus). Canadian Journal of Fisheries and Aquatic Sciences, 54(4):781–787.

[38] Casella, G. and Berger, R. L. (2002). Statistical Inference. Thomson Learning.

[39] Cha, M., Haddadi, H., Benevenuto, F., and Gummadi, K. (2010). Measuring user influence in twitter: The million follower fallacy. Fourth international AAAI conference on weblogs and social media.

[40] Chate,´ H., Ginelli, F., Gregoire,´ G., Peruani, F., and Raynaud, F. (2008). Mod- eling collective motion: variations on the vicsek model. The European Physical Journal B, 64(3-4):451–456.

[41] Chen, G. (2016). Small noise may diversify collective motion in vicsek model. IEEE Transactions on Automatic Control, 62(2):636–651.

[42] Coleman, C. What Is Black Spring? , Co-Founder Of Black Lives Matter, Breaks Down The Baltimore Uprising. https: //newsone.com/3112797/what-is-black-spring-alicia-garza-co-founder- of-black-lives-matter-baltimore-uprising/. Accessed: 2020-04-08.

[43] Conover, M., Ratkiewicz, J., Francisco, M., Goncalves, B., Menczer, F., and Flammini, A. (2011). Political polarization on twitter. Fifth international AAAI conference on weblogs and social media.

[44] Crockett, Z. (2019). The tragic data behind Black Friday deaths. https:// thehustle.co/black-friday-deaths-injuries-data/. Accessed: 2020-02-16.

[45] Cucker, F. and Smale, S. (2007). Emergent behavior in flocks. IEEE Transactions on automatic control, 52(5):852–862.

[46] Czirok,´ A., Ben-Jacob, E., Cohen, I., and Vicsek, T. (1996). Formation of com- plex bacterial colonies via self-generated vortices. Physical Review E, 54(2):1791.

[47] Czirok,´ A., Vicsek, M., and Vicsek, T. (1999). Collective motion of organisms in three dimensions. Physica A: Statistical Mechanics and its Applications, 264(1- 2):299–304.

[48] Daamen, W. and Hoogendoorn, S. (2010). Capacity of doors during evacua- tion conditions. Procedia Engineering, 3:53–66. Bibliography 165

[49] Degond, P. and Motsch, S. (2008). Continuum limit of self-driven parti- cles with orientation interaction. Mathematical Models and Methods in Applied Sciences, 18(supp01):1193–1215.

[50] Dewangan, K. N., Owary, C., and Datta, R. K. (2010). Anthropometry of male agricultural workers of north-eastern India and its use in design of agricultural tools and equipment. International Journal of Industrial Ergonomics, 40(5):560– 573.

[51] DiGrazia, J., McKelvey, K., Bollen, J., and Rojas, F. (2013). More tweets, more votes: Social media as a quantitative indicator of political behavior. PloS one,, 8(11).

[52] D’Orsogna, M., Chuang, Y., Bertozzi, A., and Chayes, L. (2006). Self-propelled particles with soft-core interactions: patterns, stability, and collapse. Physical review letters, 96(10):104302.

[53] Edelstein-Keshet, L., Watmough, J., and Grunbaum, D. (1998). Do travelling band solutions describe cohesive swarms? an investigation for migratory locusts. Journal of mathematical biology, 36(6):515–549.

[54] Epstein, J. M. (2009). Modelling to contain pandemics. Nature, 460(7256):687.

[55] Fenton, J. and Green, E. (2015). Baltimore rioting kicked off with rumors of ‘purge’. https://www.baltimoresun.com/news/crime/bs-md-ci-freddie- gray-violence-chronology-20150427-story.html. Accessed: 2020-02-10.

[56] Ganar, R. and Ardhapurkar, S. (2016). Exploiting social network for forensic analysis to predict civil unrest. International J. Info. Sec. sand Cybercrime, 5:59.

[57] Gerber, M. (2014). Predicting crime using twitter and kernel density estima- tion. Decision Support Systems, 61:115–125.

[58] Go, A., Bhayani, R., and Huang, L. (2009). Twitter sentiment classification using distant supervision. CS224N project report, Stanford, 1(12).

[59] Goessmann, C., Hemelrijk, C., and Huber, R. (2000). The formation and maintenance of crayfish hierarchies: behavioral and self-structuring properties. Behavioral Ecology and Sociobiology, 48(6):418–428.

[60] Golbeck, J., Robles, C., Edmondson, M., and Turner, K. (2011). Predicting per- sonality from twitter. IEEE third international conference on privacy, security, risk and trust and IEEE third international conference on social computing, pages 149– 156. Bibliography 166

[61] Hegemann, R., Smith, L., Barbaro, A., Bertozzi, A., Reid, S., and Tita, G. (2011). Geographical influences of an emerging network of gang rivalries. Physica A: Statistical Mechanics and its Applications, 490(21-22):3894–3914.

[62] Helbing, D., Buzna, L., Johansson, A., and Werner, T. (2005). Self-organized pedestrian crowd dynamics: Experiments, simulations, and design solutions. Transportation science, 39(1):1–24.

[63] Helbing, D., Farkas, I., and Vicsek, T. (2000). Simulating dynamical features of escape panic. Nature, 407(6803):487–90.

[64] Helbing, D. and Farkas, I. J. (2002). Simulation of pedestrian crowds in normal and evacuation situations. Pedestrian and Evacuation Dynamics, 21:21–58.

[65] Helbing, D., Johansson, A., and Al-Abideen, H. (2007). Dynamics of crowd disasters: An empirical study. hysical review E, 75(4):046109.

[66] Helbing, D. and Molnar, P. (1995). Social force model for pedestrian dynamics. Physical review E, 51.5(5):4282.

[67] Heliovaara,¨ S., Ehtamo, H., Helbing, D., and Korhonen, T. (2013). Patient and impatient pedestrians in a spatial game for egress congestion. Physical Review E, 87(1):012802.

[68] Heliovaara,¨ S., Kuusinen, J., Rinne, T., Korhonen, T., and Ehtamo, H. (2012). Pedestrian behavior and exit selection in evacuation of a corridor–an experimen- tal study. Safety science, 50(2):221–227.

[69] Hemelrijk, C. and Hildenbrandt, H. (2008). Self-organized shape and frontal density of fish schools. Ethology, 114(3):245–254.

[70] Hemelrijk, C. and Kunz, H. (2005). Density distribution and size sorting in fish schools: an individual-based model. Behavioral Ecology, 16(1):178–187.

[71] Henein, C. M. and White, T. (2005). Agent-based modelling of forces in crowds. In Multi-agent and multi-agent-based simulation.

[72] Hermann, P. (2015). Prisoner in van heard “banging against walls”. https://www.washingtonpost.com/local/crime/prisoner-in-van-said- freddie-gray-was-banging-against-the-walls-during-ride/2015/04/29/ 56d7da10-eec6-11e4-8666-a1d756d0218e_story.html. Accessed: 2019-12-16.

[73] Hong, L., Dan, O., and Davison, B. (2011). Predicting popular messages in twitter. Proceedings of the 20th international conference companion on World wide web, pages 57–58. Bibliography 167

[74] Hou, L., Liu, J., Pan, X., and Wang, B. (2014). A social force evacuation model with the leadership effect. Physica A: Statistical Mechanics and its Applications, 400:93–99.

[75] Iyengar, A., Finin, T., and Joshi, A. (2011). Content-based prediction of tempo- ral boundaries for events in twitter. 2011 IEEE Third International Conference on Privacy, Security, Risk and Trust and 2011 IEEE Third International Conference on Social Computing, pages 186–191.

[76] Jain, S. (2015). Real-time social network data mining for predicting the path for a disaster. Master’s thesis, Georgia State University.

[77] Johansson, F., Duives, D., Daamen, W., and Hoogendoorn, S. (2014). The many roles of the relaxation time parameter in force based models of pedestrian dynamics. Transportation Research Procedia, 2:300–308.

[78] Jones, P., Brantingham, P., and Chayes, L. (2010). Statistical models of crim- inal behavior: the effects of law enforcement actions. Mathematical Models and Methods in Applied Sciences, 20:1397–1423.

[79] Jorjafki, E. M., Sagarin, B. J., and Butail, S. (2018). Drawing power of virtual crowds. Journal of the Royal Society, Interface, 15(145).

[80] Karamouzas, I., Heil, P., Van Beek, P., and Overmars, M. (2009). A predictive collision avoidance model for pedestrian simulation. International workshop on motion in games, pages 41–52).

[81] Karamouzas, I., Skinner, B., and Guy, S. J. (2014). Universal power law gov- erning pedestrian interactions. Physical Review Letters, 113(23):238701.

[82] Kinateder, M. and Warren, W. H. (2016). Social influence on evacuation be- havior in real and virtual environments. Frontiers in Robotics and AI, 3:43.

[83] Kirchner, A. and Schadschneider, A. (2002). Simulation of evacuation pro- cesses using a bionics-inspired cellular automaton model for pedestrian dynam- ics. Physica A: Statistical Mechanics and its Applications, 312(1-2):260–276.

[84] Kolokolnikov, T., Sun, H., Uminsky, D., and Bertozzi, A. (2011). Stability of ring patterns arising from two-dimensional particle interactions. Physical Review E, 84(1):015203. Bibliography 168

[85] Korolov, R., Lu, D., Wang, J., Zhou, G., Bonial, C., Voss, C., Kaplan, L., Wal- lace, W., Han, J., and Ji, H. (2016). On predicting social unrest using social me- dia. 2016 IEEE/ACM international conference on advances in social networks analysis and mining, pages 89–95.

[86] Kunz, H. and Hemelrijk, C. (2003). Artificial fish schools: collective effects of school size, body size, and body form. Artificial life, 9(3):237–253.

[87] Lakoba, T., Kaup, D., and Finkelstein, N. (2005). Modifications of the helbing- molnar-farkas-vicsek social force model for pedestrian evolutionellular automa- ton model for pedestrian dynamics. Simulation, 81(5):339–352.

[88] Lee, H., Bhatia, A., Brynjarsdottir,´ J., Abaid, N., Barbaro, A., and Butail, S. (2020). Speed modulated social influence in evacuating pedestrian crowds. Collective Dynamics, 5.

[89] Levine, H., Rappel, W., and Cohen, I. (2000). Self-organization in systems of self-propelled particles. Physical Review E, 63(1):017101.

[90] Liu, Q. (2018). A social force model for the crowd evacuation in a terrorist attack. Physica A: Statistical Mechanics and its Applications, 502:315–330.

[91] Lukasik, M., Srijith, P., Cohn, T., and Bontcheva, K. (2015). Modeling tweet arrival times using log-gaussian cox processes. 2015 Conference on Empirical Methods in Natural Language Processing, pages 250–255.

[92] Magnusson,´ K., Sigurosson,¨ S., and Einarsson, B. (2004). A discrete and stochastic simulation model for migration of fish with application to capelin in the seas around Iceland. Raunv´ısindastofnun Hask´ olans.´

[93] Mathioudakis, M. and Koudas, N. (2010). Twittermonitor: trend detection over the twitter stream. Proceedings of the 2010 ACM SIGMOD International Conference on Management of data, pages 1155–1158.

[94]M ehes,´ E. and Vicsek, T. (2014). Collective motion of cells: from experiments to models. Integrative biology, 6(19):831–854.

[95] Mehran, R., Oyama, A., and Shah, M. (2009). Abnormal crowd behavior de- tection using social force model. In 2009 IEEE Conference on Computer Vision and Pattern Recognition, pages 935–942.

[96] Meyer, T., Balague,´ D., Camacho-Collados, M., Li, H., Khuu, K., Brantingham, P., and Bertozzi, A. (2019). A year in madrid as described through the analysis of Bibliography 169

geotagged twitter data. Environment and Planning B: Urban Analytics and City Science, 46(9):1724–1740.

[97] Mogilner, A., Edelstein-Keshet, L., Bent, L., and Spiros, A. (2003). Mutual in- teractions, potentials, and individual distance in a social aggregation. Journal of mathematical biology, 47(4):353–389.

[98] Motsch, S. and Tadmor, E. (2011). A new model for self-organized dynamics and its flocking behavior. Journal of Statistical Physics, 144(5):923.

[99] Moussa¨ıd, M., Helbing, D., and Theraulaz, G. (2011). How simple rules de- termine pedestrian behavior and crowd disasters. Proceedings of the National Academy of Sciences, 108(17):6884–6888.

[100] Moussa¨ıd, M., Perozo, N., Garnier, S., Helbing, D., and Theraulaz, G. (2010). he walking behaviour of pedestrian social groups and its impact on crowd dy- namics. PloS one, 5(4).

[101] Nilsson, D. and Johansson, A. (2009). Social influence during the initial phase of a fire evacuationanalysis of evacuation experiments in a cinema theatre. Fire Safety Journal, 44(1):71–79.

[102] Noack, R. (2019). The numbers that help explain why protests are rocking countries around the world. https://www.washingtonpost.com/world/2019/ 11/01/numbers-that-help-explain-why-protests-are-rocking-countries- around-world/. Accessed: 2019-12-10.

[103] Parisi, D., Gilman, M., and Moldovan, H. (2009). A modification of the social force model can reproduce experimental data of pedestrian flows in normal con- ditions. Physica A: Statistical Mechanics and its Applications, 388(17):3600–3608.

[104] Partridge, B. L. (1982). The structure and function of fish schools. Scientific American, 246(6):114–123.

[105] Pelechano, N., Allbeck, J. M., and Badler, N. I. (2008). Virtual crowds: Meth- ods, simulation, and control. Synthesis Lectures on Computer Graphics and Animation, 3(1):1–176.

[106] Pennisi, M., Pappalardo, F., and Motta, S. (2009). Agent based modeling of lung metastasis-immune system competition. International Conference on Artificial Immune Systems, pages 1–3.

[107] Peyre, G. and Cuturi, M. (2019). Computational optimal transport. Foundations and Trends in Machine Learning, 11(5-6):355–607. Bibliography 170

[108] Ramos, J. (2003). Using tf-idf to determine word relevance in document queries. In Proceedings of the first instructional conference on machine learning, 242:133–142).

[109] Rector, K. (2015). The 45-minute mystery of Freddie Gray’s death. https://www.baltimoresun.com/news/crime/bs-md-gray-ticker-20150425- story.html#page=1. Accessed: 2019-12-16.

[110] Rencher, A. and Schaalje, G. (2008). Linear models in statistics. John Wiley and Sons.

[111] Ruiz, R. (2015). Baltimore Officers Will Face No Federal Charges in Death of Freddie Gray. https://www.nytimes.com/2017/09/12/us/freddie- gray-baltimore-police-federal-charges.html. Accessed: 2019-12-16.

[112] Sagun, A., Anumba, C., and Bouchlaghem, D. (2013). Designing buildings to cope with emergencies: findings from case studies on exit preferences. Buildings, 3(2):442–461).

[113] Sakaki, T., Okazaki, M., and Matsuo, Y. (2010). Earthquake shakes twit- ter users: real-time event detection by social sensors. Proceedings of the 19th international conference on World wide web, pages 851–860.

[114] Salton, G. and Buckley, C. (1988). Term-weighting approaches in automatic text retrieval. Information processing and management, 24(5):513–523.

[115] Santner, T. J., Williams, B. J., Notz, W., and Williams, B. J. (2003). The design and analysis of computer experiments. Springer.

[116] Seyfried, A., Steffen, B., and Lippert, T. (2006). Basics of modelling the pedes- trian flow. Physica A: Statistical Mechanics and its Applications, 368(1):232–238.

[117] Short, M., D’orsogna, M., Pasour, V., Tita, G., Brantingham, P., Bertozzi, A., and Chayes, L. (2008). A statistical model of criminal behavior. Mathematical Models and Methods in Applied Sciences, 18:1249–1267.

[118] Short, M., Mohler, G., Brantingham, P., and Tita, G. (2014). Gang rivalry dy- namics via coupled point process networks. Discrete and Continuous Dynamical Systems-B, 19(5):1459.

[119] Siddiqa, A., Niazi, M., Mustafa, F., Bokhari, H., Hussain, A., Akram, N., and Iqbal, S. (2009). A new hybrid agent-based modeling and simulation decision support system for breast cancer data analysis. Information and Communication Technologies, pages 134–139. Bibliography 171

[120] Silverberg, J., Bierbaum, M., Sethna, J., and Cohen, I. (2013a). Collective mo- tion of humans in mosh and circle pits at heavy metal concerts. Physical review letters, 110(22):228701.

[121] Silverberg, J. L., Bierbaum, M., Sethna, J. P., and Cohen, I. (2013b). Collec- tive motion of humans in mosh and circle pits at heavy metal concerts. Physical review letters, 110(22):228701.

[122] Simpson, I. (2015). Crowds protest death of man after arrest by Balti- more police. https://www.reuters.com/article/us-usa-police-baltimore/ crowds-protest-death-of-man-after-arrest-by-baltimore-police- idUSKBN0NC1MC20150421. Accessed: 2019-12-16.

[123] Smith, A. (2009). Contribution of perceptions in analysis of walking behav- ior. Transportation research record, 2140(1):128–136.

[124] Spohn, H. (2012). Large scale dynamics of interacting particles. Springer Sci- ence & Business Media.

[125] Stieglitz, S. and Dang-Xuan, L. (2012). Political communication and influence through microblogging–an empirical analysis of sentiment in twitter messages and retweet behavior. In 2012 45th Hawaii International Conference on System Sciences, pages 3500–3509.

[126] Szabo, B., Szoll¨ osi,¨ G., Gonci,¨ B., Juranyi,´ Z., Selmeczi, D., and Vicsek, T. (2006). Phase transition in the collective migration of tissue cells: experiment and model. Physical Review E, 74(6):061908.

[127] Takhteyev, Y., Gruzd, A., and Wellman, B. (2012). Geography of twitter net- works. Social networks, 34(1):73–81.

[128] Thelwall, M., Buckley, K., and Paltoglou, G. (2011). Sentiment in twitter events. Journal of the American Society for Information Science and Technology, 62(2):406–418.

[129] Topaz, C. and Bertozzi, A. (2004). Swarming patterns in a two-dimensional kinematic model for biological groups. SIAM Journal on Applied Mathematics, 65(1):152–174.

[130] Troisi, A., Wong, V., and Ratner, M. A. (2005). An agent-based approach for modeling molecular self- organization. Proceedings of the National Academy of Sciences of the United States of America, 102(2):255–260. Bibliography 172

[131] Varas, A., Cornejo, M. D., Mainemer, D., Toledo, B., Rogan, J., Munoz, V., and Valdivia, J. A. (2007). Cellular automaton model for evacuation process with obstacles. Physica A: Statistical Mechanics and its Applications, 382(2):631–642.

[132] Vicsek, T., Czirok,´ A., Ben-Jacob, E., Cohen, I., and Shochet, O. (1995). Novel type of phase transition in a system of self-driven particles. Physical review letters, 75(6):1226.

[133] Vicsek, T. and Zafeiris, A. (2012). Collective motion. Physics reports, 517(3- 4):71–140.

[134] Volkin, R. (2019). Spherical Shell Solutions to the Radially Symmetric Aggregation Equation: Analysis and a Novel Numerical Method. PhD thesis, Case Western Reserve University.

[135] Von Brecht, J., Uminsky, D., Kolokolnikov, T., and Bertozzi, A. (2012). Predicting pattern formation in particle interactions. Mathematical Models and Methods in Applied Sciences, 22(supp01):1140002.

[136] Walker, D. C., Hill, G., Wood, S. M., Smallwood, R. H., and Southgate, J. (2004). Agent-based computational modeling of wounded epithelial cell mono- layers. IEEE transactions on nanobioscience, 3(3):153–163.

[137] Weng, J. and Lee, B. (2011). Event detection in twitter. Fifth international AAAI conference on weblogs and social media.

[138] Winterer, C. (2018). Predicting twitter time series using generalized linear models. Master’s thesis, Case Western Reserve University.

[139] Yamamoto, K., Kokubo, S., and Nishinari, K. (2007). Simulation for pedes- trian dynamics by real-coded cellular automata (rca). Physica A: Statistical Mechanics and its Applications, 379(2):654–660.

[140] Yang, X., Dong, H., Wang, Q., Chen, Y., and Hu, X. (2014). Guided crowd dynamics via modified social force model. Physica A: Statistical Mechanics and its Applications, 411:63–73.

[141] Youseff, L., Barbaro, A., Trethewey, P., Birnir, B., and Gilbert, J. (2008). Paral- lel modeling of fish interaction. IEEE International Conference on Computational Science and Engineering, 79(12):234–241.

[142] Zanlungo, F., Ikeda, T., and Kanda, T. (2005). Social force model with explicit collision prediction. EPL (Europhysics Letters), 93(6):68005. Bibliography 173

[143] Zhang, L., Athale, C. A., and Deisboeck, T. S. (2007). Development of a three- dimensional multiscale agent-based tumor model: simulating gene-protein inter- action profiles, cell phenotypes and multicellular patterns in brain cancer. Journal of theoretical biology, 244(1):96–107.

[144] Zhang, L., Wang, Z., Sagotsky, J. A., and Deisboeck, T. S. (2009). Multi- scale agent-based cancer modeling. journal of mathematical biology. Journal of mathematical biology, 58(4-5):545–559.

[145] Zheng, X., Zhong, T., and Liu, M. (2009). Modeling crowd evacuation of a building based on seven methodological approaches. Building and Environment, 44(3):437–445.