\chapter{Epidemic Models}   \label{cap:modeling}

\section{Introduction}
\lettrine{E}{pidemiological} models\index{Models!epidemiological models} are implemented in the EpiGrass environment as a tool to predict, understand and develop strategies to control the spread of infectious diseases at different time/spatial scales. In this context, we see two direct potential applications. One is to model the spread of new diseases through an entirely susceptible population (ecological invasion). The velocity of spread of new diseases in a network of susceptible populations depends on their spatial distribution, size, susceptibility and patterns of contact. In a large scale, climate and environment may also impact the dynamics of geographical spread as it introduces temporal and spatial heterogeneity. Understanding and predicting the direction and velocity of an invasion wave is key for emergency preparedness. 

Besides invasion, network epidemiological models can also be used to understand patterns of geographical spread of endemic diseases. Many infectious diseases can only be maintained in a endemic state in cities with population size above a threshold, or under appropriate environmental conditions (climate, availability of a reservoir, vectors, etc). The variables and the magnitudes associated with endemicity threshold depends on the natural history of the disease. For measles, for example, only communities above a population threshold can sustain an endemic state \cite{MJKeelingandBTGrenfell1997}. This magnitude may vary from place to place as it depends on the contact structure of the individuals. Predicting which cities are responsible for the endemicity and understanding the path of recurrent traveling waves may help us to design optimal surveillance and control strategies. For measles, for example, models suggest that geographical spread tend to follow a hierarchical pattern, starting in big cities (core) and then spreading to smaller neighborhood cities (satellites) \cite{BTGrenfellandONBjoernstadandJKappey2001}. 

EpiGrass implements a series of epidemiological models which, integrated with a set of analytical and visualization tools,  may give us clues about the overall pattern of diseases spread in the geographical space. Besides, it can be used for scenario analysis to compare alternative intervention scenarios. 

\section{Disease models}

Models of disease dynamics are quite diverse, ranging from caricatures to very detailed simulations. Traditional models of spread of diseases are based on the mean field assumption, i.e., that individuals interact randomly at a certain rate. Important references to the subject are \cite{DiekmannOandHeesterbeekJAP2000,DaleyDJandGaniJandCanningsC2001,IshamVandMedleyG1996,AndersonRMandMayRMandAndersonB1992}. These models are expressed mathematically as difference equations (discrete time) or differential equations (continuous time). In the simplest form, these models do not take into consideration either individual heterogeneity or the local nature of transmission events. Increased realism can be included by structuring the population according to age, risk behavior, sex, susceptibility, or other category associated with different risk of getting or transmitting the disease. Within each sub-population, however, the assumption of well mixing must hold. When other species are involved in the transmission process (non-human hosts and vectors), these are also considered as compartments that may be sub-divided as well according to covariates associated with the risk of acquiring or transmitting the disease. 

In this context, epidemiological models take the form of multi-compartmental models where each compartment is a well-mixed homogeneous population. The model describes the transition of the individuals in this population through a sequence of disease-related stages. These stages could be \textit{Susceptible}, \textit{Infected}, \textit{Recovered}, for example. And the transitions could be
$$Susceptible \longrightarrow Infected$$
$$Infected \longrightarrow Recovered$$

If only these transitions are allowed, then individuals in the recovered class never become susceptible again (lifelong immunity, as in measles). If, on the other hand, immunity is only temporary (as in pertussis), then another transition should be included:
$$Susceptible \longrightarrow Infected$$
$$Infected \longrightarrow Recovered$$
$$Recovered \longrightarrow Susceptible$$

One way to visualize these models is using state-flow diagrams, where boxes represent states (compartments) and arrows indicate the transitions. It is the state identity together with the transitions allowed that define the type of model in use.

\subsection{Dispersal of infected individuals}

A key feature of EpiGrass is to allow the simulation of geographical spread of infection from one locality to others. Dispersal of infection is modelled as in a 'forest fire' model \cite{BTGrenfellandONBjoernstadandJKappey2001}. An infected individual, traveling to another city, act as a spark that may trigger an epidemic in the new locality. This approach is based on the assumption that individuals commute between localities and contribute temporarily to the number of infected in the new locality, but not to its demography. Further details about this approach can be found in Grenfell et al (2001).

In all models presented below, new infections in locality $i$ arise from the contact between Susceptibles in $i$ and Infectious individuals. Infectious individuals are of two types: those residents in $i$ ($I_t$) and those visiting $i$ ($\theta$). Mathematically, this is written as:

$$ L_{t+1} = \beta S_t \frac{(I_t+\theta)^\alpha} {N_t+n_t} $$

where $L_{t+1}$ is the number of new cases, $\beta$ is the contact rate between Susceptibles and Infectious individuals, $S_t$ is the number of susceptibles, $I_t$ is the number of infectious individuals resident in the locality, $\theta$ is the number of infectious individuals visiting the locality, $N_t$ is the population residing in the locality and $n_t$ is the total number of individuals visiting the locality. $\alpha$ is a mixing parameter. $\alpha=1$ corresponds to homogeneous mixing (Finkenstadt and Grenfell, 2000).

   
\subsection{Typology of infectious diseases and corresponding models}\index{Models!typology}

Here we present a brief description of the typology of infectious diseases based on their main route of transmission, and type of immunity associated to infection.
 
\subsubsection{SIR-like models}

The natural history of many directly transmitted infectious diseases can be appropriately described by a SIR-like model. \textit{SIR} stands for Susceptible ($S$), Infected ($I$) and Recovered ($R$). Archetypical \textit{SIRs} are measles or chickenpox, i.e., diseases that confer lifelong immunity (but see \cite{KGlassandBTGrenfell2004}). An individual starts his life in the $S$ state and may progress to the $I$ state. The rate of progression of individuals from $S$ to $I$ is called the incidence rate or force of infection ($\lambda$) which is a function of contact rate, probability of transmission per contact and density of infectious individuals. Individuals stay in the infectious period for a certain time and then moves to the recovered state where they become immune to new infections. Generally, the removal rate from the infectious class is the inverse of the infectious period (i.e., it is assumed that the duration of infection is exponentially distributed).   

\begin{figure}
\begin{center}
\includegraphics[scale=0.8]{SIRdiagram.png}
\caption{SIR-like models}
\label{fig:sir}
\end{center}
\end{figure}

Variations of this model consider that individuals do not acquire immunity after infection, thus returning to the susceptible pool (\textit{SIS} model). Another variation is the inclusion of a latent stage to hold individuals that are infected but not infectious to others yet (incubation period). These are the \textit{SEIR} (with immunity) and \textit{SEIS} (no immunity) models.

Next, we describe each one of these models in their deterministic and stochastic versions, as used by EpiGrass. 


\begin{description}
\item[SIR models]\index{Models!SIR}

Examples of diseases represented by SIR models are measles, chickenpox. Some diseases that do not confer lifelong immunity may be represented by this model if only short term dynamics is of interest. In the scale of a year, influenza and pertussis, for example, could be described using SIR. The SIR model is implemented in EpiGrass as a system of four difference equations. Besides the three equations describing the dynamics of $S$, $I$ and $R$, a fourth equation explicitly defines the number of new cases per time step, $L(t)$ (i.e., the incidence). In general, this quantity is embedded in the $I$ equation (prevalence), but it is important to keep track of the incidence if one wishes to compare prediction with notification data. 

\begin{align} \label{E:SIRmodel}
        L_{t+1} &= \beta S_t \frac{(I_t+\theta)^\alpha} {N_t+n_t}\nonumber \\
        I_{t+1} &= L_{t+1} + (1-r)I_t\nonumber\\
        S_{t+1} &= S_t + B - L_{t+1}\nonumber\\
        R_{t+1} &= N_t-(S_{t+1}+I_{t+1})
\end{align}

\begin{table}[h]
\caption{\small  Symbols used in the models and their meaning}
\begin{center}
\begin{tabular}{l l}
\hline\hline 
\textbf{Symbol}	&\textbf{Meaning}. \\ \hline	
$L_t$		& number of newly infected individuals at time t\\	
$E$		& number of exposed but not infectious individuals at time t\\
$I$		& number of infectious individuals at time t\\
$R$		& number of recovered individuals at time t\\
$\beta$		& contact rate ($t^{-1}$)\\
$\theta$	& number of infectious visitors\\
$\alpha$	& mixing parameter ($\alpha = 1$ means homogeneous mixing) \\
$n$		& number of visitors\\
$N$		& population ($S+E+I+R$)\\
$B$		& susceptible pool replenishment rate\\
$r$		& fraction of $I$ recovering from infection per unit of time ($[0,1]$)\\
$e$		& fraction of $E$ becoming infectious per unit of time ($[0,1]$)\\
$\delta$	& probability of acquiring immunity ($[0,1]$)\\
$w$		& probability of losing immunity($[0,1]$)\\ 
$p$		& probability of recovered individual acquiring infection, given exposure ($[0,1]$)\\\hline
\hline\hline
\label{Table:symbols}
\end{tabular}
\end{center}
\end{table} 

This model can be easily extended to include diseases without recovery, for example AIDS, the so called SI models. Basically, the recovery rate is set to 0.

\item[SIS models]\index{Models!SIS}
In the SIS model, individuals do not acquire immunity after the infection. They return directly to the susceptible class.

The only differences between $SIS$ and $SIR$ models is the absence of $R$ and the flow of recovered individuals to the susceptible stage: 

\begin{align} \label{E:SISmodel}
        L_{t+1} &= \beta S_t \frac{(I_t+\theta)^\alpha} {N_t+n_t} \nonumber\\
        I_{t+1} &= L_{t+1} + (1-r)I_t\nonumber\\
        S_{t+1} &= S_t + B - L_{t+1} + r I_{t+1}
\end{align}


\item[SEIR models]\index{Models!SEIR}
These models have an extra compartment for those individuals who have acquired the infection but are still not infectious to others. This is the latent period and it is often parameterized as the inverse of the incubation period. Note, however, that for many diseases, initiation of infectiousness does not necessarily coincides exactly with symptoms. In principle, any disease described by the SIR model can also be described by the SEIR model. The decision regarding the use of one or another depends on the magnitude of the latent period in relation to the time frame of other events in the simulation. The model has the form:

\begin{align} \label{E:SEIRmodel}
        L_{t+1} &= \beta S_t \frac{(I_t+\theta)^\alpha} {N_t+n_t}\nonumber \\
	E_{t+1} &= (1-e) E_t + L_{t+1}\nonumber\\
        I_{t+1} &= e E_t + (1-r)I_t\nonumber\\
        S_{t+1} &= S_t + B - L_{t+1}\nonumber\\
        R_{t+1} &= N_t-(S_{t+1}+I_{t+1}+E_{t+1})
\end{align}


 
\item[SEIS models]\index{Models!SEIS}

These are SIS models with the inclusion of the latent stage. 

\begin{align} \label{E:SEISmodel}
        L_{t+1} &= \beta S_t \frac{(I_t+\theta)^\alpha} {N_t+n_t}\nonumber \\
	E_{t+1} &= (1-e) E_t + L_{t+1}\nonumber\\
        I_{t+1} &= e E_t + (1-r)I_t\nonumber\\
        S_{t+1} &= S_t + B - L_{t+1} + r I_t
\end{align}

\end{description}

\subsubsection{SIpR-like models}

These are \textit{SIR} models with immunity intermediary between full (\textit{SIR}) and null (\textit{SIS}). 
Some possibilities arise here: 1) Infection confers full immunity to a fraction of the individuals and the remaining return to the susceptible class again, after infection. (\textit{SIpRpS}); 2) Infection provides only partial immunity and recovered individuals are partially susceptible to new infection (\textit{SIpR}); 3) Immunity is full right after infection but wanes with time (\textit{SIRS}). Each model is presented below. Figure \ref{fig:sipr} illustrates them diagrammatically.


\begin{figure}
\begin{center}
\includegraphics[scale=0.8]{SIpRdiagram.png}
\caption{SIpR-like models.}
\label{fig:sipr}
\end{center}
\end{figure}

Related models, that included the latent state $E$ are: \textit{SEIpRpS}, \textit{SEIpR}, \textit{SEIRS}.


\begin{description}
\item[SIpRpS model]\index{Models!SIpRpS}
This model assumes that a fraction $\delta$ of infectious individuals acquire full immunity while the remaining $(1-\delta)$ returns to the susceptible stage. The model is:

\begin{align} \label{E:SIpRpSmodel}
        L_{t+1} &= \beta S_t \frac{(I_t+\theta)^\alpha} {N_t+n_t}\nonumber \\
        I_{t+1} &= L_{t+1} + (1-r)I_t\nonumber\\
        S_{t+1} &= S_t + B - L_{t+1} + (1-\delta) r I_t\nonumber\\
        R_{t+1} &= N_t-(S_{t+1}+I_{t+1})
\end{align}


\item[SIpR model]
This model assumes that immunity is only partial and recovered individuals may acquire infection again (at a  lower rate $p \beta$, where $0\leq p \leq 1$). Two equations calculate the number of new infecteds. One, $L_S$  calculates the number of susceptibles that become infected at $t+1$. $L_R$  calculates the number of recovered that become infected at $t+1$. The latter are less susceptible to the disease and have (1-p)\% less chance of becoming infected, when compared to susceptibles. The model is:

\begin{align} \label{E:SIpRmodel}
        L_{S,t+1} &= \beta S_t \frac{(I_t+\theta)^\alpha} {N_t+n_t}\nonumber \\
	L_{R,t+1} &= p \beta R_t \frac{(I_t+\theta)^\alpha} {N_t+n_t}\nonumber\\ 
        I_{t+1} &= L_{S,t+1} + L_{R,t+1} + (1-r)I_t\nonumber\\
        S_{t+1} &= S_t + B - L_{S,t+1} \nonumber\\
        R_{t+1} &= N_t-(S_{t+1}+I_{t+1}) 
\end{align}


\item[SIRS model]\index{Models!SIRS}
Here, the immunity acquired by infection wanes with time. Pertussis and malaria are diseases with this characteristic.
\begin{align} \label{E:SIRSmodel}
        L_{S,t+1} &= \beta S_t \frac{(I_t+\theta)^\alpha} {N_t+n_t\nonumber} \\
	I_{t+1} &= L_{S,t+1} + L_{R,t+1} + (1-r)I_t\nonumber\\
        S_{t+1} &= S_t + B - L_{S,t+1} + w R_t\nonumber\\
        R_{t+1} &= N_t-(S_{t+1}+I_{t+1}) 
\end{align}


\end{description}


\subsubsection{SnInRn-like models}
These are models with more than one compartment for susceptibles, infected and recovered stages. They are used when infection involves more than one distinct populations. Vector borne diseases are classical examples where a SIR model is used to describe infection in humans and another SIR-like model is used to describe infection in the vector (and/or the reservoir(s)). Dengue fever and yellow fever are examples. Sexually transmitted diseases may also be modelled with SnInRn models if male and female populations are distinguished. These models are still not available in EpiGrass.


\subsection{Stochastic models}\index{Models!stochastic}

All models described so far are deterministic. EpiGrass allows simulation of stochastic processes. This is done by assuming that $L_{t+1}$ is a random variable with expected value given by the expressions found in the deterministic models. The user may choose the probability distribution for $L_{t+1}$ between Poisson or Negative Binomial to draw realizations of $L_{t+1}$:

$$
l_{t+1} \sim Poisson (L_{t+1})
$$

\begin{center}
or 
\end{center}

$$
l_{t+1} \sim NegBin (I_t, \frac{I_t}{I_t+L_{t+1}}) 
$$

The Poisson distribution assume independent events while the negative Binomial assume clustering of transmission events. 


\section{Network transportation models}\index{Models!transportation}


The transmission models describe the dynamics of infection in a well-mixed population. EpiGrass allows the user to model the movement of infectious individuals between well-mixed populations, thus simulating the spread of disease through space. EpiGrass represents geographical space as a network where cities or localities are nodes and transportation routes are edges. The term network refers to the framework of routes within a system of locations, identified as nodes or sites. An edge is a single link between two sites (a road, a railroad, an air route or a river/sea corridor).

Transportation networks, like many networks, are generally embodied as set of locations and a set of links representing connections between those locations. The arrangement and connectivity of a network is known as its \textit{topology}. Major types of topology are illustrated in \ref{fig:artgraphs}. Velocity and direction of disease spread depend on the topology and weight of the edges of the transport network and there are many properties of networks that may useful when analyzing the spread of diseases. EpiGrass calculates a set of these properties, described in \ref{cap:analysis}: 

In a transportation network, each edge (or link) is characterized by a variable $flow$ which states the number of passengers that travel through that link per unit time. EpiGrass uses this information to calculate the number of passengers arriving at each city, per time step. For example, consider node $N1$ in figure \ref{fig:simpnet}. At each time step, it receives 10 passengers form $N2$, 5 from $N5$, 1 from $N4$. Now suppose that, at this time step, 10\% of the population within each site is infectious ($I$ state), according to the epidemic model. Thus, a total of $10\% \times 10 + 10\% \times 5 + 10\% \times 1 = 1.6$ infectious individuals are visiting site $N1$. In the epidemic model embedded in $N1$, EpiGrass sets $n = 16$ and $\theta = 1.6$. 


\begin{figure}[ht]
\begin{center}
	\includegraphics[scale=1.2]{simplenet.png}
\caption{A simple transportation network}
\label{fig:simpnet}
\end{center}
\end{figure}

%\subsection{Network topologies}

%Each transport network has a specific topology, that may depend on the scale of observation. Global transportation networks (as airlines) tend to a star configuration, with a few hubs. Terrestrial transportation tends to a mesh configuration. River networks tend to tree or linear topologies. 

%\begin{description}
%\item[Mesh network]
%\item[Star network]
%\item[Linear network]
%\item[Tree network]
%\item[Complete network]
%\item[Regular network]
%\end{description}

%\subsection{Network measures}

%With appropriate data, weights can be attributed to the edges. Figure shows a network with heterogeneous edges and nodes. The two dark nodes in the figure could represent important centers with large movement between them (thick lines). Peripheric localities, on the other hand, has lower connectance. Some measures presented here consider the weight of the edges, others not.


%\begin{description}
%\item[Distance matrix] The distance Matrix displays the number of edges between any
%        pair of nodes via the shortest path. 
%\item[Connectivity Matrix] The most basic measure of accessibility involves network connectivity
%        where a network is represented as a connectivity matrix(figure \ref{fig:cm}), which 
%        expresses the connectivity of each node with its adjacent nodes.    
%        The number of columns and rows in this matrix is equal to the number 
%        of nodes in the network and a value of 1 is given for each cell where 
%        this is a connected pair and a value of 0 for each cell where there 
%        is an unconnected pair. The summation of this matrix provides a very 
%        basic measure of accessibility, also known as the degree of a node.%
	
	
%\end{description}




%\section{The whole model}

%Combining the local epidemiological models to the dispersal network creates the full model implemented in %EpiGrass. 
%In the next section, you find an example of a whole model.


%\section{Example}

