{'fraction_non_alphanumeric': 0.04376358639924531, 'fraction_numerical': 0.014006808580451991, 'mean_word_length': 4.293996308761264, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
On-off Threshold Models of Social Contagion

We study binary state contagion dynamics on a social network where nodes act in response to the average state of their neighborhood. We model the competing tendencies of imitation and non-conformity by incorporating an off-threshold into standard threshold models of behavior. In this way, we attempt to capture important aspects of fashions and general societal trends. Allowing varying amounts of stochasticity in both the network and node responses, we find different outcomes in the random and deterministic versions of the model. In the limit of a large, dense network, however, we show that these dynamics coincide. The dynamical behavior of the system ranges from steady state to chaotic depending on network connectivity and update synchronicity. We construct a mean field theory for general random networks. In the undirected case, the mean field theory predicts that the dynamics on the network are a smoothed version of the average node response dynamics. We compare our theory to extensive simulations on Poisson random graphs with node responses that average to the chaotic tent map.


Introduction
Almost universally, people enjoy observing, speculating, and arguing about their fellow humans' behavior, including what they are wearing, the music they listen to, and however else they express themselves. Fashions, trends, and fads intrigue us, whether past, present, or future. Contemporary examples of prevalent trends include skinny jeans, fixed-wheel bicycles, and products made by Apple Inc. In the 1960's, shag carpets and floral wallpaper would take their place. Trends are also prevalent in language: "hipster" was popular in the 1940's and evolved into "hippie", but it has been reappropriated today with different connotations; "groovy" was once used seriously, and now comes out tongue-in-cheek.
The dynamics of these cultural phenomena are fascinating and complex. They reflect numerous factors such as the political climate, social norms, technology, marketing, and history. These phenomena are also influenced by essentially random events. Usually, we can explain the emergence of a fad after the fact, but it is extremely difficult to predict a priori whether some behavior will become popular. Furthermore, those behaviors which are adopted by a large fraction of the population can lose their excitement and die out forever or later recur unpredictably.
In this work we describe a mathematical model of the rise and fall of trends. In particular, we model a social contagion process where people are influenced by the behavior of their friends. The agents in the model act according to simple competing tendencies of imitation and non-conformity.
One can argue that these two ingredients are essential to all trends; indeed, Simmel, in his classic essay "Fashion" (1957), believed that these are the essential forces behind the creation and destruction of fashions.
Our model is not meant to be quantitative, except perhaps in carefully designed experiments, but it captures the features with which we are familiar: some trends take off and some do not, and some trends are stable while others vary wildly through time. Our model is closely related to the seminal work of Schelling (1971) and Granovetter (1978). Being a mathematical model, it is also connected to theories of percolation (Stauffer and Aharony, 1994), disease spreading (Newman, 2003), and magnetism (Newman, 2003;Aldana et al., 2003).
We focus on the derivation and analysis of dynamical master equations that describe the expected evolution of the system state. Through these equations we are able to predict the behavior of the social contagion process. In some cases, this can be done by hand, but most of the time we resort to numerical methods for their iteration or solution.
This thesis is structured as follows. In Section 2, we introduce the reader to important background material relevant to the on-off threshold model. In Section 3, we define the model and its deterministic and stochastic variants. In Section 4, we provide an analysis of the model when the underlying network is fixed. Section 5 develops a mean field theory of the model in the most general kind of random graphs. In Section 6, we consider the model on Poisson random graphs with a specific kind of response function. Our analysis is then applied to this specific case, and we compare the results of simulations and theory. Finally, Section 7 presents conclusions and directions for further research.

Basics of graphs and networks
When modeling any dynamical system of many interacting particles or agents, we are often forced to start with a simplified description of their interactions. In a solid, for example, atoms are situated on some sort of lattice and assumed to interact only with their nearest neighbors. However, in many cases the interactions we aim to model do not have the periodic structure of a lattice. Graphs, which are just a set of points connected by lines, are a more general mathematical structure. We denote a graph G as an ordered pair G = (V, E) where V is the set of vertices (also called nodes) and E ⊆ V × V the set of edges (also called links). Here, E is a set of ordered pairs, and we denote an edge from vertices i to j as ij ∈ E. The terms graph and network will be used interchangeably, but they have acquired different connotations. Hackett (2011, §1.2.1) puts this rather nicely: To model a complex system as a graph is to filter out the functional details of each of its components, and the idiosyncrasies of their interactions with each other, and to focus instead on the underlying structure (topology) as an inert mathematical construct. Although this technique is central also to network theory, the word network, in contrast, usually carries with it connotations of the context in which the overarching system exists, particularly when that system displays any sort of nonlinear dynamics. For example, when investigating the spread of infectious disease on a human sexual contact network it makes sense to consider the relevant sociological parameters as well as the abstract topology, and it is in such settings that the interdisciplinary aspect that distinguishes network theory comes to the fore.
In models of human behavior, interactions can be considered to occur on a social network. Each person is connected to those people they interact with. Interactions that constitute a connection Figure 1: A graph consisting of a connected component of 5 nodes and one isolated node. The majority of the edges are directed. There is one undirected edge, shown without arrows. There is one self-loop which should be interpreted as directed.
between two people, A and B, may be defined in many ways. For example: Case 1. A contacts B. This could mean: (a) A sends B an email.
(b) A attends the same concert as B.
Case 2. A is B's superior in a hierarchy.
Case 3. A and B both belong to the same group.
These examples illustrate different types of edges that can be included in a graph. In Case 1a, sending an email message is a one-way communication, so it forms a directed edge. We represent directed edges with arrows in a drawing of the corresponding graph. In Case 1b, however, attending a concert is a symmetric relation and there is no reason to give the edge direction. Such edges are called undirected or bidirectional. See Figure 1 for an example of a small graph containing multiple types of edges. A simple graph, by definition, contains no directed edges or self loops (edges connecting a vertex to itself). It will be useful to represent the connectivity of the graph with the adjacency matrix, A = (A ij ), where A ij = 1 if and only if ji ∈ E (this "backwards" definition is not standard, but it is useful for the linear algebra to come). The unfamiliar reader is directed to West (2001) for a thorough introduction to graph theory.
When we wish to analyze the structure of a given network, one of the first things to examine is its degree distribution. The degree k i of a vertex i ∈ V is the number of edges incident to it, regardless of direction. The sequence k 1 , k 2 , . . . , k N is called the degree sequence. In simple graphs, this is just the size of a vertex's neighborhood. In more complicated graphs we usually speak instead of a vertex i's in-degree k i , and undirected degree k (u) i , all defined in the obvious way . The degree distribution p k is a probability distribution which tells us how edges are distributed among nodes. The average degree k avg = ∞ i=0 kp k characterizes the overall density of edges. A degree distribution which is sharply peaked about its mean indicates a relatively homogeneous network where vertices tend to have the same number of incident edges. In contrast, a skewed distribution could result in some nodes having very high degree while the majority have low degree. This is common in real networks, and the tail of the degree distribution often follows an approximate power law p k ∼ k −α for some exponent α (Newman, 2003).

Random graphs
Random graphs are a family of models used to represent networks from the real world, although their suitability as such is questionable for reasons that will be elaborated below. Nevertheless, they are well-suited to analysis and as null models.
The simplest random graph is the binomial model introduced by Erdős and Rényi (Bollobás, 2001). Define a probability space G(N, p) of graphs on N vertices where any of the N 2 possible edges are chosen independently with probability p. The expected average degree in the network will be k avg = p(N −1). We will often make statements about this network in the limit of large system size N → ∞. (In physics, this is referred to as the thermodynamic limit. Many expressions are simplified in performing this approximation, and derived results can be quite accurate given a large enough, albeit finite, N .) The degree distribution is a binomial distribution p k = N −1 k p k (1 − p) N −1−k which is well-approximated by the Poisson distribution p k ≈ (k avg ) k exp(−k avg )/k! with parameter k avg = N p when N is large and k avg fixed. For this reason, G(N, p) is also called the Poisson random graph model. As noted previously, many networks observed in the real world have heavy-tailed distributions, so the Poisson model is not suitable for those types of networks. Furthermore, real networks often contain a high density of triangles or clustering -friendship tends to be transitive.
Poisson random graphs, on the other hand, have zero clustering in the thermodynamic limit.
A more flexible generalization is the configuration model. In this model, either the degree sequence Reed, 1995, 1998) or the expected degree sequence (Chung and Lu, 2002) is given in advance (also see Newman, 2003); the models produce similar networks with subtle differences. The configuration model of can be thought of as a random wiring process as follows.
First, draw a degree sequence k 1 , . . . , k N independently according to the desired degree distribution p k . We assign k i stubs (half-edges) to each vertex i ∈ V . Next, choose a pair of stubs at random, connect them, remove both from the queue of stubs, and continue until all stubs are connected.
Finally, pairs of edges are chosen and their endpoints shuffled in the manner of Milo et al. (2002) to ensure uniform sampling from all graphs with the given degree sequence. The resulting graph will have the imposed degree sequence, so long as the sum of the degrees is even. There may be self-loops or repeated edges, neither of which are allowable for simple graphs. However, we expect these to occur increasingly rarely for large N , and they can be removed without affecting the resulting graph much. Degree-degree correlations can be introduced by shuffling edges as described in Melnik et al. (2011) and Payne et al. (2011). The configuration model also lacks triangles and higher-order cliques in the thermodynamic limit, although some work has been done to create random graph models with clustering (see Hackett, 2011, § §4-5).

Dynamical processes on networks
Networks provide a structure on top of which all kinds of dynamical processes may take place.
In many cases, the structure of the network itself heavily influences the dynamics. For instance, ferromagnetic materials can be modeled as atoms in a lattice network, where the bulk magnetization is the result of interactions between individual atoms' magnetic moments; strikingly different results occur in different dimensional lattices. Another example is a food web, a network of species connected by trophic interactions (who eats whom). The populations of the species in the ecosystem can be described by dynamical equations that reflect the structure of the network, and this can affect ecosystem stability. These are just two examples where dynamical processes on networks are a reasonable way to model system behavior. Since networks are ubiquitous structures, these models appear across all disciplines (Vespignani, 2012).

Random Boolean networks
Consider Boolean or binary state dynamics, where each node can be either "on" or "off" (in various contexts this can mean active/inactive, infected/susceptible, or spin up/spin down). The state of node i is encoded by a variable x i ∈ {0, 1}, and the system state is x = (x i ). At each time step, nodes receive input from their neighbors in the (undirected) network. They then compute a function of that input, i.e., f i (x j1 , x j2 , . . . , x j k i ) where j 1 , . . . , j ki are the neighbors of node i. This determines their state in the next time step. Because the state space {0, 1} N is finite, all trajectories are eventually periodic. The detailed structure of the cycles depends on the specific details of the network and the Boolean functions.
Boolean networks were first studied by Kauffman (1969) as a model for dynamical behavior within cells. See the review by Aldana et al. (2003). Most researchers have considered the dynamics on random K-regular graphs with a parameterp that determines the bias between 0s and 1s in the output of the update functions f i , which are otherwise randomly chosen Boolean functions.
As mentioned, deterministic Boolean network models must be eventually periodic. However, the behavior of the transient and the structure of the basins of attraction are different for different parameters K andp. In particular, there is a critical value of the connectivity K c (p) that separates the transient dynamics into two phases (Aldana et al., 2003): 1. Frozen, K < K c : The distance between nearby trajectories x(t) and x ′ (t) decays exponentially with time.
2. Critical, K = K c : The temporal evolution of distance between trajectories is determined by fluctuations.
3. Chaotic, K > K c : The distance between nearby trajectories grows exponentially with time.

Social models
When modeling social systems with a Boolean network, the nodes represent people and their states encode whether or not they participate in a behavior, possess a certain belief, etc. This could be rioting or not rioting (Granovetter, 1978), buying a particular style of tie (Granovetter and Soong, 1986), liking a particular band or style of music, or believing in some unintuitive or controversial idea, e.g. climate change. The state can represent any behavior with only two mutually exclusive possibilities.
The function f i that determines how node i changes state is called its response function in sociological contexts. Schelling (1971Schelling ( , 1973 and Granovetter (1978) pioneered the use of threshold response functions in models of collective social behavior (although they were not the first; see the citations in their papers). This was based on the intuition that, for a person to adopt some new behavior, the fraction of the population exhibiting that behavior might need to exceed some critical value, the person's threshold. (Mathematically, a threshold response function f (φ; φ on ) with threshold φ on returns 0 if φ < φ on and 1 if φ ≥ φ on 1 .) These models were generalized to the case where the dynamics take place on a network by Watts (2002). If we initialize a social network with some fraction of active nodes, some of their neighbors' thresholds may be exceeded and the activity can spread (depending on the distribution of thresholds and network structure).
Standard threshold models have simple dynamical behavior: in a word, "spreading." If a single activation, on average, leads to more than one subsequent activation, then the spreading will be successful. The activity will increase in a sigmoid fashion until some final fraction of the network is activated. These kinds of spreading are often studied using branching processes. See the book by Harris (1963) for an overview of branching processes and the widely-used generating function formalism. Branching processes have been used to model, among other things, extinction of families, species, and genes, neutron cascades (as happens during nuclear chain reactions), and high energy particle showers caused by cosmic rays. The generating function formalism developed in part by Newman (as in Newman, 2003;Watts, 2002) to analyze spreading on networks is a straightforward application of the classical theory of branching processes.
We note that threshold random Boolean network models have been studied for the purpose of modeling neural networks (Aldana et al., 2003). Those models take place on signed, weighted graphs, which differ from the networks considered here, and the problems considered are different. It would be interesting to explore the connections between our on-off threshold model (Section 3) and other threshold Boolean network models.

Some notation
The Bachmann-Landau asymptotic notations are used throughout this thesis. When used carefully, asymptotic notation greatly improves the readability of analytic statements and proofs. It is also widely used in probability. For an overview of the notation's history and usage, see Knuth (1976) and the references therein. The notations we have used here are [citing from Knuth (1976)]: • O(f (n)) is the set of all g(n) such that there exist positive constants C and n 0 with |g(n)| ≤ Cf (n) for all n ≥ n 0 .
• Ω(f (n)) is the set of all g(n) such that there exist positive constants C and n 0 with g(n) ≥ Cf (n) for all n ≥ n 0 .
• o(f (n)) is the set of all g(n) such that g(n)/f (n) → 0 as n → ∞.
Formally, each of the above define sets of functions, but we often use statements such as "f is O(g)" (read as "f is big-oh of g") or "f = O(g)" to mean "f ∈ O(g)." When expressing probabilities we will use notation of the form P (x), P (x|y), etc. Here, P (x) is the probability that the random variable associated with x equals the specific value x. We leave out the random variables to avoid introducing unnecessary clutter.
Symbols in boldface represent vector quantities or vector-valued functions, e.g., x = (x i ). Subscripts have been left out in places for clarity.

The on-off threshold model
Here we study a simple extension of the classical threshold models (such as Schelling, 1971Schelling, , 1973Granovetter, 1978;Watts, 2002;Dodds and Watts, 2004, among others): the response function also includes an off-threshold. See Figure 2 for an example on-off threshold response function. This is exactly the model of Granovetter and Soong (1986), but on a network. We motivate this choice with the following (also see Granovetter and Soong, 1986).
(1) Imitation: the on state becomes favored as the fraction of active neighbors surpasses the on-threshold (bandwagon effect).
(2) Non-conformity: the on state is eventually less favorable with the fraction of active neighbors past the off-threshold (reverse bandwagon, snob effect).
(3) Simplicity: in the absence of any raw data of "actual" response functions, which are surely highly context-dependent and variable, we choose arguably the simplest deterministic functions which capture imitation and non-conformity.
1} N be the initial states of all nodes. At time step t, each node i computes the fraction φ i (t) of their neighbors in G who are active and takes the state x i (t + 1) = f i (φ i (t); φ on,i , φ off,i ) at the next time step. The above defines a deterministic dynamical system for a fixed graph and fixed thresholds.
We now make some quick remarks about the on-off threshold model. First, our model is a particular kind of Boolean network (Section 2.3.1). Note that each node reacts only to the fraction of its neighbors who are active, rather than the absolute number, and the input varies from 0 to 1 in steps of 1/k i , where k i is node i's degree. Note that if φ on,i = 0 the node activates spontaneously, and if φ off,i = 1 we have the usual kind of threshold response function (without an off-threshold).
A crucial difference between our model and many related threshold models is that, in those models, an activated node can never reenter the susceptible state. Gleeson and Cahalane (2007) call this the permanently active property and elaborate on its importance to their analysis. Such models must eventually reach a steady state. When the dynamics are deterministic, this will be a fixed point, and in the presence of stochasticity the steady state is characterized by some fixed fraction of active nodes subject to fluctuations. The introduction of the off-threshold builds in a mechanism for node deactivation. Because nodes can now recurrently transition between on and off states, the deterministic dynamics can exhibit a chaotic transient (see Section 2.3.1), and the long time behavior can be periodic with potentially high period. With stochasticity, the dynamics can be truly chaotic and never repeat.
In the rest of this Section, we will describe how this model is different from the random Boolean networks in the literature. This is mainly due to the on-off threshold response functions we consider, but also the type of random graph on which the dynamics take place, varying amounts of stochasticity which we introduce in the networks and response functions, and the possibility of asynchronous updates.

The networks considered
The mean field analysis in Section 5 is applicable to any network which can be characterized by its degree distribution. As mentioned before, the vast majority of the theory of random Boolean networks assumes a regular random graph. Fortunately, such theories are easily generalized to other types of graphs with independent edges, such as Poisson and configuration model random graphs. Some specific results are given for the Poisson random graph G(N, k avg /N ), and these are the networks considered in Section 6.

Stochastic variants
The specific graph and node thresholds determine exactly which behaviors are possible. These are chosen from some distribution of graphs, such as G(N, k avg /N ), and some distribution of thresholds, given by the joint density P (φ on , φ off ). The specific graph and thresholds define a realization of the model (see Aldana et al., 2003). When these are fixed for all time, we have, in principle, full knowledge of the possible model dynamics. Given an initial condition x(0), the dynamics x(t) are deterministic and known for all t ≥ 0.
With the introduction of noise, the system is no longer eventually periodic. Fluctuations at the node level allow a greater exploration of state space, and the behavior is comparable to that of the general class of discrete-time maps. Roughly speaking, the mean field theory we develop in Section 5 becomes more accurate as we introduce more stochasticity.
We introduce randomness in two parts of the model: the network and/or the response functions.
Allowing for the network and responses to be either fixed for all time or resampled each time step and taking all possible combinations yields four different designs (see Table 1).
Rewiring network Fixed network Probabilistic response P-R P-F Deterministic response D-R D-F Table 1: The four different ways the model can be realized. These are the combinations of fixed or rewired networks and probabilistic or deterministic response functions. In the thermodynamic limit of the fully stochastic version (P-R), where the graph and response functions change every time step, the mean field theory is exact (see Sec. 5).

Rewired graphs
First, the network itself can change every time step. This is the rewiring (R), as opposed to fixed (F), network case. For example, we could draw a new graph from G(N, k avg /N ) every time step.
This amounts to rewiring the links while keeping the degree distribution fixed, and it is alternately known as a mean field, "annealed", or random mixing variant of the fixed or "quenched" model (Aldana et al., 2003).

Probabilistic responses
Second, the response functions can change every time step. This is the probabilistic (P), as opposed to the deterministic (D), response function case. Again, we will need a well-defined distribution P (φ on , φ off ) for the thresholds. This amounts to having a single response function, the expected response function We call f : [0, 1] → [0, 1] the probabilistic response function. Its interpretation is the following.
For an updating node with a fraction φ of active neighbors at the current time step, then, at the next time step, the node assumes the state 1 with probability f (φ) and the state 0 with probability 1 − f (φ).

The concept of "temperature" in the system
In this thesis, the network and response functions are either fixed for all time or resampled every time step. One could tune smoothly between the two extremes by introducing rates at which these reconfigurations occur. These rates are inversely related to quantities that behave like temperature (one for the network and another for the response functions). For the fixed case, the temperature is zero, and there are no fluctuations, while in the stochastic case, the temperature is very large or infinite, and fluctuations occur every time step.

Synchronicity of the update
Finally, we introduce a parameter α for the probability that a given node updates. When α = 1, all nodes update every time step, and the update rule is said to be synchronous. When α = 1/N , only one node is expected to update with each time step, and the update rule is said to be effectively asynchronous. This is equivalent to a randomly ordered sequential update. For intermediate values, α is the expected fraction of nodes which update each time step.

Fixed networks
Take the case where the response functions and graph are fixed (D-F), but the update may be synchronous or asynchronous. Let x i (t) be the probability that node i is in state 1 at time t, and The dynamics follow the master equation which can be written in matrix-vector notation as x(t + 1) = αf (T x(t)) + (1 − α)x(t). (4.2) Here T = D −1 A is sometimes called the transition probability matrix (in the context of a random walker), D is the diagonal degree matrix, and f = (f i ) 2 . Note that if α = 1 we recover the fully deterministic response function dynamics, and x i (t) = 0 or 1 for all t.

Asynchronous limit
Here, we show that when α ≈ 1/N , time is effectively continuous and the dynamics can be described by an ordinary differential equation. This is similar to the analysis of Gleeson (2008). Consider 2 Eqns. (4.1) and (4.2) are not entirely correct when there are isolated nodes. In that case, k i = j A ij = 0 for certain i, thus the denominator in (4.1) is zero and D −1 undefined. If the initial network contains isolated nodes, we set all entries in the corresponding rows of T to zero.
Eqn. 4.2. Subtracting x(t) from both sides and setting ∆x(t) = x(t + 1) − x(t) and ∆t = 1 yields Since α is assumed small, the right hand side is small, and thus ∆x(t) is also small. Making the continuum approximation dx(t)/dt ≈ ∆x(t)/∆t yields the differential equation

Dense network limit for Poisson random graphs
The following result is particular to Poisson random graphs, but similar results are possible for other random graphs with dense limits. The normalized Laplacian matrix is defined as L ≡ I − D −1/2 AD −1/2 , where I is the identity (West, 2001). So T = D −1/2 (I − L)D 1/2 . By Oliveira (2010), when k avg is Ω(log N ) there exists a typical Laplacian matrix L typ = I N − 1 N 1 † N /N [we let 1 N denote the length-N vector of ones and (·) † the matrix transpose] such that the actual L ≈ L typ in the induced 2-norm (spectral norm) with high probability. In this limit, if we assume uniform degrees k i = k avg for all i ∈ V , then T ≈ T typ = 1 N 1 † N /N . So T effectively averages the node states: . Without a subscript, φ(t) denotes the active fraction of the network at time t. We make the above approximation in Eqn. 4.2 and average that equation over all nodes, finding where we have assumed that N is large and the average of nodes' individual response functions N i=1 f i /N converges in a suitable sense to the stochastic response function f , Eqn. (3.1). This amounts to assuming a law of large numbers for the response functions, i.e., that the sample average converges to the expected function. Note that α tunes between the probabilistic response function Φ(φ; 1) = f (φ) and the 45 • line Φ(φ; 0) = φ. Also, the fixed points of Φ are fixed points of f , but their stability will depend on α.
When the network is dense, it ceases to affect the dynamics, since each node sees a large number of other nodes. Thus the network is effectively the complete graph. In this way we recover the map models of Granovetter and Soong (1986).

Mean field theory
In physics, making a "mean field" calculation refers to replacing the complicated interactions among many particles by a single interaction with some effective external field. There are analogous techniques for understanding networks dynamics. Instead of considering the |E| interactions among the N nodes, network mean field theories derive self-consistent expressions for the overall behavior of the network, after averaging over large sets of nodes. These have been fruitful in the study of random Boolean networks (Derrida and Pomeau, 1986) and can be surprisingly effective when networks are non-random (Melnik et al., 2011).
We derive a mean field theory, in the thermodynamic limit, for the dynamics of the on-off threshold model by blocking nodes according to their degree class. This is equivalent to nodes retaining their degree but rewiring edges every time step. The model is then part of the wellknown class of random mixing models with non-uniform contact rates. Probabilistic (P-R) and deterministic (D-R) response functions result in equivalent behavior for these random mixing models.
The important state variables end up being the active density of stubs. In an undirected network without degree-degree correlations, the state is described by a single variable ρ(t). In the presence of correlations we must introduce more variables, i.e., ρ k (t), ρ k ′ (t), . . . , to deal with the relevant degree classes.

Undirected networks
To derive the mean field equations in the simplest case -undirected, uncorrelated random graphs -consider a degree k node at time t. The probability that the node is in the 1 state at time t + 1 given a density ρ of active stubs is where each term in the sum counts the contributions from having 0, 1, . . . , k active neighbors. Now, the probability of choosing a random stub which ends at a degree k node is q k = kp k /k avg in an uncorrelated random network (Newman, 2003). This is sometimes called the edge-degree distribution. So if all of the nodes update synchronously, the active density of stubs at t + 1 will be Finally, if each node only updates with probability α, we have the following map for the density of active stubs: By a similar argument, the active density of nodes is given by Note that the edge-oriented state variable ρ contains all of the dynamically important information, rather than the vertex-oriented variable φ.

Analysis of the map equation
The function F k (ρ; f ) is known in polynomial approximation theory as the kth Bernstein polynomial (in the variable ρ) of f (Phillips, 2003;Peña, 1999). These are approximating polynomials which have applications in computer graphics due to their "shape-preserving properties." The Bernstein operator B k takes f → F k . This is a linear, positive operator which preserves convexity for all k and exactly interpolates the endpoints f (0) and f (1). Immediate consequences include that each F k is a smooth function and the kth derivatives F exists. For concave f (such as the tent or logistic maps), we have concave F k for all k and F k ր f uniformly. This convergence is typically slow. Importantly, F k ր f implies that g(ρ; p k , f ) ≤ f for any degree distribution p k .
In some cases, the dynamics of the undirected mean field theory given by ρ(t + 1) = G(ρ(t)), Eqn. (5.3), are effectively those of the map Φ, from the dense limit Eqn. (4.5). We see that g, Eqn. (5.2), can be seen as the expectation of a sequence of random functions F k under the edgedegree distribution q k (indeed, this is how it was derived). From the convergence of the F k 's, we expect that g(ρ; p k , f ) ≈ f (ρ) if the average degree k avg is "large enough" and the edge-degree distribution has a "sharp enough" peak about k avg (we will clarify this soon). Then as k avg → ∞, the mean field coincides with the dense network limit we found for Poisson random graphs, Eqn. 4.5.
Some thought leads to a sufficient condition for this kind of convergence: the standard deviation σ(k avg ) of the degree distribution must be o(k avg ). In Appendix A we prove this as Lemma 1.
In general, if the original degree distribution p k is characterized by having mean k avg , variance σ 2 , and skewness γ 1 , then the edge-degree distribution q k will have mean k avg +σ 2 /k avg and variance σ 2 [1 + γ 1 σ/k avg − (σ/k avg ) 2 ]. Considering the behavior as k avg → ∞, we can conclude that requiring σ ∈ o(k avg ) and γ 1 ∈ o(1) are sufficient conditions on p k to apply Lemma 1. Poisson degree distributions (σ = k avg and γ 1 = k −1/2 avg ) fit these criteria.

Generalized random networks
In the most general kind of random networks, edges can be undirected or directed, and we then denote node degree by a vector k = (k (u) , k (i) , k (o) ) † . The degree distribution is written as p k ≡ P (k).
There may also be correlations between node degrees. Correlations of this type are encoded by the conditional probabilities the probability that an edge starting at a degree k ′ node ends at a degree k node and is, respectively, undirected, incoming, or outgoing relative to the destination degree k node. We introduced this convention in a series of papers Dodds et al., 2011). These conditional probabilities can also be defined in terms of the joint distributions of node types connected by undirected and directed edges. The mean field equations for the on-off threshold model are closely related to the equations for the time evolution of a contagion process (Payne et al., 2011, Eqns. (13-15)). We omit a detailed derivation, since it is similar to that in Section 5.1 (see also Gleeson and Cahalane, 2007;Payne et al., 2011). The result is a coupled system of equations for the density of active stubs which now may depend on node type (k) and edge type (undirected or directed): The active fraction of nodes at a given time is given by: (5.8)

Poisson random graphs with tent map average response function
The results so far have been entirely general, in the sense that the underlying network and thresholds are arbitrary. Now we apply the general theory to the case of Poisson random graphs with a simple distribution of thresholds.
The networks we consider are Poisson random graphs from G(N, k avg /N ). The thresholds φ on and φ off are now distributed uniformly on [0, 1/2) and [1/2, 1), respectively. This distribution results Note that we use the argument ρ for comparison with the edge maps g(ρ; k avg ) = g(ρ; p k , f ), Eqn. (5.2), shown for k avg = 1, 10, 100. These p k are Poisson distributions with mean k avg . As k avg increases, g(ρ; k avg ) increases to f (ρ).
in the probabilistic response function (see Figure 3): The tent map is a well-known chaotic map of the unit interval (Alligood et al., 1996). We thus expect the on-off threshold model with this probabilistic response function to exhibit similarly interesting behavior.

Analysis of the dense limit
When the network is in the dense limit (Section 4.2), the dynamics follow Solving for the fixed points of Φ(φ; α), we find one at φ = 0 and another at φ = 2/3. When α < 2/3, the nonzero fixed point is attracting for all initial conditions except φ = 0. When α = 2/3, [1/2, 5/6] Figure 4: Bifurcation diagram for the dense map Φ(φ; α), Eqn. (6.2). This was generated by iterating the map at 1000 α values between 0 and 1. The iteration was carried out with 3 random initial conditions for 10000 time steps each, discarding the first 1000. The φ-axis contains 1000 bins and the invariant density, shown by the grayscale value, is normalized by the maximum for each α. With α < 2/3 (not shown), all trajectories go to the fixed point at φ = 2/3.
is an interval of period 2 centers. Any orbit will eventually land on one of these period 2 orbits.
When α > 2/3, this interval of period 2 orbits ceases to exist, and more complicated behavior ensues. Figure 4 shows the bifurcation diagram for Φ(φ; α). From the bifurcation diagram, the orbit appears to cover dense subsets of the unit interval when α > 2/3. The bifurcation diagram appears like that of the tent map (not shown; see Alligood et al., 1996;Dodds et al., 2012), except that the branches to the right of the first bifurcation point are separated here by the interval of period 2 orbits.

The effect of conformists, an aside
Suppose some fraction c of the population is made up of individuals without any off-threshold (alternatively, each of their off-thresholds φ off = 1). These individuals are conformist or "purely pro-social" in the sense that they are perfectly happy being part of the majority. For simplicity, assume α = 1. The map Φ(φ; c) = 2φ for 0 ≤ φ < 1/2 and 2 − 2(1 − c)φ for 1/2 ≤ φ ≤ 1. If c > 1/2, then the equilibrium at 2/3 is stable. Pure conformists, then, can have a stabilizing effect on the process. We expect a similar effect when the network is not dense.
6.2 Mean field 6.2.1 Analysis In this specific example, we can write the degree-dependent map F k (ρ; f ) in terms of incomplete regularized beta functions (NIST, 2012). Since f is understood to be the tent map, we will write F k (ρ; f ) = F k (ρ). First, use the piecewise form of Eqn. (6.1) to write We have let M = ⌊k/2⌋ for clarity (⌊·⌋ and ⌈·⌉ are the floor and ceiling functions) and used the fact that the binomial distribution k j ρ j (1 − ρ) k−j sums to one and has mean kρ. For n ≤ M , we have the identity where I x (a, b) is the regularized incomplete beta function and (k) n = k(k − 1) · · · (k − (n − 1)) is the falling factorial (Winkler et al., 1972;NIST, 2012). This is an expression for the partial (up to M ) nth factorial moment of the binomial distribution with parameters k and ρ. Note that when n = 0 we recover the well-known expression for the binomial cumulative distribution function. So, When 0 ≤ ρ ≤ 1/2, the form of Eqn. (6.4a) can be used to show directly that F k (ρ) is bounded above by the tent map f (ρ), which we already knew from the properties of the Bernstein polynomials.
Finally, note that the active edge fraction ρ(t) ≈ φ(t), the active node fraction. This is because Poisson random graphs are highly regular, with q k = kp k /k avg = p k−1 ≈ p k . Thus the mean field dynamics for active edge density are effectively the same as for active node density.

Numerical algorithm
The map g(ρ; p k , f ) is parametrized here by the network parameter k avg , since p k is fixed as a Poisson distribution with mean k avg and f is the tent map, and we write it as simply g(ρ; k avg ). To evaluate g(ρ; k avg ), we compute F k (ρ) using Eqn. (6.4) and constrain the sum in Eqn. (5.2) to values of k with ⌊k avg − 3 k avg ⌋ ≤ k ≤ ⌈k avg + 3 k avg ⌉. This computes contributions to within three standard deviations of the average degree in the graph, requiring only O( k avg ) evaluations of Eqn. (6.4).
The representation in Eqn. (6.4) allows for quick numerical evaluation of F k (ρ) for any k, which we performed in MATLAB using the built-in routines for the incomplete beta function.
In Figure 3, we show g(ρ; k avg ) for k avg = 1, 10, and 100. We confirm the conclusions of Section 5.2: g(ρ; k avg ) is bounded above by f (ρ), and g(ρ; k avg ) ր f (ρ) as k avg → ∞. Convergence is slowest at ρ = 1/2, and the kink that the tent map has there has been smoothed out by the effect of the Bernstein operator.

Simulations
We performed direct simulations of the on-off threshold model for the D-F, P-F, and P-R designs, in the abbreviations of Table 1. Unless otherwise noted, N = 10 4 . For all of the bifurcation diagrams, the first 3000 time steps were considered transient and discarded, and the invariant density of ρ was calculated from the following 1000 points. For plotting purposes, the invariant density was normalized by its maximum at those parameters. For example, in Figure 4 we plot P (φ|α)/ max φ P (φ|α) rather than the raw density P (φ|α).
To compare the mean field theory to those simulations, we numerically iterated the edge map ρ(t + 1) = G(ρ(t); k avg , α) for different values of α and k avg . We then created bifurcation diagrams of the possible behavior in the mean field as was done for the simulations.

Results
We show results for the deterministic model on a small network in Figure 5. Here, N = 100 and k avg = 17. Starting from an initial active node at t = 0, the active population grows monotonically over the next 6 time steps. From t = 6 to t ≈ 80, the transient time, the active population fluctuates in a similar manner to the stochastic case. After t ≈ 80, the state collapses into a period 4 orbit.
We call the overall period of the system its "macroperiod." Individual nodes may exhibit different "microperiods." Note that the macroperiod is the lowest common multiple of the individual nodes' microperiods. In Figure 5, we observe microperiods 1, 2, and 4 in the timeseries of individual node activity. A majority of the nodes end up frozen in the on or off state, with approximately 20% of the nodes exhibiting cyclical behavior after collapse. The focus of this thesis has been the analysis of the on-off threshold model, and the D-F case has not been as amenable to analysis as the stochastic cases. A deeper examination through simulation of the deterministic case will appear in Dodds et al. (2012).
We explore the mean field dynamics by examining the limiting behavior of the active edge fraction ρ under the map G(ρ; k avg , α). We simulated the map dynamics for a mesh of points in the (k avg , α) plane. We plotted the 3-dimensional (3-d; N -d denotes N -dimensional) bifurcation structure of the mean field theory in Figure 6. We also made 2-d bifurcation plots for fixed k avg and α slices through this volume, shown in Figures 7 and 8. In all cases, the invariant density of ρ is normalized by its maximum for that (k avg , α) pair and indicated by the grayscale value. On the left, we plot the state evolution over time. The upper plot shows individual node states (black = active) sorted by their eventual level of activity, and the lower plot shows the total number of active nodes. We see that the contagion takes off, followed by a transient period of unstable behavior until around time step 80, when the system enters a macroperiod 4 orbit. Note that individual nodes exhibit different microperiods (see Sec. 6.4). On the right, we show the network itself with the initial seed node in black in the lower right. Figure 6: The 3-dimensional bifurcation diagram computed from the mean field theory. The axes X = average degree k avg , Y = update probability α, and Z = active edge fraction ρ. The discontinuities of the surface are due to the limited resolution of our simulations. See Figure 7 for the parameters used. This was plotted in Paraview. The top row (a-c) shows slices for fixed k avg . As k avg → ∞, the k avg -slice bifurcation diagram asymptotically approaches the bifurcation diagram for the dense map, Figure 4. Note that the first bifurcation point, near 2/3, grows steeper with increasing k avg . The bottom row (d-f) shows slices for fixed α. The resolution of the simulations was α = 0.664, 0.665, . . . , 1, k avg = 1, 1.33, . . . , 100, and ρ bins were made for 1000 points between 0 and 1. Figure 8: Bifurcation diagram from fully stochastic (P-R) simulations. The same parameters were used as in Figure 7, which has the same structure only more blurred.
The mean field map dynamics exhibit period-doubling bifurcations in both parameters k avg and α. Visualizing the bifurcation structure in 3-d ( Figure 6) shows interlacing period-doubling cascades in the two parameter dimensions. These bifurcations are more clearly resolved when we take slices of the volume for fixed parameter values. The mean field theory (Figure 7) closely matches the P-R simulations (Figure 8). The first derivative ∂G(ρ; k avg , α)/∂ρ < ∂Φ(ρ; α)/∂ρ for any finite k avg , so the bifurcation point α = 2/3 which we found for the dense map Φ is an upper bound for the first bifurcation point of G. The actual location of the first bifurcation point depends on k avg , but α = 2/3 becomes more accurate for higher k avg (it is an excellent approximation in Figures 7c and 8c, where k avg = 100). When α = 1, the first bifurcation point occurs at k avg ≈ 7.
The bifurcation diagram slices resemble each other and evidently fall into the same universality class as the logistic map (Feigenbaum, 1978(Feigenbaum, , 1979. This class contains all 1-d maps with a single, locally-quadratic maximum. Due to the properties of the Bernstein polynomials, F k (ρ; f ) will universally have such a quadratic maximum for any concave, continuous f (Phillips, 2003). So this will also be true for g(ρ; k avg , f ) with k avg finite, and we see that k avg partially determines the amplitude of that maximum in Figure 3. Thus k avg acts as a bifurcation parameter. The parameter α tunes between G(ρ; k avg , 1) = g(ρ; k avg , f ) and G(ρ; k avg , 0) = ρ, so it has a similar effect. Note that the tent map f and the dense limit map Φ are kinked at their maxima, so their bifurcation diagrams are qualitatively different from those of the mean field. The network, by constraining the interactions among the population, causes the mean field behavior to fall into a different universality class than the response function map.

Conclusions
We constructed the on-off threshold model as a simple model for social contagion resulting from limited imitation. We see that including an aversion to total conformity results in more complicated, even chaotic dynamics. This model also allows us to study the effects of differing amounts of fixedness in the social network and individual response functions, and we developed a detailed mean field theory which is exact for random mixing versions of the model. Finally, we applied the theory to a specific case, where the network is Poisson and the response functions average to the tent map.
The model exhibits rich mathematical behavior. The deterministic case, which we have barely touched on here, merits further study. In particular, we would like to characterize the distribution of periodic sinks, how the collapse time scales with system size, and how similar the transient dynamics are to the mean field dynamics. Furthermore, the model should be tested on realistic networks. These could include power law or small world random graphs, or real social networks gleaned from data. In a manner similar to Melnik et al. (2011), one could evaluate the accuracy of the mean field theory for real networks.
Finally, the ultimate validation of this model would emerge from a better understanding of social dynamics themselves. Characterization of people's true response functions is therefore critical (some work has gone in this direction; see Centola, 2010Centola, , 2011Romero et al., 2011;Ugander et al., 2012).
Comparison of model output to large data sets, such as observational data from social media or online experiments, is an area for further experimentation. This might lead to more complicated contextand history-dependent models. As we collect more data and refine experiments, the eventual goal of quantifiably predicting human behaviors, including fashions and trends, seems achievable.