AGenerativeModel of theMutual Escalationof Anxiety Between Religious Groups

We propose a generative agent-basedmodel of the emergence and escalation of xenophobic anxiety in which individuals from two di erent religious groups encounter various hazards within an artificial society. The architecture of the model is informed by several empirically validated theories about the role of religion in intergroup conflict. Our results identify some of the conditions and mechanisms that engender the intensification of anxiety within and between religious groups. We define mutually escalating xenophobic anxiety as the increase of the average level of anxiety of the agents in both groups over time. Trace validation techniques show that themost common conditions underwhich longer periods ofmutually escalating xenophobic anxiety occur are those inwhich the di erence in the size of the groups is not too large and the agents experience social and contagion hazards at a level of intensity that meets or exceeds their thresholds for those hazards. Under these conditions agents will encounter out-groupmembers more regularly, and perceive them as threats, generating mutually escalating xenophobic anxiety. The model’s capacity to grow the macro-level emergence of this phenomenon from micro-level agent behaviors and interactions provides the foundation for future work in this domain.


Introduction
. Does religion play a causal role in promoting anxiety between groups? Do anxiogenic contexts play a causal role in promoting religiosity? If so, under what conditions and through which mechanisms? Because of their relevance for international security and public policy, these sorts of research questions have been attracting more attention in recent years (To et al. ). In this article, we present an agent-based model of mutually escalating xenophobic anxiety between religious groups that incorporates insights from a variety of theories that provide (partial) answers to these questions. We define mutually escalating xenophobic anxiety as the increase of the average level of anxiety of the agents in both groups over time. .
This phenomenon, which is well documented empirically, can reach a boiling point and lead to intergroup violence (Brubaker ; Neuberg et al. ; Haushofer et al. ). Although our model does not explicitly simulate violence, we begin with two examples of mutually escalating xenophobic anxiety that did in fact lead to manifestations of extremely intense levels of physical conflict, albeit at quite di erent time scales (one lasting days, the other almost years).
. The now infamous Gujurat riots seem to have been triggered by an event that occurred on February , , when a Sabarmarti Express train filled with Hindu pilgrims returning to Gujarat from the Ayodhya Temple stopped in the town of Godhra. According to reports, Hindu activists were chanting religious slogans and insulting Muslim residents. Fi een minutes later, one of the train cars -the S coach -caught fire and became engulfed in flames. Close to people, mostly pilgrims, died in the fire. The charred remains were put on display in Ahmedabad, Gujarat's largest city, and the state's Chief Minister at that time, Narendra Modi, endorsed a widespread strike. Hindu nationalists blamed Muslims for the death of the pilgrims. They began rioting, which spilled over into ritualistic killings of Muslims. These riots -and counter-attacks by Muslims -were savage. An estimated , -, people died (mostly Muslims). , homes and businesses, places of worship were destroyed, and , people were displaced. Members of each religious group profoundly contributed to the escalation, and police o icials declared that both sides were at fault (Dugger ; Sta ). .
Our second example of mutually escalating xenophobic anxiety between religious groups, which also led to manifestations of violence, lasted much longer. During the period of Northern Ireland's history called The Troubles ( -), Roman Catholic groups committed to a unified Ireland (the unification of Northern Ireland and the Republic of Ireland) were in conflict with Protestant groups committed to defending the British rule of Northern Ireland. During this period there were over , deaths, and over , people were injured from both communities (including police forces, which were considered to be aligned with the Protestants). Although the Troubles were marked by several stages of punctuated anxiety and violence, such as the Battle of the Bogside and Bloody Sunday, there is evidence of mutually escalating anxiety between the two groups throughout the duration of the conflict. Figure shows the mutual escalation of periods of at least three years in length, as manifested by the number of shootings between the two groups (Fay et al. ; Mulholland ). The data in Figure is taken from the Conflict Archive on the Internet (CAIN) Web Service (Hopkins ). .
In the next section, we identify some of the prior computational e orts and recent theoretical developments that inspired our model. We then describe the entities of the model, as well as the rules guiding their initialization, decisions and interactions. Next, we report on the results of our parameter sweeps of the model and trace validation analyses, which shed light on the conditions under which -and the mechanisms by whichintergroup anxiety can emerge and escalate. Our results show that the most common conditions under which longer periods of mutually escalating xenophobic anxiety occur are those in which the di erence in the size of the groups is not too large and the agents experience social and contagion hazards at a level of intensity that meets or exceeds their thresholds for those hazards. We discuss the validity and limitations of the model and conclude with a summary our findings.

Related Work & Background
. Our model draws on social influence modeling and has similarities to a number of existing agent-based models.
In this section, we first review social influence modeling and then describe some of the ABMs that are most closely related to our work.

Social influence modeling .
Social influence is an important factor in human interaction. In social encounters individuals can modify their opinions, attitudes, beliefs, or behavior to mimic or to oppose those with whom they are interacting. Such modifications may be the result of persuasion, uncertainty, or peer pressure (Flache et al. ). .
Many early social influence models included agents whose opinion on a position could be socially influenced on a continuous spectrum (Abelson ; Berger ; DeGroot ; Lehrer ). For example, agents might try to find an appropriate speed on an interstate highway. Some later models involved simulating opinions that required a choice between mutually exclusive options, rather than varying on a continuous scale (Axelrod ; Latané ; Liggett ; Sznajd-Weron & Sznajd ). For example, agents might shi their opinions about political parties, music, or movies. In some cases, it is possible to model mutually exclusive options as nominal traits on a continuous spectrum (Nowak et al. ; Flache et al. ; Gore et al. ). .
Recently, researchers have identified three classes of social-influence models that are the most popular in agent-based modeling. These classes of social influence models are: ( ) assimilative social influence ( . For models with similarity biased influence, only su iciently similar individuals can influence each other to reduce opinion di erences. How much similarity is su icient depends on other mechanisms included in the model (e.g., social identity, confidence in others). Consensus can be avoided in similarity biased influence models. However, if the similarity bias is su iciently strong, then multiple homogenous but distinct clusters of individuals emerge. In such cases, however, opinions never leave the initial range (De uant et al. ; Hegselmann et al. ; Flache et al. ).
. In models with repulsive influence, when individuals are su iciently dissimilar they can influence each other in ways that increase opinion di erences. The amount of dissimilarity needed to trigger repulsive influence depends on other mechanisms included in the model (e.g., social identity, ego-involvement). Here too consensus can be avoided. Clusters can also form and adopt maximally opposing views (bi-polarization). These dynamics allow opinions to leave the initial range (Flache et al. ).

.
Our model uses assimilative social influence to determine the religiosity of agents. Our measure of religiosity has two dimensions and each dimension uses a di erent social network to determine the assimilative social influence. The two dimensions of religiosity and the social networks corresponding to each are discussed in Section .

Social conflict models .
Other models have explored the role of cultural di erentiation and boundary clarification in shaping the dynamics of ethnic anxiety and violence (Lim et al. ). For example, Axelrod's dissemination of culture model simulated a variety of mechanisms showing how interactions among di erent cultural features challenge intuitive assumptions about individuals' beliefs and interpersonal behavior and group dynamics (Axelrod ). In related work, models developed by De uant and colleagues have focused on dynamic regimes within which moderate groups are more or less susceptible to violent conflict resulting from social interaction (De uant et al. ). More recently, Upal and Gibbon developed an agent based system for simulating the dynamics of social identity beliefs that aimed at isolating factors that contribute to intergroup conflict (Upal & Gibbon ). .
Another recent social conflict model accounts for meso-and macro-level variables such as social processes and cultural ideologies that can promote and justify violent behaviors, which in turn provide some individuals with a significance gain (Kruglanski et al. ). These variables include a motivational need to (re)gain personal significance, the availability of a narrative or ideology that can justify the behavior, and a social network whose group dynamics lead an individual to embrace the ideology (Webber et al. ). The model also recognizes that an individual must have the ability (subjective and objective capacity) to carry out extreme behaviors (Kruglanski et al. ).

Background .
Our modeling of intergroup conflict focuses on the role of "religion," a term whose definition and use is highly contentious within and across many disciplines. Our strategy is to operationalize religion in a way that can serve our research purpose; namely, identifying some of the conditions for (and causes of) escalating anxiety that may (or may not) lead to violence. Building on research within the bio-cultural study of religion, we use the term religiosity to designate "shared imaginative engagement with axiologically relevant supernatural agents" (Shults ). By axiologically relevant supernatural agents, we mean disembodied intentional forces that members of a group consider in some sense germane to their values and capable of influencing their future. By shared imaginative engagement, we mean participation in ritualized behaviors organized around or oriented toward such agents. This sort of behavior typically signals and promotes individuals' sense of belonging to the group as well as their willingness to cooperate and remain committed in the face of threats from other groups and environmental challenges.

.
Research conducted in the scientific study of religion suggests that these beliefs and behaviors are engendered by two broad types of evolved disposition: ( ) the tendency to infer the causal e icacy of supernatural agents when trying to make sense of the world; and ( ) the tendency to prefer the moral normativity of a supernatural coalition when trying to act sensibly in society (Shults ). We utilize the phrases anthropomorphic promiscuity (AP) and sociographic prudery (SP), respectively, to refer to these two dimensions (Shults , ). The integration of these "religious" tendencies are indicated in the lower le quadrant of Figure . .
These phrases are borrowed from the writings of the first author of this article, who has elsewhere exposited and analyzed empirical findings and theoretical developments within the bio-cultural study of religion that support these claims (Shults , , ). Within the context of a broader argument in the scientific study of religion, the rhetorical function of this terminology is to play on the metaphor of "bearing gods," suggesting that supernatural agent conceptions are "born" in human minds as a result of hyper-active tendencies to detect hidden, human-like agents, and "borne" in human cultures as a result of hyper-active tendencies to protect familiar, ritualized in-group norms. For the purposes of the current model, we consider these to be the crucial components of religiosity.

.
The horizontal axis in Figure represents a spectrum on which one can indicate the tendency of a person to guess "humanlike supernatural force" when confronted with ambiguous or frightening phenomena in the natural environment. The anthropomorphically promiscuous (those with high AP) are always on the lookout, jumping at opportunities to postulate such hidden intentional agents as causal explanations. The who are prudish in their anthropomorphism (those with low AP) are less likely to make these inferences because they tend to reflect more carefully before giving into an intuitive desire to grab at these types of explanations.
. The vertical axis represents a spectrum on which one can register how tightly a person binds him or herself to the conventional modes of social practice regulated by the supernatural authorities of the coalition(s) with which he or she primarily identifies. Sociographic prudes (those with high SP) are strongly committed to the social norms of their in-group, following and protecting them even at great cost to themselves. They are more likely to be suspicious of out-groups and to accept claims or demands that appeal to authorities within their own coalition. Those who are promiscuous in their sociography (having low SP) are more open to social intercourse with outgroups about alternate normativities. Such persons are also less likely to accept restrictions or assertions that are based only or primarily on appeals to convention. A particular value along one of these dimensions does not dictate a particular value along the other dimension. In other words, an individual might have high AP and low SP or vice versa.
The model described below builds on an earlier model we developed to explore the relationship between mortality salience and religiosity, as defined above (Shults et al. ). That model's architecture was informed by the literature on terror management theory (TMT), which suggests that when death awareness is an "input" within the human cognitive system two of the most common "outputs" are increased acceptance of the existence of hidden intentional forces (especially supernatural agents) and increased resistance to engaging other cultures (Norenzayan & Shari ; McGregor et al. ). In other words, the activation of the terror management system promotes anthropomorphic promiscuity (high AP) and sociographic prudery (high SP). Relying on appeals to supernatural causes to help explain confusing or threatening events and complying with supernatural conventions can ease psychological anxiety and strengthen in-group cohesion. Shared imaginative engagement with axiologically relevant supernatural agents amplifies the naturally evolved human tendencies to detect intentional forces and protect ritual coalitions.
The agent architecture of our new model also includes mechanisms informed by the social identity theory (SIT) of intergroup conflict. Here social identity refers to aspects of an individual's self-image that are shaped by his or her sense of belonging to a particular social category. This theory hypothesizes that pressures to evaluate one's own group positively through in-group/out-group comparisons leads social groups to attempt to di erentiate themselves from each other (Tajfel & Turner ). The interaction between groups can be determined by value laden social di erentiations that ratchet up tension between the groups, which can then lead to conflict and violence (Tajfel ). Because it focuses on the double role of group membership and social categorization in shaping group cohesion and contributing to intergroup conflict, this theory is particularly relevant for our research into the mechanisms that lead to the emergence and escalation of religious conflict.
This model's architecture is also informed by identity fusion theory (IFT), another important research program bearing on the escalation of intergroup anxiety. Extreme identity fusion involves the blurring of personal and social identities such that the group comes to be regarded as functionally equivalent to the self. Much of the research on IFT focuses on the way in which this distinctive form of group allegiance, which is influenced by personality and situational factors, can lead to extreme behaviors (Swann Jr & Buhrmester ; Swann Jr et al. ). Identity fusion is a distinctive construct that refers to how individual identity interacts with group identity in a synergistic and reinforcing dynamic (Gómez et al. ). Less fused people may have strong beliefs about what sacrifices "ought" to be made for their group, but are less likely to act on those beliefs compared to highly fused people, who are more willing to kill, or even die, for the group (Swann Jr et al. ; Whitehouse et al. ).

Computational features .
The architecture of the current model also has several new computational features, including key aspects of Epstein's Agent_Zero (Epstein ). The dynamics in that model were configured in such a way that the intensification of a ect within an individual agent could (under certain conditions based on group interactions) reach a tipping point such that the agent passes a threshold that could be taken as a proxy for initiating (for example) a lynching or a genocide. These social contagion dynamics play a central role in our modeling of the function of religion in mutually escalating xenophobic anxiety because they allow us to implement relevant theories (Le Bon ( ; Canetti ; Mackay ( ; Browning & Chiappori ) related to emotional, cognitive, and social behaviors in group dynamics. Technical details are available in the electronic supplemental materials at https://github.com/SimRel/Merv1.0.

.
Drawing on insights from TMT, SIT, and IFT, this model highlights conditions under which the behavior of -and interaction between -individual agents can lead to mutually escalating xenophobic anxiety. This allows us to empirically investigate the relationships between individual agents with a specific set of cognitive mechanisms, and the group-level observations we expect to see arise from the interactions of these mechanisms within a population. For a graphic illustration, see Figure . Figure : Variable dependencies within the model that allow for identifying conditions under which mutually escalating xenophobic anxiety between religious groups emerge. .
As explained in more detail below and in the appendices, agents in the model are assigned to one of two groups, distinguished by their (simulated) variance of beliefs and ritual behaviors in relation to the supernatural agents postulated by each group. As the model runs, agents are subjected to di erent types of hazards that increase their stress and heighten their mortality salience. These encounters can provoke members of the groups to seek explanations and help from supernatural agents, and to turn to fellow group members for comfort and protection, thereby increasing their desire to engage in shared rituals (as predicted by TMT). As these ritual engagements intensify, some agents become more fused to their in-groups, which increases their propensity towards feeling anxious about out-group members (as predicted by SIT and IFT).

The Model
. The goal of our model is to generate mutually escalating xenophobic anxiety between two religious groups under theoretically sound conditions that are consistent with TMT, SIT, and IFT. Mutually escalating xenophobic anxiety occurs when the average anxiety level of agents in both groups increases over time. Figure  .
It is important to note that for mutually escalating anxiety to occur the final anxiety level of each escalation section for each group is not necessarily higher than the previous section for the group. For example, mutually escalating anxiety can occur where the average anxiety level of each group during the final escalation in a series is not the highest level achieved during the simulation run.
. We chose the main elements of the architecture (agent traits, networks, hazards, group identities, etc.) with the goals of the model in mind. While many other variables and factors are relevant for mapping a phenomenon as complex as religious conflict, we aimed for a level of abstraction that captured the most salient and empiricallyresearched mechanisms that bear on this type of intergroup conflict. In the remainder of this section, we describe the architecture of our model including: ( ) the entities within the model, ( ) the process used to initialize the entities, and ( ) the rules that dictate the interactions among them.

Model entities .
Our model is made up of N agents separated into two groups interacting in a two-dimensional landscape. The two groups of agents are: ( ) a majority group and ( ) a minority group. The disparity in size between these Figure : Three series of mutually escalating anxiety within a single model run.
groups can vary from negligible ( agents) to extreme (N -agents). Each group is composed of individuals who share a set of distinctive supernatural beliefs and ritual behaviors.
. Within a given group, an agent is connected to a subset of the other agents. These connections represent relationships of closeness (e.g., sibling, friend, trading partner) within the group. Within each agent, religiosity is measured as a combination of two variables: anthropomorphic promiscuity (AP) and sociographic prudery (SP). Recall, AP indicates the level of an individual's tendency to interpret ambiguous phenomena as caused by supernatural agency, and SP indicates the level of an individual's tendency to participate in the in-group ritual behaviors of a supernatural coalition. AP and SP are represented as positive numbers. Lower positive values reflect lower levels of AP or SP, while higher positive values reflect higher levels.
. At every time step, the model environment produces hazards that may be of four di erent types: natural hazards (e.g., earthquake or volcano), predation hazards (e.g., prowling predatory animal), social hazards (e.g., cultural other interpreted as a threat), and/or contagion hazards (e.g., out-group member with apparent contagious disease). The first two of these hazards have to do with nature, broadly speaking, while the latter two hazards are related to other human beings encountered in society. For a social and contagion hazard to occur in the model an agent must be able to identify another agent from the out-group within a specified radius. Natural and predation hazards have no such requirement. Every hazard has an intensity determined by a triangular distribution with a minimum, mode and maximum parameter. The values of these parameters can range from (no intensity) to (maximum intensity).
. Our use of the triangular distribution reflects our lack of knowledge about the distribution of these hazards. While we know that the intensity of these hazards do not follow a uniform distribution, we do not know the exact shape. As a result, we model the intensity with the minimum value and maximum value and an "inspired guess" as to the modal value. This captures the information known while preserving uncertainty where information is not known. In other words, it is the probability density function with the fewest assumptions that embodies a non-uniform random variable with a given minimum, mode and maximum (Maria ). In Section we explore using an alternative distribution to model hazards and do not find a material di erence in the reported results. .
For each type of hazard, each agent has a threshold that determines the intensity a hazard must meet or exceed for them to perceive it. An agent's threshold for each type of hazard can vary from (no threshold) to (maximum threshold). Recall, social and contagion hazards require an additional condition: not only must the hazard level exceed the agent's threshold but the agent must be within a specified distance to an out-group agent on the landscape for the hazard to be perceived. It is important to note that the perception of an out-group agent only has to do with the position of the agent, not its inclusion within a social network. .
The perception of hazards causes agents to increase their level of anxiety. In contrast, not perceiving hazards decreases an agent's level of anxiety. Within each agent, an anxiety level is represented as a real number. Lower values reflect lower levels of anxiety, while higher values reflect higher levels. .
Each agent also has a hyper-vigilance threshold. This reflects the level of anxiety at which an agent searches for other agents within his/her group to share in a religious ritual. Over time, sharing in a religious ritual decreases the anxiety levels of all participating agents below their hyper-vigilance thresholds.
. An overview of these entities, with their attributes and representation, are provided in Appendix B-D. Additional model-level attributes discussed in the following section are also included in Appendix B-D.

Initialization of entities .
At initialization N agents are created. Upon inception each agent is assigned a threshold for each type of hazard, a specified distance to look for agents from the opposite group in the process of perceiving social and contagion hazards, and a hyper-vigilance threshold. In addition, each agent is assigned an initial AP and an initial SP value. Each of these values is determined by sampling the distribution specified by the respective model-level parameters' triangular distribution. Also, the anxiety level of each agent is initialized to zero. Once again, the use of our triangular distribution here reflects our lack of knowledge about the distribution of AP and SP, other than that the distribution is not uniform. As noted in . , this follows the best practices for modeling a distribution with these characteristics, as specified in Maria ( ). .
Next, the landscape is initialized as a N x N grid, where N is the size of the population. The size of the landscape is static; it does not change throughout the simulation run or between simulation runs. The minimum, mode and maximum intensity value of the triangular distributions used to generate each type of hazard are initialized using the respective model-level parameters.
. Finally, each agent is placed within one of the two groups at random until one group reaches the specified size.
A er this point all remaining agents are assigned to the other group. Once an agent is assigned to a group, each agent is assigned a social network. The social network is generated using a Watts-Strogatz model. This model produces a set of in-group connections for agents with small-world properties, including short average path lengths and high clustering among agents (Watts & Strogatz ). It is important to note that the social network only dictates in-group connections; an agent is not connected to an agent from the other group (i.e. out-group). Figure shows a screen shot of a population of agents ( majority group / minority group) with the social network connections among the agents highlighted. created for the agent. Recall that a requirement for an agent to experience a social or a contagion hazard is for the agent to locate another agent from the other group within a specified radius. The intensity of each of these hazards is determined by sampling the triangular distribution defined by the aforementioned model-level parameters. It is important to note that (given this architecture) hazards occur only for individual agents; multiple agents do not experience the same hazard. While this abstraction does not capture some aspects of real-world interaction, it provides a simple and computationally e icient method for modeling natural and predation hazards. For each hazard the agent updates its anxiety level according to Equation .
Once the agent is done testing if each hazard is perceived, it moves to a random location on the landscape.
Equation is a parameterized Rescorla-Wagner model of classical conditioning, in which learning is conceptualized in terms of associated stimuli (Rescorla ). This serves as a simple explicit model of individual emotion in the context of groups, and has been empirically validated in a variety of studies, including some showing ( ) that phasic firing of midbrain dopamine neurons carries a signed error signal consistent with the Rescorla-Wagner model (Rescorla ) and ( ) that animal (rat, rabbit and pigeon) learning and behavior is consistent with the Rescorla-Wagner model (Myers et al. ; Roesch et al. ). .
When hazards are perceived, the rate of the stimuli (β) in the equation is set to and the association value (λ) is set to . Since an agent's anxiety level cannot exceed . , these parameters reflect an incoming hazard that increases the anxiety level of the agent. Conversely, when hazards are not perceived, the rate of the stimuli (β) is set to . and the association value (λ) is set to . This reflects the agent's anxiety level decaying without the presence of the stimulus. .
The right side of Figure highlights those actions that occur if the anxiety level of the agent exceeds the agent's hyper-vigilance threshold. When this occurs the agent searches for other agents in the same group who have also surpassed their hyper-vigilance threshold and seek to share in a religious ritual. The process of seeking out potential ritual partners begins with the agent searching his/her social network connections, then (if necessary) searching the social network connections of each agent to which s/he is connected. These rituals reflect the sort of religious meetings that typically occur a er an individual tragedy or stressful time (Murphy et al. ; Gozdziak ). .
If an agent finds a su icient number of agents who have also passed their hyper-vigilance thresholds then a ritual cluster is formed among the agents. While agents are scanning for, or are in, a ritual cluster they can no longer experience hazards. Furthermore, agents in a cluster are unavailable to participate in ritual clusters with other agents. If an agent is unable to find a su icient number of agents to form a ritual cluster then s/he continue the search in the next time step.
. Once a ritual cluster is formed: ( ) the AP value of the agent is increased according to Equation , ( ) the SP value of the agent is increased according to Equation , and ( ) the anxiety of all the agents in the cluster is decreased according to Equation when a hazard is not perceived. These actions occur for each agent in the cluster each time step. When the anxiety level of each agent in the cluster is below each agent's hyper vigilance threshold then the ritual is complete and the cluster disbands. Figure shows a screen shot of a population of agents ( majority group / minority group) where three ritual clusters exist ( majority group / minority group) at the given time step.
ap current + mean(ap ritual−cluster−members ) mean(ap all−group−members ) ( ) sp current + mean(sp all−group−members ) mean(sp all−members−of −other−group ) ( ) Figure : A population of agents ( majority group / minority group) where three ritual clusters exist ( majority group / minority group) at the given time step.
. The di erence in equations and reflects the di erence between the two dimensions of religion: AP and SP. Recall that AP is an agent's tendency to interpret ambiguous phenomena as caused by supernatural agency, while SP is the agent's tendency to participate in the in-group ritual behaviors of a supernatural coalition. .
Forming and participating in a ritual cluster reflects an increase in both dimensions. First, forming a ritual cluster reflects SP. In our model all the agents in a group decide to try and conduct a ritual as a means to reduce anxiety. As a result, the calculation of the SP increase (Equation ) of the agent is based on the average SP of all the members of the agent's group. In contrast, an agent's participation in a ritual reflects AP. Those in a ritual cluster of agents embrace a supernatural-based causal explanation of ambiguous phenomena they have experienced. The reduction of anxiety derived from this explanation is specific to the ritual cluster members; it is not shared by the whole group. As a result, the calculation of the AP increase (Equation ) is based on average AP of the members of the cluster, not of the entire group to which the agent belongs. .

Results
This percentage is significant. If our model sampled probability distributions randomly we would expect a far greater proportion of time steps ( . %) to occur within windows of escalating anxiety, whether the duration of escalation is short or long. But we see . % not . %. This relatively low percentage reflects the manner in which conditions within our model must combine to produce escalating levels of anxiety.
. Within our model, when intervals of escalating xenophobic anxiety do emerge, they are sustained for varying periods of time and can play out in at least three di erent ways, the first of which is the only type that is mutually escalating: ( ) both the majority and minority group experience an increase; ( ) the majority group experiences an increase, while the minority group does not; and ( ) the minority group experiences an increase, while the majority group does not. We are interested in the first type of escalating anxiety because it is mutual: both the majority and minority populations increase their levels of anxiety.
.  . It also shows that the most common escalating xenophobic anxiety time series is: Minority Group Escalating / Majority Group Not. Recall that a requirement for an agent to experience a social or a contagion hazard is for the agent to locate another agent from the other group within a specified radius. Since there are more majority group agents than minority group agents, minority group agents have an easier time locating agents on the landscape from the majority group. This results in agents within the minority group experiencing more encounters with potential social and contagion hazards, thereby making a ect increases more likely.

Religiosity variables & anxiety .
We also analyzed the relationship between decreases in anxiety and increases in the two dimensions of religiosity in agents: AP and SP. To explore the relationships among these three quantities as they shi in the model we first isolated any interval of consecutive time steps collected during our parameter sweep of the model in which there was a decrease in the average anxiety level, and an increase in the AP level, or an increase in the SP level in either the majority or the minority group. Then we computed the correlation of change between anxiety, AP and SP across both groups.
. The Pearson correlation across each of these three quantities for intervals of two or more time steps is presented in Table . . These results show that as the anxiety in both groups decreases, the AP levels in both groups tend to increase in the same direction. The results also show that there is less correlation between the decrease in the anxiety level and increase in SP level (+ . ). In other words, during periods when anxiety is being decreased the religiosity of both the majority and minority group increases, but this overall increase in religiosity is driven by AP more than SP.
. These dynamics highlight the importance of the role of rituals in decreasing anxiety and increasing AP (w.r.t the ritual cluster) and SP (w.r.t the group) in our model. The performance of rituals is a unique feature of the model that enables agents to mediate the e ects of hazards through social interaction with other hyper-vigilant members within their group. The increase in religiosity is driven by AP as opposed to SP because AP is increased with respect to the ritual cluster while SP is increased with respect to the group. Recall, SP is increased with respect to the group because it reflects the act of forming a cluster with in-group members. AP is increased with respect to the ritual cluster because it reflects the construction of a supernatural explanation of those hazards which is specific to the agents in the cluster. .
The increases with respect to the ritual cluster (AP) are larger than the increases with respect to the group (SP) because it is likely that at least one agent in a ritual cluster has participated in a ritual cluster before. This occurs because the ritual cluster disbands when the anxiety level of each agent in the cluster is below the hypervigilance threshold. This leaves at least one agent with increased AP and SP but with an anxiety level just below the hyper-vigilance threshold. As a result, this agent is likely to quickly experience a hazard and need to re-enter a ritual cluster. Thus, when AP is increased in a ritual cluster the magnitude of the increase is o en influenced by the already high AP value of an agent who has previously participated in ritual clusters. However, when SP is increased it is always calculated with respect to the average value of the whole group. This reduces the influence of the magnitude of an increase in SP from agents who have previously participated in ritual clusters. The result is the emergence of influence from agents who regularly exceed the hyper-vigilance threshold on the AP dimension of the religiosity of the group. In the next subsection we identify the specific conditions that need to be present for mutually escalating xenophobic anxiety to exist and be maintained over a period of time.

Isolating the causes of mutually escalating xenophobic anxiety .
To identify the conditions associated with mutually escalating xenophobic anxiety, we use a trace validation technique specifically designed for analyzing agent-based models (Gore et al. ). We provide an overview of the trace validation technique here, but it is described in more detail in Appendix A. This technique utilizes a structured approach to capture data throughout execution (i.e., records a trace of the execution) and uses this trace data to automatically construct sets of conditions pertaining to the input parameters. These conditions are then used to quantify the extent to which combinations of agent and model characteristics cause unexpected model behaviors based on an output of interest, such as mutually escalating xenophobic anxiety (Gore et al. ; Diallo et al. ). Our use of the term cause refers to model inputs that generate an output of interest (i.e., mutually escalating xenophobic anxiety) (Manzo ). This is similar to the use of the term in statistics (Cox ) as opposed to the use of the term cause in philosophy of science as described in Bunge ( ).
. The extent to which each generated condition contributes to mutually escalating xenophobic anxiety intervals is quantified by two measures: correlation and coverage. These measures are aggregated into a single score called suspiciousness. The name suspiciousness originated in the field of statistical debugging in so ware engineering because it was used to automatically localize faults in computer programs. The formulas for each measure are provided in Appendix A. .
The correlation measure captures the likelihood that, given the condition, the interval will be mutually escalating as opposed to Majority Group Escalating / Minority Group Not Escalating or Minority Group Escalating / Majority Group Not Escalating. The coverage measure is the percentage of all mutually escalating Intervals that exhibit the specified condition. The suspiciousness measure combines and balances the specificity and the coverage measures using the harmonic mean.
. Each measure has a maximum value of . and a minimum value of . . A suspiciousness value of . means that the condition is only true in intervals of mutually escalating anxiety and the condition is true in all cases of mutually escalating anxiety. In other words, the condition completely distinguishes all mutually escalating times series from any other escalating time series. The existence of such a condition is not guaranteed. However, conditions with higher suspiciousness scores will provide more separation between mutually escalating intervals and other escalating intervals than conditions with lower suspiciousness scores. .
Our trace validation approach scores each condition generated using the escalating intervals captured during the parameter sweep. This procedure iteratively applies to all intervals starting with a minimum length of time steps and ending with the maximum length ( ). For example, we can automatically generate conditions such as: ("% of Agents in the Majority Group < ", or "Average Contagion Hazard Threshold > Average Contagion Hazard Intensity"). Furthermore, this method can also detect complex conditions combining individual conditions with simple logical operators, such as AND, OR, and NOT. An example of a compound condition is: "(% of Agents in the Majority Group < ) AND (Average Contagion Hazard Threshold > Average Contagion Hazard Intensity)". A detailed explanation of how these conditions (i.e. predicates) and their correlation, coverage and suspiciousness scores are derived is presented in the Appendix. .
Given the measure of suspiciousness, we assume the conditions that create mutually escalating xenophobic anxiety will have two properties: ( ) their suspiciousness score will continually improve as the length of the interval increases, and ( ) the suspiciousness score for the longest intervals should be close to . . .
The rationale for the first property is that longer intervals reflect stronger expressions of mutually escalating xenophobic anxiety, and so a condition responsible for creating mutually escalating xenophobic anxiety should increase its suspiciousness measure as the length of the time series increases. The rationale for the second property is that the condition for strong expressions of mutually escalating xenophobic anxiety should be present in all of those intervals and only those intervals. Our selection of these properties is an attempt to filter out noise in the simulation created by the use of stochastics and to highlight the signal strength of the di erent rules in the simulation that govern agent behavior. .
A er generating and iteratively scoring each of the conditions, one condition increases suspiciousness as minimum length of the intervals increases, with a peak suspiciousness score of . . This condition was: (% of Agents in the Majority Group ≤ ) AND (Contagion Hazard Intensity ≥ Contagion Hazard Threshold) AND (Social Hazard Intensity ≥ Social Hazard Threshold).
. Figure demonstrates the increase of this condition's suspiciousness (shown in green) up to a peak of . as the minimum length of the escalating anxiety intervals increases relative to two other related conditions (shown in blue and red). .
The steady rise of the suspiciousness score demonstrates that the green condition is more frequently met in mutually escalating times series as the length of the time series increases. Figure also suggests that social and contagion threats (green and blue lines) are more impactful than natural and predatory threats (red line) on the escalation of anxiety.
. This result is readily interpretable. Mutually escalating xenophobic anxiety within the model is generated under the following three conditions: ( ) When the majority and minority group are created there is not too large a disparity in size between them; ( ) When the average intensity of a social hazard an agent experiences meets or exceeds the threshold the agent has for social hazards; and ( ) When the average intensity of a contagion hazard an agent experiences meets or exceeds the threshold the agent has for contagion hazards. The combination of these circumstances creates an environment where agents in the majority and the minority groups regularly identify agents from the other group within a specified radius and perceive them as social and contagion threats. Mutually escalating intervals are produced because both groups are operating under circumstances where they are likely to experience hazards, which increases anxiety.
. Figure also demonstrates that other, even somewhat similar, conditions do not provide as e ective an explanation for mutually escalating anxiety. For example, the suspiciousness score of the condition (the blue line) (% of Agents in Majority Group ≤ ) OR (Contagion Hazard Intensity ≥ Contagion Hazard Threshold) OR (Social Hazard Intensity ≥ Social Hazard Threshold) does not strictly increase with the minimum length of the escalating anxiety intervals, and thus does not distinguish mutually escalating intervals from other escalating intervals. .
The analysis in Figure further shows that the intensity and threshold of social and contagion hazards are more responsible for creating mutually escalating xenophobic anxiety than natural and predation hazards. The suspiciousness score for the condition (the red line) (% of Agents in Majority Group ≤ ) AND (Natural Hazard Intensity ≥ Natural Hazard Threshold) AND (Predation Hazard Intensity ≥ Predation Hazard Threshold) fluctuates as the minimum length of the escalating anxiety intervals increases, and so does not e ectively distinguish mutually escalating anxiety intervals from other escalating anxiety intervals.
. This makes sense because natural and predation hazards occur randomly at each time step and are una ected by the percentage of agents in the majority or minority group. Social and contagion hazards, in contrast, are triggered as agents search for out-group agents during each time step. While random natural and predation hazards that meet or exceed the threshold of agents will increase the number of perceived threats, it is unlikely that predation and natural hazards alone will be enough to cause agents in both groups to cross the threshold in consecutive time steps, and that is what is required for mutually escalating xenophobic anxiety to arise within the model.

.
The trace validation analysis yields a simple explanation for how mutually escalating xenophobic anxiety emerges within the model. The agents need to be distributed into two groups not too di erent in size, and the simulation must produce the conditions under which agents from both groups encounter social and contagion hazards at levels of intensity that meet or exceed their thresholds for the respective hazards. Agents will then encounter others from a di erent group regularly and perceive them as threats, creating mutually escalating xenophobic anxiety.
. It may appear as if this explanation relies only on system level properties (thresholds and population proportions) as opposed to interaction elements. However, upon closer inspection this is not the case. Mutually escalating xenophobic anxiety depends on there being enough agents in the minority group such that they are regularly encountered by and interact with the majority group agents. Without these interactions, the perceived social and contagion hazards that drive mutually escalating anxiety will not occur.
. Given knowledge of previous research, and access to Figure , this explanation may seem so simple as to appear trivial. However, many emergent behaviors generated from agent-based models seem obvious once one knows how they arise. Our use of trace validation highlighted the conditions that cause mutually escalating xenophobic anxiety to emerge in the model, and these are consistent with the conditions discovered in other empirical research on the role of social conflict in increasing anxiety and engendering violence (Reed et al. ; To ; Lemke ). These findings also provide some confidence that our model can produce valuable insights into real-world intergroup conflicts such as those that occured during the Gujurat riots. We are not claiming to have produced a novel explanation, but a novel computational model that illuminates some of the micro-level mechanisms at work in generating the macro-level phenomenon of mutually escalating xenophobic anxiety.

Model Validity and Limitations
. Concerns about external, construct, and internal validity all a ect the plausibility of our model. In addition to these validity concerns, our model has a number of limitations. Here we review each of these areas and discuss how they relate to our model.

External validity .
Concerns about external validity arise when the results of the model cannot be generalized. The results of our current model cannot be generalized to explain specific occurrences of (or to forecast) mutually escalating xenophobic anxiety. However, this does not mean that the model bears no relationship to the real world. It is an attempt to implement relevant theories based on empirical research that has helped to explain phenomena of the sort described in our two examples in the introduction. Terror management theory (TMT), social identity theory (SIT) and identity fusion theory (IFT) have been used to describe how conflict between religious groups increases anxiety, and can even lead to a willingness to commit acts of violence on behalf of an in-group.

Construct validity .
Concerns about construct validity are related to the appropriateness of the measures used to represent the entities in our model. While our model reflects a novel generative explanation of mutually escalating xenophobic anxiety, it is limited by our assumptions and choice of abstractions.
. First, the system and agents within our model are mostly static. By this we mean that they continue to behave according to the same mechanisms for a whole simulation run. In future work we will explore the interplay that results from adding more individual behavior mechanisms and network dynamics, taking advantage of existing research in computational sociology.
. Second, the initial anxiety level of each agent is within our model. One could note that this might create a potential for path dependence and atypical system convergence behavior. We have explored whether initializing agent anxiety to a uniform number in [ , ] changes our results in Section ; and it does not. However, in future work we will explore whether the results are sensitive to more varied initializations of agent anxiety.
. Third, the social networks in our model follow the Watts-Strogatz model to describe in-group relationships. While this seems reasonable given that in-group agents interact by conducting rituals with one another, it is not the only type of social network that may be applicable. We have investigated whether the results of the simulation experiments are sensitive to this assumption by exchanging the Watts-Strogatz network to describe in-group relationships with Random networks and Preferential Attachment networks. These changes do not have an e ect on our results. In future work we will explore whether the results are sensitive to other social network models of in-group relationships.
. Fourth, the intensity of the hazards within our model are generated using a triangular distribution. One could argue that this type of distribution is not observed in reality. We have investigated using a truncated normal distribution instead of a triangular distribution. The truncated normal distribution also meets our requirements of a non-uniform distribution with a minimum, maximum and central tendency. This change does not have a material e ect on our reported results.
. Finally, the largest concern related to construct validity involves equifinality. The construction of our model required us to make a series of reasonable assumptions to fill specificity gaps. While we did our best to address each gap with the most reasonable assumptions, we did not exhaustively explore all of the additional factors that could have been included. For example, the model omits the role of political actors who mobilize religious groups to intensify and calcify perceived di erences between them. It is possible that our interest in this topic may have biased our model construction. Many other reasonable assumptions could also have been made, and other factors could be included (Poile & Safayeni ). The technical choices in our model serve as recommendations for other researchers tasked with similar problems, and we welcome debate over alternatives for model construction. In future work we will use more input from qualitative research to inform new versions of the model.

Internal validity .
Internal validity concerns arise when factors a ect the dependent variables without the modelers' knowledge. It is possible that some implementation flaws could have a ected the evaluation results. However, the algorithms we used within our model passed several internal code reviews and the analysis presented in the Results Section combines the output of , model executions. In addition, we used established libraries whenever possible to minimize the amount of new code that would be included in the model or the analytical tools we developed.

Conclusion
. The experimental results of the model described in this article expand our understanding of the conditions under which -and the mechanisms by which -mutual xenophobic anxiety between religious groups can emerge and escalate. Its causal architecture, based on several leading theories about the relationships among components of religiosity and psychological and social anxiogenic factors generated macro-level phenomena from the micro-level behaviors and interactions of artificial agents in a simulated environment. The trace validation techniques we used show that the most common conditions under which longer periods of mutually escalating xenophobic anxiety occur are those in which the di erence in the size of the groups is not too large and the agents experience social and contagion hazards at a level of intensity that meets or exceeds their thresholds for those hazards. Under these conditions agents will encounter out-group members more regularly, and perceive them as threats, generating mutually escalating xenophobic anxiety. While the model has limitations related to its external, internal, and construct validity, it serves as a platform for future work in this domain.

Acknowledgments
Funding for this research was provided by (

Appendix A: Trace validation Statistical debugging
Our approach to trace validation employs predicates that are used in statistical debuggers. Statistical debuggers isolate the causes of so ware bugs using a set of inputs, corresponding execution traces, and a labeling of the execution traces as passing or failing (Liblit et al. ). The execution traces typically reflect the coverage of individual statements. The debuggers assign suspiciousness scores to statements to guide developers in locating faults. The equations below define the suspiciousness of a statement s. The correlation s of a statement reflects the likelihood of a statement s appearing in a failing execution trace, while the coverage s of a statement reflects the likelihood that a failing execution trace includes statement s. The suspiciousness of a statement balances these two rate measures via the harmonic mean. Developers examine the statements in decreasing order of suspiciousness until the fault is discovered. For the approach to be e ective, faulty statements must generally have higher suspiciousness scores than non-faulty statements.
In addition to profiling program statements, most statistical debuggers employ conditional propositions, or predicates, to record the values assigned to variables in an execution trace. For example, three predicates can be instrumented for every assignment statement in a program to test if a value being assigned to a variable is greater than, less than, or equal to zero. The suspiciousness of these predicates is calculated using the failing execution traces where the predicate is true, the total number of execution traces where the predicate is true and the total number of failing execution traces.
The addition of predicates (including those that are more complex than the three described above) enables statistical debuggers to analyze relationships within and among variable values. In theory and in practice this has been shown to improve e ectiveness of the statistical debugging (Liblit ; Gore et al. , ). Next, we describe the di erent types of predicates and how these predicates can be combined.

Predicates
Statistical debuggers employ two di erent types of predicates (single variable, scalar pairs) at two di erent levels of specificity (static and elastic) to localize bugs. The choice of type and the specificity-level defines a unique combination of conditions related to the variable(s) that the predicate captures. Two or more predicates can also be combined by generating compound predicates to gather insight about a variable's behavior at an additional level of granularity. Here we review predicate types, their specificity levels, and describe how they can be combined in a compound predicate.

Single variable predicates
A single variable predicate partitions the set of possible values that can be assigned to a variable x. Single variable predicates can be created at two levels of specificity: the static level and the elastic level. The most basic single variable predicates are static. Static single variable predicates are employed to partition the values for each variable x around the number zero: (x > 0), (x = 0) and (x < 0). These single variable predicates are referred to as static because the decision to compare the value of x to is made before execution. In contrast, the single variable elastic predicates use summary statistics of the values given to variable x to create partitions that cluster together values which are a similar distance and direction from the mean. For the variable x with mean µ x and standard deviation σ x , the elastic single variables predicates created are: (x > µ x +σ x ), (µ x +σ x > x > µ x − σ x ), (x < µ x − σ x ). These predicates reflect values of variable x that are well above their normal value, within their normal range of values and well below their normal value.

Scalar pair predicates
Scalar pair predicates capture the important relationships between two variables that elude single variable predicates. The most basic scalar pair variables are static. Static scalar pair predicates are employed to partition the di erence between a pair of variables, x and y, around the number zero: (x − y > 0), (x − y ≥ 0), (x − y = 0) (x − y ≤ 0) and (x − y < 0). These scalar pairs predicates are referred to as static because the decision to compare the di erence between x and y to is made before execution. In contrast, the scalar pairs elastic predicates use summary statistics of the di erence between x and y to create partitions that cluster together values which are a similar distance and direction from the mean. For the pair of variables x and y with mean di erence µ x−y and standard deviation σ x−y , the elastic scalar pairs predicates created are: (x − y > µ x−y + σ x−y ), (µ x−y + σ x−y > x − y > µ x−y − σ x−y ) and (x − y < µ x−y − σ x−y ). These predicates reflect di erences between the values of x and y that are well above the normal value, within the normal range of values and well below the normal value.

Compound predicates
Compound predicates reflect any combination of single variable and scalar pair predicates that can be composed using the logical operators ∧ (and) and ∨ (or). For any two predicates P and Q, two compound predicates are tested: ( ) the conjunction of the predicates (P ∧ Q) and ( ) the disjunction of the predicates (P ∨ Q). Once created a compound predicate can be combined with another compound predicate. Work in the field of soware engineering has shown that there is not a significant benefit to combining compound predicates together more than three times (Arumuga Nainar et al. ).

Putting it all together
To perform a trace validation of this ABM, we start by specifying one or more outputs of interest within the ABM for the validation. Next, we specify the range of values under which each output is considered valid. In the context of this paper this is mutually escalating anxiety occurring over a time series of at least length two. Then, we identify the entities of interest within the model to trace. These are specified in the Results Section. Next, we run the simulation for a set of inputs based on a parameter sweep. The parameter sweep is the sweep described in Section . . Finally, we collect the suspiciousness scores for each predicate (i.e. condition) generated for the set of entities of interest. The predicates and suspiciousness scores capture the relationship between: ( ) the conditions within and among the entities and the presence of the output (i.e. mutually escalating anxiety occurring over a time series of at least length two).