Computer Science

&

Data Science

Capstone Report - Spring 2022

ASIR: Robust Agent-based Representation Of SIR Model

Boyan Xu

supervised by

Olivier Marin

###### Abstract

Compartmental models (written as $CM$) and agent-based models (written as
$AM$) are dominant methods in the field of epidemic simulation. But in the
literature there lacks discussion on how to build the quantitative
relationship between them. In this paper, we propose an agent-based $SIR$
model: $ASIR$. $ASIR$ can robustly reproduce the infection curve predicted by
a given SIR model (the simplest $CM$.) Notably, one can deduce any parameter
of $ASIR$ from parameters of $SIR$ without manual tuning. $ASIR$ offers
epidemiologists a method to transform a calibrated $SIR$ model into an agent-
based model that inherit $SIR$’s performance without another round of
calibration. The design $ASIR$ is inspirational for building a general
quantitative relationship between $CM$ and $AM$.

###### keywords:

Computer Simulation; Epidemic Simulation

As a student double majoring in Computer Science and Data Science, I have
always been attracted by the idea behind computer simulation: modeling the
real world in programming language, making statistical inference about the
real world. I said yes immediately when professor Olivier Marin told me if I
was interested in on building some bridge between compartmental model (which
is based on ordinary differential equation) and agent-based model (which is
based on computer simulation.) We only have a vague direction at the
beginning, but as we went further in the literature, we were more and more
certain about we would like to contribute to. Finally, we proposed the agent-
based $ASIR$ that can robustly reproduce the infection curve predicted by the
compartmental SIR Model. We are happy to see that $ASIR$ is inspirational for
epidemiologists who wish to quickly transform a calibrated SIR model into an
agent-based model that retains its prediction without another round of
calibration.

###### Acknowledgements.

First, I would like to express my deepest gratitude to my parents. They have
always been supportive, open-minded, tolerant on every decision I made for
myself. While NYU Shanghai’s education makes me an intellectually cultivated
person, it is their education that gives me my integrity of personality. Then
I would like to acknowledge every professor I’ve met at NYU Shanghai and NYU.
They are all professional instructors and considerate professors. Especially,
I would like to sincerely acknowledge Professor Olivier Marin for patiently
instructing me how to read, think and write academically. I cannot complete my
capstone project without his unconditional support and comprehensive
instruction. Thank Professor Guyue Liu for encouraging me, and supporting my
capstone project during the depressing lockdown. Thank Professor Bruno Abrahao
for supervising my research in data science. Finally, I would like to thank
all the peers I met at NYU Shanghai, they constitute my undergraduate life.
Thank my "dude" Quang Luong for being my best CS professor. Thank my
girlfriend Helen Zhang for always staying by my side.

###### Contents

  1. 1 Introduction
  2. 2 Related Work
  3. 3 Solution
    1. 3.1 Idea Behind $ASIR$
    2. 3.2 Model Specification
    3. 3.3 Proof of Robustness
  4. 4 Results
    1. 4.1 $ASIR$ implementation in GAMA
    2. 4.2 $ASIR$ implementation in Agents.jl
  5. 5 Discussion
  6. 6 Conclusion

##  1 Introduction

Compartmental models (written as $CM$) and agent-based models (written as
$AM$) are dominant methods in the field of epidemic simulation.[1]. $CM$
capture the population level dynamics by a set of ordinary differential
equations. $AM$ capture the individual level dynamics by an agent-based
programming environment.

$CM$ and $AM$ have complementary nature. $CM$ are easy to calibrate but have
less flexible parameter space to apply a priori; $AM$ have a flexible
parameter space to apply a priori, but are hard to calibrate. In the current
literature, there lacks discussion on developing the quantitative relationship
between $CM$ and $AM$. Driven by this fact, we wish to bridge the gap between
$CM$ and $AM$ by finding an $AM$ that robustly reproduces the infection curve
predicted by a $CM$.

We start from the $SIR$ model (the simplest $CM$): where $P_{sir}$ is the set
of all parameters; and functions $S_{sir}(t)$, $I_{sir}(t)$, $R_{sir}(t)$ are
the population size of being susceptible, infected and recovered with respect
to time $t$. We propose an agent-based SIR model, $ASIR$, that achieves the
following interesting properties:

  1. 1.

$P_{asir}$ only depends on $P_{sir}$. Any parameter $p\in P_{asir}$ can be
deduced from $P_{sir}$, i.e. can be written as a determinate expression of
$\\{p_{1},p_{2},...,p_{k}\\}\subset P_{sir}$.

  2. 2.

$ASIR$ robustly reproduces the infection curve predicted by $SIR$. $ASIR$ is
expected to predict the same $S(t),I(t),R(t)$ as $SIR$, i.e. $\forall
t:\mathbb{E}\big{[}S_{asir}(t)\big{]}=S_{sir}(t)$;
$\mathbb{E}\big{[}I_{asir}(t)\big{]}=I_{sir}(t)$;
$\mathbb{E}\big{[}R_{asir}(t)\big{]}=R_{sir}(t)$

We validate $ASIR$’s properties by giving: 1). a proof of robustness, 2). two
implementations in GAMA and Agents.jl.

##  2 Related Work

$SIR$ model is the simplest compartmental model ($CM$). In [2], the authors
give us an overview of the design behind the compartmental model. From this
work, we learned that the core idea of $CM$ is to use a set of ordinary
differential equations to model the population infection and recovery, and use
parameters to control their rate.

In [3], the authors give us an overview of the agent-based simulation’s
application in the field of epidemiology. From this work, we learned that
representation of "space" is what distinguish agent-based model ($AM$) from
$CM$, and drew our attention to the design of agents’ Move behavior.

In [4], the authors describe a general method for the conversion of an
equation-based model to an agent-based simulation. Their method was not built
on solid mathematics, but the discussion about the relationship between
population behavior and individual behavior has greatly inspired our idea
behind $ASIR$. Our model can be seen as translating their rough ideology into
rigorous proof in mathematics.

[5] and [6] are the multiagent programming environments we use to implement
$ASIR$. Their design is the direct source of our perception of what is agent-
based simulation. $ASIR$ has been influenced by the concepts of "Agent,"
"Step," and "Map" that were implemented by [5] and [6].

[7] is the book we used as a reference for the necessary condition for the
existence of a Markov chain’s stationary distribution.

##  3 Solution

In this section, we introduce $ASIR$ in the following order: 1). idea behind,
2). model specification, and 3). proof of robustness.

###  3.1 Idea Behind $ASIR$

Let us first briefly recap the design of the $SIR$ model.

Figure 1: Diagram of SIR model

The $SIR$ model consists of two parameters: $\\{\alpha,\beta\\}$ and three
ordinary differential equations:

$\displaystyle\frac{dS}{dt}$ $\displaystyle=-\frac{\alpha SI}{N}$ (1)
$\displaystyle\frac{dI}{dt}$ $\displaystyle=\frac{\alpha SI}{N}-\beta I$ (2)
$\displaystyle\frac{dR}{dt}$ $\displaystyle=\beta I$ (3)

$N$ is the total population size. $S$ is the susceptible population size. $I$
is the infected population size. $R$ is the recovered population size.
$\alpha$ controls the transition speed from Susceptible into Infected. $\beta$
controls the transition speed from Infected into Recovered.

Equation 1 models the transition speed of Susceptible population size.
Equation 2 models the transition speed of Infected population size. Equation 3
models the transition speed of Recovered population size.

The intuitions behind $ASIR$ are:

  1. 1.

Population infection is an integral of individual infection.

  2. 2.

Population recovery is an integral of individual recovery.

To translate these intuitions into mathematics, we adopt the theory of
probability by treating population infection/recovery as the joint
distribution of individual infection/recovery.

The core ideas behind $ASIR$ are:

  1. 1.

Model individual infection/recovery as mutually independent and identically
distributed random events.

  2. 2.

Use parameters to control the event probability.

  3. 3.

The transition speed on population-level = the expected value of the integral
of event probability on individual-level.

Notably, since a Susceptible individual must be infected by an Infected
individual, an individual infection at time $t+1$ is conditional on another
individual’s infection at time $t$ (or ahead of $t$ ). To guarantee
independence between each individual’s infection, we model the movement of
every agent (or individuals, we are using these words interchangeably) using
the same transition matrix $T_{\text{map}}$. The matrix below shows a simple
example where our map consists of three locations:

$\mathbf{T_{\text{map}}}=\bordermatrix{&\text{Store}&\text{School}&\text{Stop}\cr\text{Store}&0.5&0.3&0.2\cr\text{School}&0.3&0.3&0.4\cr\text{Stop}&0.2&0.4&0.4}\qquad$
(4)

In this example, coordinate $T_{mn}$ is the probability of moving from
$m\text{ to }n$. We focus on the period after every agent’s trajectory reaches
$T_{\text{map}}$’s stationary distribution. We discuss why stationary
distribution is critical for robustness later in this section.

In the following subsection, we introduce $ASIR$’s detailed specification in
the following order: 1). agents’ state, 2). agents’ behavior, 3). model’s
parameter setting.

###  3.2 Model Specification

Each agent’s state can be written as a 3-element tuple:
$\Big{(}\text{Timestamp},\text{Health},\text{Position}\Big{)}$. "An agent
$a_{1}$ has state $\Big{(}8,I,\text{School}\Big{)}$" translates as: "at the
8-$th$ timestamp, $a_{1}$ is being Infected at School." In this paper, we will
use:

  1. 1.

$\big{(}a_{k},h_{t}\big{)}$ or $H^{t}_{a_{k}}$ to denote an agent’s health at
timestamp $t$,

  2. 2.

$\big{(}a_{k},p_{t}\big{)}$ or $P^{t}_{a_{k}}$ to denote an agent’s position
at timestamp $t$,

  3. 3.

$\big{(}a_{k},h_{t},p_{t}\big{)}$ or
$\big{(}H^{t}_{a_{k}},P^{t}_{a_{k}}\big{)}$ to denote an agent’s state at
timestamp $t$.

Meaning |  Form 1 |  Form 2
---|---|---
an agent’s health at timestamp $t$ |  $\big{(}a_{k},h_{t}\big{)}$ |  $H^{t}_{a_{k}}$
an agent’s position at timestamp $t$ |  $\big{(}a_{k},p_{t}\big{)}$ |  $P^{t}_{a_{k}}$
an agent’s state at timestamp $t$ |  $\big{(}a_{k},h_{t},p_{t}\big{)}$ |  $\big{(}H^{t}_{a_{k}},P^{t}_{a_{k}}\big{)}$
Table 1:  Symbol reference for agent state.

At timestamp $t$, each agent $a_{k}$ has three (potential) behaviors:

  1. 1.

Move. $a_{k}$ moves from $p_{t-1}$ to $p_{t}$ (which can be the same position
as $p_{t-1}$). Written as:

$P_{a_{k}}^{t-1}\to P_{a_{k}}^{t}$ (5)

As mentioned in the introduction, we model the movement of every agent using
the same transition matrix $T_{\text{map}}$. The trajectory of every agent
forms a Markov chain as the example below shows:

StoreSchoolStop0.50.30.20.30.30.40.20.40.4 Figure 2: Markov chain of the
sample $T_{\text{map}}$ 4

We insist on focusing on the period after every agent’s position reaches
$T_{\text{map}}$’s stationary distribution, because the stationary
distribution offers us the following critical property to deduce $ASIR$’s
robustness:

######  Property.

When every agent’s position reaches the $T_{\text{map}}$’s stationary
distribution, the probability that any two agents become neighbor at time $t$
(i.e. stay at the same position $p_{t}$) equals to a constant
$\mathds{P}(\text{meetup})$. $\mathds{P}(\text{meetup})$ is completely
determined by $T_{\text{map}}$.

The proof is trivial. An intuition is that agents’ locations are mutually
independent and identically distributed, therefore $\forall j,k,m,n,\
\mathds{P}(a_{k}\text{ meets }a_{j})=\mathds{P}(a_{m}\text{ meets }a_{n})$

  2. 2.

Turn infected. When $a_{k}$ was Susceptible before moving to position $X$, it
has a chance to turn infected when there is an "Infected neighbor" at $X$, or
more precisely, $\exists_{\ a_{j}\neq
a_{k}}H_{a_{j}}^{t}=I,P^{a_{j}}_{t}=P^{a_{k}}_{t}$. Written as:

$\Bigg{(}H_{a_{k}}^{t-1}\to H_{a_{k}}^{t}=S\to I\Bigg{|}\exists_{\ a_{j}\neq
a_{k}}H_{a_{j}}^{t}=I,P^{a_{j}}_{t}=P^{a_{k}}_{t}\Bigg{)}$ (6)

or simply:

$\Bigg{(}H_{a_{k}}^{t-1}\to H_{a_{k}}^{t}=S\to I\Bigg{|}a_{k}\text{ has an
infected neighbor at t}\Bigg{)}$ (7)

Figure 3:  Individual infection process in ASIR model.
---
$\alpha$’ is the infection probability
  3. 3.

Turn recovered. When $a_{k}$ was Infected at time $t-1$ it has a chance to
turn Recovered at time $t$. Written as:

$\Bigg{(}H_{a_{k}}^{t-1}\to H_{a_{k}}^{t}=I\to
R\Bigg{|}H_{a_{k}}^{t-1}=I\Bigg{)}$ (8)

or simply:

$H_{a_{k}}^{t-1}\to H_{a_{k}}^{t}=I\to R$ (9)

Figure 4:  Individual recovery process in the ASIR model.
---
$\beta$’ is the recovery probability

As mentioned in the introduction, a core idea supporting $ASIR$ to robustly
reproduce $SIR$’s prediction is using parameters to control the event
probability. In our model, there are only two types of random events that
involve transition in individual health state $H_{a_{k}}^{t}$: 1). turn
infected: $\big{(}H_{a_{k}}^{t-1}\to H_{a_{k}}^{t}\big{)}=\big{(}S\to
I\big{)}$ , and 2). turn recovered: $\big{(}H_{a_{k}}^{t-1}\to
H_{a_{k}}^{t}\big{)}=\big{(}I\to R\big{)}$. We are using two parameters
$\\{\alpha^{\prime},\beta^{\prime}\\}$ to control their probability in the
following way:

  1. 1.

$a_{k}$’s probability of being infected at $t$ is proportional to the count of
infected neighbor, with the ratio equals to parameter $\alpha^{\prime}$

$\frac{\mathds{P}\big{(}H_{a_{k}}^{t-1}\to H_{a_{k}}^{t}=S\to
I\big{)}}{{\sum}_{a_{j}}^{\ a_{j}\neq
a_{k}}\mathds{1}_{\\{H_{a_{j}}^{t}=I,P^{a_{j}}_{t}=P^{a_{k}}_{t}\\}}}=\mathds{1}_{\\{H_{a_{k}}^{t-1}=S\\}}\cdot\alpha^{\prime}$
(10)

or simply,

$\frac{\mathds{P}\big{(}H_{a_{k}}^{t-1}\to H_{a_{k}}^{t}=S\to
I\big{)}}{{\sum}_{a_{j}}^{\ a_{j}\neq a_{k}}\mathds{1}_{a_{j}\text{ is
infected neighbor of }a_{k}\text{ at }t}}=\alpha^{\prime}$ (11)

Notably, here we are making an assumption that:

$\mathds{P}\Big{(}1<\alpha^{\prime}*{\sum}_{a_{j}}^{a_{j}\neq
a_{k}}\mathds{1}_{a_{j}\text{ is infeacted neighbor of }a_{k}\text{ at
}t}\Big{)}=0$ (12)

This means we are requiring the agent density at any location to be reasonably
low in order to reflect the reality that people almost never stay in a place
that has absolute causality in terms of infection.

  2. 2.

An Infected $a_{k}$’s probability of being recovered at any time $t$ is
constant, which equals to parameter $\beta^{\prime}$

$\mathds{P}(H_{a_{k}}^{t-1}\to H_{a_{k}}^{t}=I\to
R)=\mathds{1}_{\\{H_{a_{k}}^{t-1}=I\\}}\cdot\beta^{\prime}$ (13)

or simply:

$\mathds{P}(H_{a_{k}}^{t-1}\to H_{a_{k}}^{t}=I\to R)=\beta^{\prime}$ (14)

Based on the $ASIR$ specification above, we propose the following theorem:

######  Theorem 1.

($ASIR$ Robustness theorem) $ASIR$ robustly reproduce the infection curve
predicted by $SIR$, i.e. "$\forall
t:\mathbb{E}\big{[}S_{asir}(t)\big{]}=S_{sir}(t)$;
$\mathbb{E}\big{[}I_{asir}(t)\big{]}=I_{sir}(t)$;
$\mathbb{E}\big{[}R_{asir}(t)\big{]}=R_{sir}(t)$", if:

  1. 1.

$S_{asir}(0)=S_{sir}(0)$; $I_{asir}(0)=I_{sir}(0)$; $R_{asir}(0)=R_{sir}(0)$,
and

  2. 2.

$\alpha=\alpha^{\prime}\cdot\mathds{P}(\text{meetup})\cdot N$;
$\mathds{P}(\text{meetup})$ is determined by $ASIR$’s transition matrix
$T_{\text{map}}$, $N$ is the population size, and

  3. 3.

$\beta=\beta^{\prime}$

We will give the proof in the "Proof of Robustness" section.

###  3.3 Proof of Robustness

Let us give the proof for theorem 1. We write "period $(t,t+k)$" when we refer
to the period since $t$ till $t+k$ . We are using "$\Delta
S_{\text{sir}}\rvert_{t}^{t+k}$" to denote the change in $S_{sir}(t)$ during
the period $(t,t+k)$:

$\displaystyle\Delta S_{\text{sir}}\rvert_{t}^{t+k}$
$\displaystyle=S_{\text{sir}}(t+k)-S_{\text{sir}}(t)$ (15)
$\displaystyle\Delta I_{\text{sir}}\rvert_{t}^{t+k}$
$\displaystyle=I_{\text{sir}}(t+k)-I_{\text{sir}}(t)$ (16)
$\displaystyle\Delta R_{\text{sir}}\rvert_{t}^{t+k}$
$\displaystyle=R_{\text{sir}}(t+k)-R_{\text{sir}}(t)$ (17)

Similarly, we are using "$\Delta S_{\text{asir}}\rvert_{t}^{t+k}$" to denote
the change in $S_{asir}(t)$ during the period $(t,t+k)$:

$\displaystyle\Delta S_{\text{asir}}\rvert_{t}^{t+k}$
$\displaystyle=S_{\text{asir}}(t+k)-S_{\text{asir}}(t)$ (18)
$\displaystyle\Delta I_{\text{asir}}\rvert_{t}^{t+k}$
$\displaystyle=I_{\text{asir}}(t+k)-I_{\text{asir}}(t)$ (19)
$\displaystyle\Delta R_{\text{asir}}\rvert_{t}^{t+k}$
$\displaystyle=R_{\text{asir}}(t+k)-R_{\text{asir}}(t)$ (20)

We prove theorem 1 by proving theorems 2, 3:

Theorem 3Theorem 2Theorem 1 Figure 5:  Relationship between theorems: theorem
3 implies theorem 2;
---
theorem 2 implies theorem 1.

######  Theorem 2.

$ASIR$ robustly reproduce the infection curve predicted by $SIR$, i.e.
"$\forall t:\mathbb{E}\big{[}S_{asir}(t)\big{]}=S_{sir}(t)$;
$\mathbb{E}\big{[}I_{asir}(t)\big{]}=I_{sir}(t)$;
$\mathbb{E}\big{[}R_{asir}(t)\big{]}=R_{sir}(t)$", if for any period
$(t,t+k)$:

  1. 1.

$\mathbb{E}\big{[}\Delta S_{\text{asir}}\big{\rvert}_{t}^{t+k}\big{]}=\Delta
S_{\text{sir}}\rvert_{t}^{t+k}$, and

  2. 2.

$\mathbb{E}\big{[}\Delta I_{\text{asir}}\big{\rvert}_{t}^{t+k}\big{]}=\Delta
I_{\text{sir}}\rvert_{t}^{t+k}$ , and

  3. 3.

$\mathbb{E}\big{[}\Delta R_{\text{asir}}\big{\rvert}_{t}^{t+k}\big{]}=\Delta
R_{\text{sir}}\rvert_{t}^{t+k}$

###### Proof.

Take period $(0,t)$,

  1. 1.

$\mathbb{E}\big{[}S_{\text{asir}}(t)\big{]}=\mathbb{E}\big{[}\Delta
S_{\text{asir}}\big{\rvert}_{0}^{t}\big{]}+S_{\text{asir}}(0)=\Delta
S_{\text{sir}}\rvert_{0}^{t}+S_{\text{sir}}(0)=S_{\text{sir}}(t)$, and

  2. 2.

$\mathbb{E}\big{[}I_{\text{asir}}(t)\big{]}=\mathbb{E}\big{[}\Delta
I_{\text{asir}}\big{\rvert}_{0}^{t}\big{]}+I_{\text{asir}}(0)=\Delta
I_{\text{sir}}\rvert_{0}^{t}+I_{\text{sir}}(0)=I_{\text{sir}}(t)$, and

  3. 3.

$\mathbb{E}\big{[}R_{\text{asir}}(t)\big{]}=\mathbb{E}\big{[}\Delta
R_{\text{asir}}\big{\rvert}_{0}^{t}\big{]}+R_{\text{asir}}(0)=\Delta
R_{\text{sir}}\rvert_{0}^{t}+R_{\text{sir}}(0)=R_{\text{sir}}(t)$

∎

######  Theorem 3.

For any period $(t,t+k)$:

  1. 1.

$\mathbb{E}\big{[}\Delta S_{\text{asir}}\big{\rvert}_{t}^{t+k}\big{]}=\Delta
S_{\text{sir}}\rvert_{t}^{t+k}$

  2. 2.

$\mathbb{E}\big{[}\Delta I_{\text{asir}}\big{\rvert}_{t}^{t+k}\big{]}=\Delta
I_{\text{sir}}\rvert_{t}^{t+k}$

  3. 3.

$\mathbb{E}\big{[}\Delta R_{\text{asir}}\big{\rvert}_{t}^{t+k}\big{]}=\Delta
R_{\text{sir}}\rvert_{t}^{t+k}$

if:

  1. 1.

$S_{asir}(0)=S_{sir}(0)$; $I_{asir}(0)=I_{sir}(0)$; $R_{asir}(0)=R_{sir}(0)$,
and

  2. 2.

$\alpha=\alpha^{\prime}\cdot\mathds{P}(\text{meetup})\cdot N$;
$\mathds{P}(\text{meetup})$ is determined by $ASIR$’s transition matrix
$T_{\text{map}}$, $N$ is the population size, and

  3. 3.

$\beta=\beta^{\prime}$

###### Proof.

In $SIR$,

$\displaystyle\begin{split}\Delta
S_{\text{sir}}\rvert_{t}^{t+1}=\int_{t}^{t+1}\frac{dS}{dt}dt&=-\frac{\alpha}{N}\cdot
S_{\text{sir}}(t)I_{\text{sir}}(t)\cdot\int_{t}^{t+1}dt\\\
&=-\frac{\alpha}{N}\cdot S_{\text{sir}}(t)I_{\text{sir}}(t)\end{split}$ (22)
$\displaystyle\begin{split}\\\ \Delta
R_{\text{sir}}\rvert_{t}^{t+1}=\int_{t}^{t+1}\frac{dR}{dt}dt&=\beta\cdot
I_{\text{sir}}(t)\cdot\int_{t}^{t+1}dt\\\ &=\beta\cdot
I_{\text{sir}}(t)\end{split}$ (23) $\displaystyle\begin{split}\\\ \Delta
I_{\text{sir}}\rvert_{t}^{t+1}=-\Delta S_{\text{sir}}\rvert_{t}^{t+1}-\Delta
R_{\text{sir}}\rvert_{t}^{t+1}&=\frac{\alpha}{N}\cdot
S_{\text{sir}}(t)I_{\text{sir}}(t)-\beta\cdot I_{\text{sir}}(t)\end{split}$
(24)

In $ASIR$,

$\displaystyle\begin{split}\mathbb{E}\big{[}\Delta
S_{\text{asir}}\big{\rvert}_{t}^{t+1}\big{]}&=-\mathop{{{{\sum}}}}_{\scriptscriptstyle\big{\\{}a_{k}\big{|}H_{a_{k}}^{t}=S\big{\\}}}\mathop{{{{\sum}}}}_{\scriptscriptstyle\big{\\{}a_{j}\big{|}H_{a_{j}}^{t}=I\big{\\}}}\mathds{1}_{(P^{a_{j}}_{t}=P^{a_{k}}_{t})}\cdot\mathds{1}_{(H_{a_{k}}^{t}\to
H_{a_{k}}^{t+1}=S\to I)}\\\
&=-\mathop{{{{\sum}}}}_{\scriptscriptstyle\big{\\{}a_{k}\big{|}H_{a_{k}}^{t}=S\big{\\}}}\mathop{{{{\sum}}}}_{\scriptscriptstyle\big{\\{}a_{j}\big{|}H_{a_{j}}^{t}=I\big{\\}}}\mathds{P}(\text{meetup})\cdot\alpha^{\prime}\\\
&=-\alpha^{\prime}\cdot\mathds{P}(\text{meetup})\cdot\mathbb{E}\big{[}S_{\text{asir}}(t)\big{]}\cdot\mathbb{E}\big{[}I_{\text{asir}}(t)\big{]}\\\
&=-\frac{\alpha}{N}\cdot\mathbb{E}\big{[}S_{\text{asir}}(t)\big{]}\cdot\mathbb{E}\big{[}I_{\text{asir}}(t)\big{]}\end{split}$
(25) $\displaystyle\begin{split}\\\ \mathbb{E}\big{[}\Delta
R_{\text{asir}}\big{\rvert}_{t}^{t+1}\big{]}&=\mathop{{{{\sum}}}}_{\scriptscriptstyle\big{\\{}a_{k}\big{|}H_{a_{k}}^{t}=I\big{\\}}}\mathds{1}_{H_{a_{k}}^{t-1}\to
H_{a_{k}}^{t}=I\to R}\\\
&=\mathop{{{{\sum}}}}_{\scriptscriptstyle\big{\\{}a_{k}\big{|}H_{a_{k}}^{t}=I\big{\\}}}\beta^{\prime}\\\
&=\mathbb{E}\big{[}I_{\text{asir}}(t)\big{]}\cdot\beta^{\prime}\end{split}$
(26) $\displaystyle\begin{split}\\\ \mathbb{E}\big{[}\Delta
I_{\text{asir}}\big{\rvert}_{t}^{t+1}\big{]}&=-\mathbb{E}\Big{[}\Delta
S_{\text{asir}}\big{\rvert}_{t}^{t+1}\Big{]}-\mathbb{E}\Big{[}\Delta
R_{\text{asir}}\big{\rvert}_{t}^{t+1}\Big{]}\\\
&=\frac{\alpha}{N}\cdot\mathbb{E}\big{[}S_{\text{asir}}(t)\big{]}\cdot\mathbb{E}\big{[}I_{\text{asir}}(t)\big{]}-\mathbb{E}\big{[}I_{\text{asir}}(t)\big{]}\cdot\beta^{\prime}\end{split}$
(27)

When $t=0$,

$\displaystyle\begin{split}\mathbb{E}\Big{[}S_{\text{asir}}(1)\Big{]}&=\mathbb{E}\big{[}S_{\text{asir}}(0)\big{]}+\mathbb{E}\Big{[}\Delta
S_{\text{asir}}\Big{\rvert}_{0}^{1}\Big{]}\\\
&=S_{\text{asir}}(0)+\frac{\alpha}{N}\cdot\mathbb{E}\big{[}S_{\text{asir}}(0)\big{]}\cdot\mathbb{E}\big{[}I_{\text{asir}}(0)\big{]}\\\
&=S_{\text{sir}}(0)+\frac{\alpha}{N}\cdot S_{\text{sir}}(0)\cdot
I_{\text{sir}}(0)\\\ &=S_{\text{sir}}(0)+\Delta
S_{\text{sir}}\rvert_{0}^{1}\\\ &=S_{\text{sir}}(1)\end{split}$ (28)
$\displaystyle\begin{split}\\\
\mathbb{E}\Big{[}R_{\text{asir}}(1)\Big{]}&=\mathbb{E}\big{[}R_{\text{asir}}(0)\big{]}+\mathbb{E}\Big{[}\Delta
R_{\text{asir}}\Big{\rvert}_{0}^{1}\Big{]}\\\
&=\mathbb{E}\big{[}R_{\text{asir}}(0)\big{]}+\mathbb{E}\big{[}I_{\text{asir}}(0)\big{]}\cdot\beta^{\prime}\\\
&=R_{\text{asir}}(0)+\beta^{\prime}\cdot I_{\text{asir}}(0)\\\
&=R_{\text{sir}}(0)+\beta\cdot I_{\text{sir}}(0)\\\ &=R_{\text{sir}}(0)+\Delta
R_{\text{sir}}\rvert_{0}^{1}\\\ &=R_{\text{sir}}(1)\end{split}$ (29)
$\displaystyle\begin{split}\\\
\mathbb{E}\Big{[}I_{\text{asir}}(1)\Big{]}&=N-\mathbb{E}\Big{[}S_{\text{asir}}(1)\Big{]}-\mathbb{E}\Big{[}R_{\text{asir}}(1)\Big{]}\\\
&=N-S_{\text{sir}}(1)-R_{\text{sir}}(1)\\\ &=I_{\text{sir}}(1)\end{split}$
(30)

When $t>0$, assume
$\mathbb{E}\big{[}S_{\text{asir}}(t-1)\big{]}=S_{\text{sir}}(t-1)$,
$\mathbb{E}\big{[}I_{\text{asir}}(t-1)\big{]}=I_{\text{sir}}(t-1)$, and
$\mathbb{E}\big{[}R_{\text{asir}}(t-1)\big{]}=R_{\text{sir}}(t-1)$ ,

$\displaystyle\begin{split}\mathbb{E}\Big{[}S_{\text{asir}}(t)\Big{]}&=\mathbb{E}\Big{[}S_{\text{asir}}(t-1)\Big{]}+\mathbb{E}\Big{[}\Delta
S_{\text{asir}}\Big{\rvert}_{t-1}^{t}\Big{]}\\\
&=\mathbb{E}\Big{[}S_{\text{asir}}(t-1)\Big{]}-\frac{\alpha^{\prime}}{N}\cdot\mathbb{E}\big{[}S_{\text{asir}}(t-1)\big{]}\cdot\mathbb{E}\big{[}I_{\text{asir}}(t-1)\big{]}\\\
&=S_{\text{sir}}(t-1)-\frac{\alpha}{N}\cdot S_{\text{sir}}(t-1)\cdot
I_{\text{sir}}(t-1)\\\ &=S_{\text{sir}}(t)\end{split}$ (31)
$\displaystyle\begin{split}\\\
\mathbb{E}\Big{[}R_{\text{asir}}(t)\Big{]}&=\mathbb{E}\big{[}R_{\text{asir}}(t-1)\big{]}+\mathbb{E}\Big{[}\Delta
R_{\text{asir}}\Big{\rvert}_{t-1}^{t}\Big{]}\\\
&=\mathbb{E}\big{[}R_{\text{asir}}(t-1)\big{]}+\mathbb{E}\big{[}I_{\text{asir}}(t-1)\big{]}\cdot\beta^{\prime}\\\
&=S_{\text{sir}}(t-1)+I_{\text{sir}}(t-1)\cdot\beta\\\
&=R_{\text{sir}}(t)\end{split}$ (32) $\displaystyle\begin{split}\\\
\mathbb{E}\Big{[}I_{\text{asir}}(t)\Big{]}&=N-\mathbb{E}\Big{[}S_{\text{asir}}(t)\Big{]}-\mathbb{E}\Big{[}R_{\text{asir}}(t)\Big{]}\\\
&=N-S_{\text{sir}}(t)-R_{\text{sir}}(t)\\\ &=I_{\text{sir}}(t)\end{split}$
(33)

By mathematical induction, for any period $(t,t+k)$: $\mathbb{E}\big{[}\Delta
S_{\text{asir}}\big{\rvert}_{t}^{t+k}\big{]}=\Delta
S_{\text{sir}}\rvert_{t}^{t+k}$, $\mathbb{E}\big{[}\Delta
I_{\text{asir}}\big{\rvert}_{t}^{t+k}\big{]}=\Delta
I_{\text{sir}}\rvert_{t}^{t+k}$, $\mathbb{E}\big{[}\Delta
R_{\text{asir}}\big{\rvert}_{t}^{t+k}\big{]}=\Delta
R_{\text{sir}}\rvert_{t}^{t+k}$.

∎

Proof of Robustness:

###### Proof.

Theorem 3 implies theorem 2; theorem 2 implies theorem 1. ∎

##  4 Results

In this section, we will discuss the outcome of our imperfect111This happened
because those implementations were crafted before we mature the model design
and completed the Proof of Robustness. $ASIR$ implementations in two
multiagent programming environments: GAMA and Agents.jl222Agents.jl is more
flexible and programmable than GAMA. We shift to Agents.jl to examine if the
robustness we observed in GAMA retains under different environment..

###  4.1 $ASIR$ implementation in GAMA

Our $ASIR$ implementation in GAMA uses a small map ($50\times 50$ grid) and
large population size ($N=500$.) We observe a perfect reproduction of the
coresponding $SIR$’s infection curve. We think this is because
$\mathds{P}(\text{meetup})$ and $\frac{\text{step size}}{\text{map size}}$ is
high enough to quickly reach $T_{\text{map}}$’s stationary distribution.

Figure 6:  $ASIR$ implementation on GAMA perfectly reproduce the infection
curve
---
of the given $SIR$. On bottom-left is $ASIR$’s infection curve; on top-right
is $SIR$’s infection curve; on bottom-right is a comparison between the two.

###  4.2 $ASIR$ implementation in Agents.jl

However, our $ASIR$ implementation in Agents.jl with a larger map ($100\times
100$ grid) and the same population size ($N=100$) fails to robustly reproduce
the infection curve of the same benchmark $SIR$ we used in GAMA. (As Figure 7
illustrates.) The initial Infected agents recover before infecting enough
Susceptible agents; so both $I_{asir}(t)$ and $R_{asir}(t)$ full curves remain
flat to 0.

Figure 7:  $ASIR$ implementation on Agents.jl fails to reproduce the infection
curve
---
of the given $SIR$; both $I_{asir}(t)$ and $R_{asir}(t)$ full curves remain
flat to 0.

When we play back the trajectory of agents, we find agents are loosely
distributed, and their trajectories have few intersections
($\mathds{P}(\text{meetup})\approx 0$, $\frac{\text{step size}}{\text{map
size}}\approx 0$).

We think this is a counterexample where $T_{\text{map}}$’s stationary
distribution can not be reached in finite steps. A primitive explanation is:
when $\frac{\text{step size}}{\text{map size}}\approx 0$, positions that are
too far away are nearly inaccessible to each other in finite steps; for
example, an agent will take nearly infinite steps to move from the top-left
corner to the bottom-right corner. This breaks one of the necessary conditions
that "there is only one communication class" for $T_{\text{map}}$’s stationary
distribution to exist in finite steps.

##  5 Discussion

In this section, we will discuss the primary imperfection of our $ASIR$
implementations.

The primary imperfection of our implementations is: they does not guarantee
agents to reach the $T_{\text{map}}$’s stationary distribution at time $t=0$.
This is because we did not implement the Move behavior in a direct form of
transition matrix $T_{\text{map}}$, but as "at each timestamp $t$, randomly
choose one direction from $(\text{up},\text{down},\text{left},\text{right})$,
then move one unit distance accordingly." Though theoretically, this
implementation of the Move behavior has a transition matrix $T_{\text{map}}$
representation which has a stationary distribution. The problem is: we cannot
determine, after which $t$, agents’ positions will reach $T_{\text{map}}$’s
stationary distribution. Also, we have to estimate but not deduce the value of
$\mathds{P}(\text{meetup})$.

As a correction of our present approach, we would implement the Move behavior
in direct form of $T_{\text{map}}$ so that we can 1). guarantee each agents’
position will state reach $T_{\text{map}}$’s stationary distribution at $t=0$,
2). deduce the exact value of $\mathds{P}(\text{meetup})$.

##  6 Conclusion

We propose an agent-based $SIR$ model, $ASIR$ , that achieves the following
interesting properties:

  1. 1.

Parameters of $ASIR$ can be deduced from (i.e. written as a determinate
expression of) parameters of $SIR$.

  2. 2.

$ASIR$ robustly reproduce the infection curve predicted by $SIR$ (i.e. the
expectation values of the population size of being susceptible, infected and
recovered equal to $SIR$’s prediction.)

We validated $ASIR$’s properties by giving: 1). a proof of robustness, 2). two
implementations in GAMA and Agents.jl.

There are two interesting directions to extend our work:

  1. 1.

Find robust agent-based representations for other compartmental models
($SEIR$, $SEIS$, …) We could start with describing new types of states and
behaviors in the algebraic language we use (like Table 1) and give a proof of
robustness.

  2. 2.

Construct the transition matrix $T_{\text{map}}$ based on real data, check if
the deduced value of $\alpha^{\prime}$ comply with intuition. We could start
with finding a calibrated $SIR$ model in the literature, where both real
infection data and transportation data are applicable; then use MCMC
algorithms like Gibbs sampling to construct the according transition matrix
$T_{\text{map}}$.

## References

  * [1] V. Grimm, U. Berger, F. Bastiansen, S. Eliassen, V. Ginot, J. Giske, J. Goss-Custard, T. Grand, S. K. Heinz, G. Huse, A. Huth, J. U. Jepsen, C. Jørgensen, W. M. Mooij, B. Müller, G. Pe’er, C. Piou, S. F. Railsback, A. M. Robbins, M. M. Robbins, E. Rossmanith, N. Rüger, E. Strand, S. Souissi, R. A. Stillman, R. Vabø, U. Visser, and D. L. DeAngelis, “A standard protocol for describing individual-based and agent-based models,” _Ecological Modelling_ , vol. 198, no. 1, p. 115–126, 2006.
  * [2] A. Menon, N. K. Rajendran, A. Chandrachud, and G. Setlur, “Modelling and simulation of covid-19 propagation in a large population with specific reference to india,” _medRxiv_ , 2020. [Online]. Available: https://www.medrxiv.org/content/early/2020/05/05/2020.04.30.20086306
  * [3] L. Perez and S. Dragicevic, “An agent-based approach for modeling dynamics of contagious disease spread,” _International Journal of Health Geographics_ , vol. 8, no. 1, p. 50, Aug 2009. [Online]. Available: https://doi.org/10.1186/1476-072X-8-50
  * [4] M. Crossley and M. Amos, “Simzombie: A case-study in agent-based simulation construction,” in _Agent and Multi-Agent Systems: Technologies and Applications_ , J. O’Shea, N. T. Nguyen, K. Crockett, R. J. Howlett, and L. C. Jain, Eds. Berlin, Heidelberg: Springer Berlin Heidelberg, 2011, pp. 514–523.
  * [5] P. Taillandier, B. Gaudou, A. Grignard, Q.-N. Huynh, N. Marilleau, P. Caillou, D. Philippon, and A. Drogoul, “Building, composing and experimenting complex spatial models with the gama platform,” _Geoinformatica_ , vol. 23, no. 2, p. 299–322, apr 2019. [Online]. Available: https://doi.org/10.1007/s10707-018-00339-6
  * [6] G. Datseris, A. R. Vahdati, and T. C. DuBois, “Agents.jl: a performant and feature-full agent-based modeling software of minimal code complexity,” _SIMULATION_ , vol. 0, no. 0, p. 003754972110688, Jan. 2022. [Online]. Available: https://doi.org/10.1177/00375497211068820
  * [7] R. F. Serfozo, “Basics of applied stochastic processes,” 2012.