{'fraction_non_alphanumeric': 0.032985325782112294, 'fraction_numerical': 0.011598241265131091, 'mean_word_length': 4.77694156998014, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
The Timing and Nature of Behavioural Responses Affect the Course of an Epidemic

During an epidemic, the interplay of disease and opinion dynamics can lead to outcomes that are different from those predicted based on disease dynamics alone. Opinions and the behaviours they elicit are complex, so modelling them requires a measure of abstraction and simplification. Here, we develop a differential equation model that couples SIR-type disease dynamics with opinion dynamics. We assume a spectrum of opinions that change based on current levels of infection as well as interactions that to some extent amplify the opinions of like-minded individuals. Susceptibility to infection is based on the level of prophylaxis (disease avoidance) that an opinion engenders. In this setting, we observe how the severity of an epidemic is influenced by the distribution of opinions at disease introduction, the relative rates of opinion and disease dynamics, and the amount of opinion amplification. Some insight is gained by considering how the effective reproduction number is influenced by the combination of opinion and disease dynamics.


Introduction
There is a long history of modelling disease dynamics, starting with the basic SIR (susceptible-infected-recovered) model of Kermack and McKendrick (Kermack and McKendrick 1927;Brauer and Castillo-Chavez 2012). This model has been modified, critiqued, and analysed for nearly a century. Its limitations have inspired work that seeks to account for additional features of real epidemics. For example, economic epidemiology is used to model individuals who calculate the costs and benefits of their actions and are motivated by pessimism (Auld 2003), personal gain (Fenichel et al. 2011), or a planning horizon (Nardin et al. 2016). Other models are more behaviour-Extended author information available on the last page of the article based and incorporate the effect of fear (Epstein et al. 2008) or study how the spread of awareness impacts the course of a disease (Funk et al. 2009).
Recently, research has emerged regarding the impact of opinions on the spread of disease and herd immunity (Alvarez-Zuzek et al. 2017;Xia and Liu 2013;Ndeffo Mbah et al. 2012;Voinson et al. 2015;Salathé and Bonhoeffer 2008). Much of this research focuses on opinions regarding vaccination. While vaccination is one type of prophylactic behaviour, it is characteristically different than others, such as hand washing, face-mask wearing, or social distancing. Unlike vaccination, these latter behaviours require high frequencies of affirmation or engagement; hands need to be washed after contact with potentially contaminated areas, face masks need to be worn on a daily basis, etc. Hence, the dynamics of opinions regarding vaccination are expected to be substantively different than the dynamics of these other prophylactic behaviours. Consider, for example, the behaviour of populations before and after the appearance of severe acute respiratory syndrome (SARS). Arrival of the disease resulted in a sharp increase in face-mask use (Lau et al. 2005), and when the disease disappeared so, largely, did the face masks (though other hygienic behaviours such as hand washing may be more persistent (Fung and Cairncross 2007)). Similar changes in behaviour have been documented during influenza epidemics (Sadique et al. 2007;Goodwin et al. 2011). A general increase in public hygienic behaviours has been shown to be important in reducing the spread of disease.
We are interested in understanding the feedbacks between opinion and disease dynamics, where the opinions in question are related to prophylactic behaviours such as hand washing, face-mask wearing, or social distancing. In order to make headway in this regard, we study a model that couples opinion dynamics with a basic SIR model. We combine our earlier opinion dynamics model (Baumgaertner et al. 2018) with an SIR framework to study how attitudes regarding prophylactic behaviour affect the course of a disease for which vaccination is not an option. Unlike economic models, behaviours in our model are not based on personal utilities. Instead, we assume that constructive conversations can lead to opinion-changing processes, and that therefore people are susceptible to persuasion by others. It is known that human behaviour and opinions during an outbreak can be motivated by messages from the media or social circles. For example, it has been observed that a fear of infection can spread during an outbreak due to the influence of media, government policy, or word-ofmouth communications (Wasswa 2012;Young et al. 2008;Damme and Lerberghe 2000;Saadatian-Elahi et al. 2010). Fear of infection has been modelled by Epstein et al. (Epstein et al. 2008) using two contagion processes: one for fear and another for disease. Our model provides an opinion-based perspective to such behaviour, with levels of infection influencing which opinions have more weight.
We recognize that there are many obstacles present in modelling behavioural responses to epidemics due to the assumptions and generalizations involved in describing population behaviour (Funk et al. 2010(Funk et al. , 2015. The challenges of modelling, however, have not deterred the development of models that include various ways of representing health-related beliefs and attitudes (Bauch and Earn 2004;Bauch and Galvani 2013;Epstein et al. 2008;Ferguson 2007;Funk et al. 2009;Perrings et al. 2014;Philipson 2000;Manfredi and D'Onofrio 2013;Mao and Yang 2012;Wang et al. 2015;Basu et al. 2008;Bauch and Bhattacharyya 2012;Fenichel et al. 2011;Perra et al. 2011;Del Valle et al. 2013;Pérez-Llanos et al. 2018). This wealth of approaches demonstrates the complexity of the interaction between infectious disease, attitudes (or opinions or beliefs), and behaviour. This complexity highlights the nuances within which public policy decisions are (and need to be) made. We are optimistic that our modelling, in conjunction with other epidemic models, makes informative contributions to public policy (Mansnerus 2015;Anderson and May 1992). More specifically, our model may be informative when considering the flux of opinions in response to the waxing and waning of disease risk, and the decision to intervene with severe control measures (Ferguson et al. 2001(Ferguson et al. , 2005Flahault et al. 2006).
There is one aspect of our model that particularly differentiates it from others. That is the inclusion of a form of opinion amplification, the tendency for individuals to entrench or increase the strength of their opinions when interacting with other like-minded individuals. The effect of amplification, absent a disease system, was studied by Baumgaertner et al. (2018). In brief, increased rates of amplification lead to decreased time to consensus of opinion in a well-mixed system. One of the effects we study in this paper is the impact that amplification can have in a coupled opiniondisease system.
The remainder of the paper is organized as follows. In Sect. 2, we introduce the SIR-Opinion Dynamics model and explain some features of this model that set it apart from traditional SIR models. We introduce the effective reproductive number R(t) for this model in Sect. 2.2. Then in Sect. 3, we explore how the opinion dynamics and disease dynamics interact to affect the severity and duration of epidemics. We finish with a summative discussion in Sect. 4, where we explore practical implications that arise from our model.

SIR-Opinion Dynamics Model
We introduce an ordinary differential equation (ODE) model that couples disease dynamics with an opinion dynamics model (using an attitude spectrum) (Baumgaertner et al. 2018). In particular, the model incorporates attitude-specific infection rates. We envision here a situation in which attitudes, and hence infection rates, can change frequently during the course of an epidemic. Unlike vaccination, which alters an individual's susceptibility level for the duration of the epidemic, the "prophylactic" behaviours that determine susceptibility can change often in our model. Examples to keep in mind are hand washing, social distancing, and face-mask wearing.
In this model, we assume a population that is well-mixed and an epidemic period that is short enough to exclude births and deaths, resulting in a closed population. To keep things simple, we assume that opinion dynamics only occur within the susceptible population, which is split into four groups, each characterized by an attitude in the attitude spectrum: We will use the terms "opinion" and "attitude" interchangeably here. We write S i , i ∈ A, for susceptibles with attitude i. (In the differential equations below, S i denotes the density of such individuals within the population.) S −2 individuals represent those with the highest level of prophylactic behaviour, while attitude S 2 individuals correspond to the lowest level of prophylactic behaviour. Individuals S −1 and S 1 in the middle of the spectrum correspond to moderate levels of prophylactic behaviour. We will refer to individuals with attitudes −2 and −1 as being less susceptible to the disease because of their increased prophylactic behaviour and those with attitudes +1 and +2 as having more susceptibility to the disease because of their decreased prophylactic behaviour.
Attitude-specific infection rates. It is clear that increased levels of personal hygiene or social distancing from perceived sources of infection can have a significant effect in reducing the spread of infectious diseases (Aiello et al. 2008;Jefferson et al. 2009). In our model therefore, an individual's attitude determines susceptibility to infection. Letting β i denote the infection rate for S i , we assume where β 0 is the baseline infection rate, and each step-up in prophylactic behaviour results in a discounting of infection rate by a factor a > 1. There are, of course, other ways to model the dependence of infection rate on attitude, but the above form consolidates this variation into a single parameter. The rate of recovery from infection, γ , is assumed to be the same for all infected individuals.
Opinion dynamics In addition to the role attitudes play in determining infection rates, these attitudes can change with time, for example in response to disease prevalence. The updating of attitudes/opinions in our model depends on "influence" and "amplification". The influence, ω i , of S i is defined as the per capita rate at which S i individuals interact with other susceptible individuals. For example, the overall rate at which S j individuals are influenced by S i individuals, with a possible change in attitude of the "focal" S j individual, is ω i S i S j . The result of such an interaction is determined by the relative positions of the two attitudes in the attitude spectrum and whether or not opinion amplification occurs. Amplification, which was introduced in our earlier work on opinion dynamics (Baumgaertner et al. , 2018, provides a mechanism by which individuals gain confidence in their opinion when they encounter like-minded individuals. Opinion amplification is the tendency to entrench or increase the strength of an opinion when interacting with other like-minded individuals. The inclusion of amplification in our model is motivated by studies of related biases, including biased assimilation and confirmation bias (Lord et al. 1979;Miller et al. 1993;Munro et al. 2002;Taber and Lodge 2006;Jonas et al. 2001;Wason 1960Wason , 1968. The underlying idea is that one's current opinion biases revisions of that opinion by differentially weighting consistent and contrary information (relative to the opinion).
The models we consider have the following ingredients. When a "focal" individual looks to update its attitude via an interaction with another appropriately chosen individual, the result depends on whether the two opinions are on the same side of the attitude spectrum. If the attitudes are on opposite sides of the spectrum, the focal individual will change its attitude by moving one step towards the other side. In the case where the opinions are on the same side of the attitude spectrum, two outcomes are possible: a fraction p a of the interactions result in a hardening of the opinion of the focal individual, while a fraction 1 − p a of these interactions result in no change. We refer to p a as the probability of "opinion amplification". More formally, when an S j individual is influenced by an S i individual, the attitude of the "focal" S j individual is updated in one of two ways as follows: -Interactions with no opinion amplification With probability 1 − p a , j is moved one allowable step towards the value of i. Note that since there is no zero state in A, a move to the left from 1 involves a jump to −1, and vice versa. If j = i, then j will not change. -Interactions that include opinion amplification With probability p a , j is moved one (allowable) step to the right if i > 0 and one (allowable) step to the left if i < 0, regardless of where the value of i lies in relation to j. Clearly, the only possible movement for an individual at the edge of the spectrum ( j = ±2) is towards the centre.
We now describe a system of differential equations (our SIR-Opinion Dynamics model) that has the above features. The state variables are the densities S i of susceptibles with attitude i ∈ A, as well as the densities of infective, I , and recovered (or removed), R, individuals: In the first four equations, (2a)-(2d), the first term on the right-hand side (β i S i I ) corresponds to infection dynamics, while the rest of the terms correspond to the opinion dynamics. The remaining equations, (2e) and (2f), model disease dynamics alone. Our main interest here is in the weighting of the opinion dynamics terms. The weights, ω i , are influence functions which determine the rate at which individuals S i influence the remainder of the susceptible population. We assume that these influence functions vary with the level I of infection in the population. Several weightings and variations with I are possible. We selected four plausible forms, as shown in Table 1. These functions are discussed in more detail below. The opinion dynamics terms illustrate how interactions across susceptible subpopulations of different attitudes lead to opinion-changing processes. For example, the Plots of these functions are shown in Fig. 1. The linear and saturating influence functions are choices that naturally arise from functional responses in ecology. The fixed-order saturating function is a modification of the saturating function so that there is no switch in the ordering of the influence functions for low levels of infection. In all of the first three functions, it was assumed that influence increases with prophylactic behaviour (though the saturating influence function has a reversed order of influence for I sufficiently small). If, however, some prophylactic behaviours are considered socially unacceptable (for example, if the wearing of face masks is seen as impolite), a reversal in the influence ordering can occur. This is the case embodied in the reverse-order saturating influence function second term in theṠ −2 equation indicates that whenever an S −1 "focal" individual interacts with either an S −2 or an amplified S −1 , the focal individual will transition into the S −2 subpopulation. The other opinion dynamics terms are organized in the same fashion, with the focal S j shown outside the square brackets and the influencing S i shown within the square brackets.
All populations are scaled according to total population; thus, S i , I , and R are proportions with S −2 + S −1 + S 1 + S 2 + I + R = 1. For reference, the parameter and variable descriptions are listed in Table 2.
Specifying the influence functions The final piece of the model description is to specify the form of the influence functions. In our earlier work on opinion dynamics without disease (Baumgaertner et al. 2018, the ω i s were fixed over time to give more or less influence to stronger opinions. Here, in a disease setting, we are interested in influence functions, ω i = ω i (I ), that depend on disease prevalence, since it is the response to disease (both attitudinal and behavioural) that is the theme of this paper. Indeed, the goal is to better understand how attitudes change in response to disease prevalence and how these changes affect the course of an epidemic.
While empirically measured influence functions are not available, it is clear from public responses to disease outbreaks that such influence functions do exist and are complex (Fung and Cairncross 2007;Lau et al. 2005;Sadique et al. 2007;Oster 2018). We defined four plausible influence functions to explore a range of possible responses to an epidemic. More specifically, these influence functions represent different ways in which an outbreak may tip the weighting of opinion dynamics to favour the more prophylactic side of the attitude spectrum. The functions considered are defined as linear, saturating, fixed-order saturating, and reverse-order saturating ω i (I ) functions, as shown in Fig. 1 and Table 1. These functions serve to increase or decrease the influence of each subpopulation S i as I changes during the course of the epidemic.
Each function ω i (I ) in Table 1 begins at the same point, ω i (0) ≡ ω 0 . (All attitudes have equal influence in the absence of disease.) As disease prevalence increases, the influence functions increase the weights of more prophylactic opinions (ω −1 (I ) and ω −2 (I )) and decrease those of less prophylactic opinions (ω 1 (I ) and ω 2 (I )). The parameter ω 0 serves as a base rate for the opinion dynamics, so its relation to γ provides an indication of the relative rates of opinion and disease dynamics. The halfsaturation constant, k, in the saturating ω i (I ) functions is set to 0.1 in the simulations. Note that the saturating ω i (I ) function causes ω −1 (I ) > ω −2 (I ) and ω 1 (I ) < ω 2 (I ) when the infected proportion is small. (The exact range of I for which this ordering is true depends on the function parameters.) The parameter ω max in ω −1 (I ) and ω −2 (I ) for the linear, saturating, and modified saturating influence functions was incorporated to allow us to increase the maximum influence of the more prophylactic attitudes as disease prevalence increases. For ω max = 1, these influence functions are symmetric about ω 0 (this is the case shown in Fig. 1); for ω max > 1, the influence of the more prophylactic attitudes is scaled up, removing the symmetry. (In our numerical results, we explore the values ω max = 1 and ω max = 3.) We end this subsection with a few comments about how disease prevalence influences opinions and behaviour in our model. Any model that couples disease dynamics with opinion dynamics must address the coupling; there are several approaches already in the literature, as well as many more possibilities. Here, unlike some models, people do not respond to the population infection level itself. As I changes, we change the rates of interactions with people of various opinions. So larger I causes one to encounter attitudes "− 2" or "− 1" more often, such encounters then pull people towards a more prophylactic mindset, and this mindset causes them to display the prophylactic behaviour that reduces their infection rate. In other words, opinions change based on the frequencies of other susceptibles; infection level regulates prob- Influence functions plotted as a function of the infected proportion, I , for the linear, saturating, fixedorder saturating, and reverse-order saturating cases given in Table 1. The thick/thin lines correspond to the influence of the more/less prophylactic subgroups (ω −2 (I ) and ω 2 (I ) solid, ω −1 (I ) and ω 1 (I ) dashed). Influence is shown for 0 ≤ I ≤ 0.5, so that the behaviour near I = 0 is more visible. Parameter values are given in Table 2, and the choice of influence functions is explained in the caption of Table 1. Note that the functions are symmetric about ω 0 because we have used ω max = 1. For ω max > 1, the more prophylactic influence functions increase in magnitude, removing the symmetry abilities of encountering different types of susceptibles, but it does not have a direct effect on opinion formation; there is no I term in any of the opinion terms in the ODEs except through the influence functions. Also note that the encounters could include simply seeing someone who displays the outward signs of their opinion, e.g. someone wearing a face mask. Finally, note that infective and recovered individuals have no opinions; at least, nobody listens to them. As we were interested in the opinion dynamics within the susceptible population, we ignored opinions in the infective and recovered populations for simplicity.

Effective Reproduction Number
As with all disease models having multiple susceptible or infective states, age structure, or other complexities, computing a basic reproduction number is more complicated than in a standard SIR model (Heffernan et al. 2005). This is the case with our model. The model has an unstable non-trivial disease-free equilibrium (DFE) for susceptible states: This equilibrium is a saddle point and is approached only if the susceptible population is initially symmetrically distributed. The lack of stability means that this point is not the only reasonable starting state for investigating the initiation of disease dynamics. For most initial distributions of susceptibles, opinion dynamics (with amplification) make the system tip towards consensus. Thus, the other two DFEs, (0, 0, 0, 1) and (1,0,0,0), are stable and correspond to susceptible populations that have only attitude 2 or only attitude − 2. Of course, consensus of opinions about disease (or anything else) does not typically occur. Furthermore, we are interested in opinion dynamics over the short term here, i.e. during the disease outbreak. Thus, the consensus DFEs are also not relevant. We therefore do not have a single DFE that we can use as a starting state to calculate a basic reproduction number; we must account for different initial configurations of susceptibles.
Since our model has multiple susceptible types with different susceptibilities to infection, the notions of basic reproduction number and effective reproduction number depend on the mix of susceptibles, both at the initiation of the epidemic and (for the effective reproduction number) later, due to the combined dynamics of infection and opinion.
It is easy to see thatİ (t) > 0 when the effective reproduction number is larger than 1. This follows by writing (2e) in the formİ = γ R(t)I − γ I . In particular, the value at t = 0 when the initial susceptible frequencies (S −2 (0), S −1 (0), S 1 (0), S 2 (0)) sum to 1, just prior to the introduction of the disease, is the basic reproduction number: The same value obtains using the next-generation method (Heffernan et al. 2005).
In the SIR-Opinion Dynamics model (2), one recovers the usual SIR model if all susceptibles are of a single class and opinion dynamics are turned off (ω 0 = 0). In the case of all susceptibles belonging to the single class, S i , and no opinion changes, the basic reproduction number is R (i) 0 = β i /γ . With this notation, we can combine Eqs. (3) and (4) to write the effective reproduction number for the SIR-Opinion Dynamics model as a time-varying linear combination of the individual basic reproduction numbers: The last equation helps illustrate the additional complexity in our model, as well as the potential for interesting dynamics. In the classic SIR model, since all susceptibles are of the same type, the basic reproduction number predicts in a fairly straightforward manner the future development of disease dynamics, including final epidemic size and time until the number of infectives begins to wane (Brauer and Castillo-Chavez 2012). This simplicity derives from the fact that there is only one disease-free equilibrium, and infection rates, though dynamically changing, depend only on S(t) and I (t). For example, dI /dS = −1+γ /β S depends only on S, as does R(t) = β S(t)/γ . Equations such as these allow for a separation of variables that easily yields functions that are constant along trajectories (Brauer and Castillo-Chavez 2012), that allow calculation of peak epidemic size and final epidemic size as functions of R 0 . Such a strategy will not work for the SIR-Opinion Dynamics model because of the multiple susceptible states.
In the SIR-Opinion Dynamics model, R 0 is still relevant (see Sect. 3.4.2 and also "Appendix A"), but R(t) quickly changes from this initial value in response to opinion dynamics, which in turn depend on I (t), as well as disease dynamics that are made more complex by the different infectivities of the various susceptible classes. The effect of initial conditions on future disease (and opinion) dynamics thus becomes much more complex and interesting. In addition, the rate at which the disease dynamics evolve relative to the rate at which the opinion dynamics evolve has a strong effect on R(t). The importance of these relative rates is discussed further in Sect. 3.4. Further discussion of the time evolution of R(t) in our model appears in "Appendix A".

Results
To study the dynamics of the system, we numerically solved the ODE using the Runge-Kutta method in MATLAB. For the numerical solutions in the following sections, default values are listed in Table 2. The timescale of the solutions is fixed in the sense that the recovery rate is set to γ = 0.1 in all simulations. Below, we explore how social influence (via the influence functions), the initial prophylactic proportion S −2 + S −1 , amplification, and the relative opinion/disease rates affect the spread of disease within the susceptible population.
Given the number of parameters in the model, a wide range of solution behaviours are possible. Our goal in the subsections is to present the most interesting behaviours we found, and an intuitive analysis of how the coupling of opinion dynamics and disease dynamics led to the observed results in each case.

Effects of Influence Functions
The population response to increases in the infectious subpopulation, encoded in the influence functions ω i (I ), provides an important component of the coupled dynamics of opinion and disease. These influence functions affect both the speed of the opinion dynamics and the relative weighting of, or encounter rates with, the four different subpopulations S i . Retaining the default parameter values for the moment (changes in the ω max and ω 0 parameters are investigated in Sect. 3.4), we show how the influence functions listed in Table 1 change the time course of the system dynamics (Figs. 2, 3). For reference, we also include the two "no influence" cases: that of a traditional SIR model with all susceptibles in the S 2 subpopulation, and that of an SIR model with four subpopulations of susceptibles but no interaction between these groups.
Comparing the two "no influence" cases (subplots (a) and (b) in Figs. 2 and 3), we observe that the distribution of susceptibles into four non-interacting but differentially susceptible subpopulations reduces the final size substantially, as expected. The difference between this case and the linear influence case, however, is minor, as the proportion of infectious individuals never rises above 20%, and so the influence functions, ω i (I ), remain fairly close to each other in magnitude, and close to the value at I = 0. The saturating influence cases respond much more rapidly to the initial increase in infectives, and so they all have a much stronger effect on final size. When the initial prophylactic proportion of the population is 30% (Fig. 2), the reverse-order saturating influence function (subplot (f)) yields the strongest reduction in final size, while with an initial prophylactic proportion of 70% (Fig. 3), it is the fixed-order saturating influence function (subplot (e)) that yields the strongest reduction.
In comparing the fixed-order and reverse-order saturating influence functions, we are, in part, looking at the effect of the influence of moderate (especially S −1 ) versus extreme (especially S −2 ) opinions. Our results suggest that final size is most reduced when extreme opinions have the greatest weight (cases (c)-(e) in Fig. 2), but that occasionally the reverse is true (case (f) in Fig. 2). When the population is composed of a prophylactic majority, it makes little difference whether it is the moderate or extreme opinions that have the greatest weight. (Compare cases (e) and (f) in Fig. 3.)

Effects of Initial Proportion of Prophylactic Population
In the previous section, we examined how the system dynamics differ when the population is distributed either as a 30:70 non-prophylactic majority or as a 70:30 prophylactic majority. If we investigate a larger range of ratios, we obtain the results shown in Fig. 4. For the default values of the model parameters, final and peak epidemic sizes all decrease as the initial proportion of prophylactic individuals increases. Epidemic duration, however, is nonmonotonic with respect to increasing prophylactic population proportion (though see Fig. 8 when disease dynamics are faster).
On a more detailed level, we observe that the saturating influence functions all yield a concave-up dependence of final epidemic size on initial prophylactic population proportion, while in the case of no influence, the dependence is concave down. The linear case behaves like the no-influence case for non-prophylactic majority populations (low initial proportion prophylactic), but like the saturating influence cases for prophylactic majority populations (high initial proportion prophylactic). Epidemic duration for all of the saturating influence functions is always less than that for the no-influence case, but for non-prophylactic majority populations the linear influence  Table 1. Parameter values are at the defaults listed in Table 2 (Color figure online) case yields the longest-lasting epidemics. We observe that the rapid response of the saturating influence functions to an increasing subpopulation of infectious individuals has a strong effect on reducing final size, especially when the initial distribution of susceptibles is fairly uniform, or biased towards a non-prophylactic majority.
Note that once the initial fraction of prophylactic individuals is high enough (just past the value that yields a peak in the duration subplot of Fig. 4), a further increase in this fraction leads to a steep drop in epidemic duration. Increasing it a bit further, we reach the "critical" fraction of the initial prophylactic fraction at which all the duration curves hit 0; this occurs when R 0 = 1. Note that when I ≈ 0, all the influence curves are the same, so it is not surprising that all the curves hit 0 at the same point. For initial prophylactic fraction less than this critical value, R 0 > 1, and R 0 < 1 for higher initial levels of prophylaxis.
The hump in epidemic duration in Fig. 4 is an example of "critical slowing down" at a bifurcation point (O'Dea et al. 2018). As one approaches the critical value R 0 = 1, disease dynamics play out on a slower timescale. By contrast, for small R 0 the disease dies out quickly, and for large R 0 , the disease burns through most of the available susceptible population quickly. Of course, an ODE model with only disease dynamics features I (t) approaching 0 asymptotically and one must impose a cut-off to get a finite "duration". Our epidemics were declared to be over when the frequency of infectives dropped to the value I (t) = 0.1 * I (0) = 0.001. (Stochastic models do have finite epidemic duration, and one observes the same critical slowing down near  Table 2, of final epidemic size, peak epidemic size, and epidemic duration as a function of the initial proportion of the population on the prophylactic side, for all of the influence functions listed in Table 1 as well as the no-influence (ω i = 0) case. Linestyle legend: solid-no influence; dashed-linear influence; dotted-saturating influence; dash-dot-fixed-order saturating influence; dotted with crosses-reverse-order saturating influence R 0 = 1; cf. Tritch and Allen (2018).) To get a feel for why the peak epidemic duration occurs when initial prophylactic proportion is about 0.75 for the case of the default parameters and no influence, note that this value puts the initial susceptible frequencies at approximately (S −2 (0), S −1 (0), S 1 (0), S 2 (0)) = (3/8, 3/8, 1/8, 1/8), and hence, R 0 = 1.25. Since the individual basic reproductive numbers for S −2 , S −1 , S 1 , and S 2 are, respectively, 1/2, 1, 2, and 4, the disease preferentially infects S 2 and S 1 . For the sake of argument, if all the S 2 s were eliminated first, the effective reproduction number would drop to R(t) = 0.93, which makes the infection rate subcritical, but still close to the critical rate. In other words, the effective reproduction number spends a good deal of time initially near the critical value 1, and hence, the infection lingers for a long time. Note that the epidemic duration curves shift to the left when opinion dynamics are at work. The presence of the infection shifts opinions to the left (more prophylactic), more quickly lowering R(t).

Effects of Amplification
In our context, amplification can occur when opinions received from others are consistent with the receiver's current opinion. The amplification parameter, p a , has a value between 0 and 1. A helpful interpretation is that it represents the average fraction of like-minded interactions where amplification occurs. So if p a = 0.1, then 10% of interactions between opinions of the same type will include the effects of amplification. For example, if a +1 opinion interacts with another positive opinion, then there is a 10% chance that it will become a + 2, regardless of whether that second positive opinion is a + 1 or a + 2. (See Sect. 2.1 for precise specification of amplification in our model.) One effect of amplification in a well-mixed system is that it increases the rate at which one side of the opinion spectrum grows. Even without amplification, as the frequency of one opinion increases beyond a majority, more interactions will have at least one individual with that opinion (say, a positive number on the opinion spectrum). When iterated, these interactions beget even more interactions with at least one individual with a positive opinion, and so on, while the other opinions decrease  Table 2, except for ω 0 = 0.2. The baseline case for comparison is shown in Fig. 4 (Color figure online) in frequency (in this case, the negative opinions). In a system with amplification, the rate of this process is increased, as now the frequency of interactions with two positive opinions also increases. As such, there is an increase in opportunities for amplification. Consider opinions on the positive side that have been amplified; these opinions have value + 2 as opposed to + 1. The + 2 opinions require at least two interactions with negative opinions before becoming negative, whereas making a + 1 opinion negative requires only one negative interaction. Consequently, not only does the majority opinion "win over" more opinions on the same side, it also "loses" fewer to the minority. This process feeds back on itself and thereby increases the rate at which one side of the opinion spectrum grows. For more details on amplification and its effects, absent a disease system, both in deterministic and stochastic contexts, see Baumgaertner et al. (2018).
In a disease context, this means that, when the prophylactic proportion is comparatively low, the population will be drawn towards the non-prophylactic side, even as infection risk increases. On the other hand, when the prophylactic proportion is comparatively more frequent, then the rate of movement to the prophylactic side is increased, in addition to the increased rate driven by infection risk.
The effect of amplification in a disease system is thus predicted as follows. Suppose, first, that we begin with higher levels of initial prophylaxis. Even without amplification, this begets more prophylactic opinions, which in turn leads to a small final epidemic size. Under the same initial conditions, the inclusion of amplification will magnify these effects and yield even lower final epidemic sizes. If, however, initial levels of prophylaxis are low, the more non-prophylactic opinions spread the fastest, which in turn leads to a large final epidemic size, even in the absence of amplification. Again, the inclusion of amplification will magnify these effects and yield even higher final epidemic sizes. As expected, these behaviours are evident in Fig. 5, left subplot.
The peak size and epidemic duration plots in Fig. 5 show that the increase in final size from amplification at low initial levels of prophylaxis is due to an increase in peak size rather than an increase in epidemic duration. For larger initial levels of prophylaxis, we see the opposite: the decrease in final size from amplification is due to a decrease in epidemic duration, rather than a decrease in peak size.

Relative Opinion/Disease Rates
In addition to the dynamics involved in susceptibles switching from one subpopulation to another, a key factor in the coupled disease-opinion dynamics is the rate at which the opinion dynamics occur relative to the disease dynamics. To formalize these relative rates, we non-dimensionalize equations (2). The variables S i , I , and R are already dimensionless, and so it remains only to non-dimensionalize the parameters. As γ is held constant, we non-dimensionalize by dividing all of the equations by γ , and scaling time: t * = γ t. The dimensionless disease and opinion dynamics parameters are thus β 0 /γ and ω i /γ . We therefore control the rate of disease dynamics by varying β 0 , and the rate of disease dynamics by varying the parameters in the influence functions ω i , i.e. ω 0 and ω max .
If we increase ω 0 while holding β 0 constant, then we speed up the opinion dynamics relative to the disease dynamics. If we also increase ω max , we introduce an asymmetry in the encounter rates for prophylactic and non-prophylactic opinions and give more weight to (or more frequent encounters with) prophylactic opinions. For direct comparison, in Figs. 6 and 7 we show simulations of non-prophylactic and prophylactic majority initial populations for the same parameter values as shown in Figs. 2 and 3, respectively, but with increased ω max and ω 0 . We observe that increasing the weighting and speed of the opinion dynamics leads to much smaller final sizes, with the difference being more noticeable when the initial population is distributed as a non-prophylactic majority. For all three saturating influence functions (saturating, fixed-order saturating, and reverse-order saturating), we also observe a much higher peak in the S −1 subpopulation during the epidemic. In addition, at the final time shown (t = 150), we observe that opinion dynamics increase the proportion of the population found in the S −2 subpopulation. (Compare subplots (c)-(f) with subplot (b).) When the rate of opinion dynamics is increased, the S −2 subpopulation increases as well (comparing Figs. 2 and 3 with Figs. 6 and 7, respectively). Thus, opinion dynamics coupled with disease dynamics lead to a final population (after the epidemic has passed) that is significantly more protected from recurrence of the disease. The importance of opinion dynamics is made particularly salient when comparing subplots (c) and (e). In case (e), we see that the fixed-order saturating opinion dynamics lead to a rapid increase in the S −2 population, and a significantly smaller final size, as compared to the linear opinion dynamics in case (c). Note that the continuing increase in the S −2 population after the epidemic has passed (after time 100 in Fig. 6, and after time 50 in Fig. 7 is chiefly due to amplification; disease no longer has any effect as I ≈ 0. If we increase β 0 , then we have faster infection rates relative to the disease recovery rate. We expect faster infection rates to lead to larger epidemics, absent the influence of opinion dynamics. Here, we measure the effect of opinion dynamics on a more virulent disease by investigating the three metrics of final epidemic size, peak epidemic size,  Table 1. Parameter values are at the defaults listed in Table 2, except for ω max = 3 and ω 0 = 0.2 (Color figure online) and epidemic duration as a function of the initial proportion of the population that is prophylactic, when the speeds of the infection and opinion dynamics are increased (see Fig. 8, first row). We also augment the asymmetry between the prophylactic and non-prophylactic opinions by increasing ω max (see Fig. 8, second row). The baseline for comparison is shown in Fig. 4. We see that the faster opinion dynamics (Fig. 8, first row) have an effect that is similar to that of increased amplification (Fig. 5). Final size is significantly decreased in the simulations with opinion dynamics (especially saturating opinion dynamics) in comparison with the no-influence case. Peak size is also reduced. Epidemic duration is reduced for the cases of saturating opinion dynamics. For the linear opinion dynamics, epidemic duration is increased/decreased at lower/higher initial levels of prophylaxis. When infection rates are also increased (Fig. 8, second row), completely new behaviours emerge. Final size again increases, but most dramatically for the reverse-order saturating influence case. This latter case puts the greatest influence on the S −1 population, and so the larger final size in this case suggests that the S −2 population is more important in decreasing final size, especially under fast opinion dynamics. Peak size increases in all cases, and epidemic duration Fig. 8 The effect of faster opinion dynamics (first row), and faster both opinion and disease dynamics (second row). The baseline case for comparison is shown in Fig. 4. Final epidemic size, peak epidemic size, and epidemic duration as a function of the initial proportion of the population on the prophylactic side, for all of the influence functions listed in Table 1 as well as the no-influence (ω i = 0) case. Linestyle legend: solid-no influence, dashed-linear influence, dotted-saturating influence, dash-dot-fixed-order saturating influence, dotted with crosses-reverse-order saturating influence. All parameter values are set to the default values listed in Table 2 except for ω max = 3 and ω 0 = 0.2 (which speed up opinion dynamics), and in the second row β 0 = 0.8 (which speeds up disease dynamics) becomes monotonic, never dropping to zero. This behaviour is due to the fact that the infection dynamics are now fast enough so that an epidemic is always initiated, even in the presence of fast opinion dynamics and a high initial level of prophylaxis. Further discussion of the effect of relative disease/opinion dynamics rates, coupled with the effect of amplification, appears in "Appendix B".

Delay in Epidemic Wave
We consider here the effect of very slow disease dynamics, relative to opinion dynamics, in the situation where reports of a possible epidemic have moved some people to more prophylactic behaviour. More specifically, the initial level of prophylaxis is enough to make R 0 < 1, but the population still has a majority of non-prophylactic behaviours. When the disease enters the population, the number of infectives begins to decrease since R(t) < 1. At the same time, the reduction in infectives as well as the majority non-prophylactic distribution causes a shift in opinions to the more non-prophylactic side. Eventually, the S 2 population proportion increases sufficiently so that R(t) > 1, and an epidemic occurs. We show simulation results for such a scenario in Fig. 9. When both opinion dynamics and disease dynamics are present (Fig. 9, top row), the epidemic is initially suppressed because of the distribution of behaviours in the susceptible population (as Fig. 9 First row: simulations to show how opinion dynamics can delay the onset of an epidemic, as compared to the simple SIR case with a single susceptible population S = S 2 . Parameter values are at the defaults as given in Table 2  in the top right subplot), and R(t) < 1. With time, however, the opinion dynamics cause the population to become more careless and shift towards the S 2 side of the spectrum. Consequently, there are eventually sufficient S 2 individuals present so that the reproductive number R(t) > 1, and an epidemic is initiated. The final size of the epidemic in the full opinion dynamics case is close to 40% of the population. This epidemic is smaller than that predicted by a standard SIR model with all susceptibles in the S 2 subpopulation (results not shown).
If we vary the initial proportion of individuals on each side of the attitude spectrum, but keep S −2 = S −1 and S 1 = S 2 , we obtain the results shown in Fig. 9, second row. If more than half the population exhibits prophylactic behaviour, there is no epidemic, as the preponderance of prophylactic behaviours causes the susceptible attitudes to continue shifting towards the more prophylactic side, and there are never sufficient S 2 individuals for initiation of an epidemic. When less than 50% of the initial population is prophylactic, an epidemic does occur, and the size varies depending on the initial prophylactic proportion. Intuitively, one would expect the final epidemic size and peak epidemic size to decrease as the initial prophylactic proportion increased, but the change is, in fact, nonmonotonic.

Discussion
It is clear that human behaviour can affect the spread of disease. Conversely, as an epidemic spreads, opinions and behaviours can change. Mathematical and computational models of the interplay between disease spread and opinions have been gaining attention, but the subject is still in its infancy. While it is relatively straightforward to model some of the effects of behaviour on disease spread, human behaviour and opinion dynamics are far too complex to model with anything approaching precision or completeness. Consequently, opinion dynamics models currently take an approach of greatly reducing complexity, with the hope of gaining insight into certain aspects of opinion formation and spread. This strategy parallels those in other sciences, such as biology. Instead of approaching the problem with models or experiments involving many ecological interactions in natural habitats, (mathematical) biologists started with one predator and one prey, or two competitors, in an idealized habitat that controlled for most variables. This approach allowed biologists to learn a great deal by first studying greatly reduced systems. Similarly, while opinion dynamics models can be criticized as being too simplistic, the upshot is tractability.
Even given this approach, there are many ways to reduce system complexity when building models, as illustrated by examples in the Introduction. What distinguishes our model from others is that our opinion dynamics are neither utility-driven (as most economics models are) nor based on a contagion process (e.g. the spread of a fear of infection), or some combination of utility and contagion (Manfredi and D'Onofrio 2013). The opinion dynamics we adopt assume that constructive conversations between individuals can lead to changes in opinions through persuasion, but that persuasion is also sensitive to information about the risk of infection. In addition, the opinion dynamics we use also can capture the effects of echo chambers and amplification (ascertainment bias)-features that are especially prevalent in social media. These forces can make people slow to respond to information about a threatening epidemic, or they can tip the balance creating a rapid response.
Results presented here suggest that opinion dynamics can have a profound effect on disease progression through a population, and they illustrate the importance of the spectrum of opinions at the initiation of the epidemic, as well as the relative speeds of opinion and disease dynamics. There are scenarios in which opinion dynamics dramatically reduce the fraction of the population that will be infected and the peak epidemic size. In other scenarios, it is possible for opinion dynamics to make the epidemic worse than it would be otherwise.
More specifically, we explored the effects of three features of the opinion dynamics model: the influence functions, the initial distribution of opinions along a spectrum, and different levels of opinion amplification. What we learn from this exploration is that these features can interact with each other and the disease dynamics, and in turn their impact on epidemiological outcomes, such as final epidemic size, is not straightforward. For example, some influence functions will have populations respond more rapidly to initial increases in infectives (e.g. saturating influence), but that does not entail a larger decrease in final epidemic size. As shown in Sect. 3.2, it also matters whether the population starts with a majority of prophylactic or non-prophylactic opinions. If the initial majority is non-prophylactic, then some influence functions (e.g. reverse-order saturating) will yield the strongest reduction in final epidemic size.
The complexity that arises from the interactions in the coupling of the opinion and disease dynamics presents substantial challenges to capturing and predicting the dynamics of real epidemics. That, however, is not our primary aim. Ours is to further understanding of the feedbacks between certain social processes and disease. The importance of these feedbacks was also identified by Collinson and Heffernan (2014) in their study of models for the effect of mass media on the course of an influenza epidemic. The situation they consider is different from ours, as their models all have a vaccinated subpopulation that cannot return to the unvaccinated state, and the population infectivity immediately responds to I (t), without waiting for opinion dynamics to shift. Consistent with our work, however, they find that the different response functions predict epidemic dynamics that can differ in important ways. Our work sheds light on how opinion dynamics and influence functions couple with disease dynamics and can perhaps inform future development of reliable media functions.
We are cognizant of some limitations of our model. Like the basic SIR model, our model assumes a well-mixed population characterized by a system of ODEs. ODE models of disease spread typically overestimate final epidemic size (for a given value of R 0 ). In real populations, spatial and network structure, as well as other heterogeneities, can render some pockets of the population less susceptible and stop the epidemic sooner than is predicted by ODE models. The opinion dynamics model used here has been shown (Baumgaertner et al. , 2018 to behave very differently in spatial and well-mixed systems. In particular, opinion amplification and spatial structure can conspire to lead to clustering of opinions and polarization, with opinion dynamics essentially freezing once the system becomes sufficiently polarized. With enough mixing, on the other hand, the behaviour changes to one in which opinions can rapidly tip to one side. It is thus likely that incorporating spatial structure into our SIR-Opinion Dynamics model could lead to different outcomes. With sufficient clustering and polarization of opinions, a spatial version of the model could lead to segregation of the population into spatially contiguous regions that are highly susceptible and others that have low susceptibility. Here, again, the relative time scales for disease and opinion spread (as well as different mechanisms for the spread of information and opinions) are likely to influence the outcomes. We leave the construction and analysis of such models for future work. Plots showing how β 0 and ω max affect the three metrics: final epidemic size (left column), peak epidemic size (middle column), and epidemic duration (right column), as functions of the initial proportion of the prophylactic population for different values of p a . The default is the middle row. From the middle row to the top row, ω max has been increased, from middle row to the bottom row β 0 has been increased, and all other parameters held constant. The results were obtained from simulations with three different influence functions (colour online): no influence (red), linear influence (green), and fixed-order saturating influence (blue). Within the results for each influence function are presented results for four different values of p a : 0 (solid), 0.01 (dashed), 0.05 (dash-dotted), and 0.1 (dotted with crosses). All other parameter values were set to the default values given in Table 2 (Color figure online) established in Table 2 give rise to the results in the middle row. If ω max is increased, we arrive at the results shown in the top row. Increasing ω max corresponds to increasing the asymmetry between the weighting of the prophylactic and non-prophylactic opinions, making prophylactic influence much stronger (and the prophylactic opinion dynamics faster) than that of the opposing non-prophylactic opinions. Comparing the top and middle rows, we observe that as the initial prophylactic opinions are increased, the final epidemic size decreases more rapidly in the top row than in the middle row, most notably for the fixed-order saturating influence function. (Note the change in curvature.) Similar effects hold for peak epidemic size and duration. Put intuitively, increasing the influence of prophylactic opinions dampens epidemics in our model.
Comparing the middle and bottom rows of Fig. 11, we see how increasing the rate of infection, β 0 , affects the model outcomes. When β 0 is increased, the infection dynamics dominate the dynamics of the disease, and the opinion dynamics have a much smaller effect. The most striking difference between these two rows is the shape of the epidemic duration curve. For small β 0 , or slow disease dynamics, the curve is concave down with a distinct maximum. For large β 0 , or fast disease dynamics, the curve is concave up and monotonic, with little separation between the results obtained for different influence functions. When the initial proportion of prophylactic opinions is low, fast disease dynamics result in a shorter epidemic with higher peak and final sizes. When the initial proportion of prophylactic opinions is high enough, and disease dynamics sufficiently slow, the influence of the opinion dynamics can significantly shorten the duration and reduce the final and peak sizes of the epidemic. When the opinion dynamics are too slow compared to the disease dynamics, however, a high initial proportion of prophylactic opinions has some effect in decreasing the final and peak sizes of the epidemic, but result in a much longer epidemic.