knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(epidsampler)
library(magrittr)

The simulation is divided in two main function. We generate the regular squared lattice grid and the individuals using genmap(). Then, for each day of the simulation (referred as "step"), we simulate the mobility, social interaction and the evolution of the epidemics with the infection and evolution of the disease for each individual in the map.

Map generation

set.seed(12345)
map <- genmap(n=5, p=c(10,50))
print(map)

Parameters:

For the map generation we considered a population distributed into spatial units laid on a n-by-n regular squared lattice grid. Each square of the grid contains a number of individuals randomly drawn from a uniform distribution ranging between the two values contained in the vector p. This geographical representation is very general in that the map thus generated can represent, e. g., a city divided into blocks or a region divided into smaller spatial union or any other meaningful geographical partition.

Simulation

Mobility

Parameters:

The contagion mechanism is favoured by people mobility. In this simulation, we assumed that in any moment of time a certain percentage m of the population can move between the squares. In this way it is possible to distinguish different epidemic phases such as free-to-move period and lockdown. The commuting during the lockdown period is not only limited by the number of people who move, but also by the extent of their movements. This is a further simulation parameter which is generated by a uniform distribution ranging from -s to s.

Social interaction

Parameters:

Given the mobility pattern described above, contagion is determined by the social interaction and the contact opportunities. The number of contacts in each square of the grid is assumed to be determined by a random number drawn from a Poisson distribution with parameter, say cn, while the number of people involved in the movements is also a Poisson number characterised but a different parameter cp. Given these assumptions, a contagion occurs in the following way. If in a meeting it is present at least one asymptomatic or an exposed person, im susceptibles will be infected moving in the status of the Exposed.

Evolution of the epidemics

Classification of individuals:

Parameters:

First of all, in order to simulate an artificial population describing the time evolution of an epidemics, we considered a popular model constituted by a system of six differential equations which, in each moment of time, describe six categories of individuals, namely: the susceptibles (S), those exposed to the virus (E), the infected with symptoms (I), those without symptoms (A) and those that are removed from population either because healed (R) or dead (D). This modelling framework is due to the seminal contribution of Hamer (1906), Kermack and McKendrick (1927) and Soper (1929) and it is often referred to as the “SIR model” from the initials of the categories considered in the first simplified formulation: Susceptibles, Infected and Removed. A comprehensive overview of this model is contained in Cliff et al. (1981). See also Vynnycky and White (2010).

For the data random generation, we assumed that, if infected, a susceptible element of the population (S) will remain in the exposed state (E) for the time tE. After that period the subject can become either infected with symptoms (I) with probability ir or without (asymptomatic; symbol A) with probability 1-ir. The asymptomatic will remain infected (and so still able to transmit the virus) for tA days. After this period all the asymptomatic will be considered healed and will pass to the category removed (R). In contrast, the infected people showing symptoms will be healed with probability 1-cfr or die (D) with probability cfr (case death rate).

The first simulation does not consider asyntomatic in the evolution of the epidemics.

map <- map %>%
    addsteps(n=21, m=0.1, s=2,
             cn=6, cp=5,
             im=3, tE=5, tA=14,
             tI=14, ir=1, cfr=0.15) %>%
    addsteps(n=9, m=0.01, s=1,
             cn=1, cp=2,
             im=3, tE=5, tA=14,
             tI=14, ir=1, cfr=0.15)
plot(map)

With the parameter ir it is possibile to add the Aymptomatics.

map <- genmap(n=5, p=c(10,50)) %>%
    addsteps(n=21, m=0.1, s=2,
             cn=6, cp=5,
             im=3, tE=5, tA=14,
             tI=14, ir=0.25, cfr=0.15) %>%
    addsteps(n=9, m=0.01, s=1,
             cn=1, cp=2,
             im=3, tE=5, tA=14,
             tI=14, ir=0.25, cfr=0.15)
plot(map)


vincnardelli/epidsampler documentation built on Dec. 17, 2020, 6:25 p.m.