Library
Contents
Index
MMCAcovid19.Epidemic_Params
MMCAcovid19.Epidemic_Params
MMCAcovid19.Population_Params
MMCAcovid19.Population_Params
MMCAcovid19.compute_R_eff
MMCAcovid19.reset_params!
MMCAcovid19.run_epidemic_spreading_mmca!
MMCAcovid19.run_epidemic_spreading_mmca!
MMCAcovid19.set_initial_infected!
MMCAcovid19.store_R_eff
MMCAcovid19.store_compartment
Types
MMCAcovid19.Epidemic_Params
— TypeEpidemic_Params
Struct that contains the parameters related with the epidemic parameters and compartmental evolution.
Fields
All the parameters contained in this structure are probabilities ranged between 0 and 1.
Epidemic parameters
βᴵ::Array{Float64, 1}
: Infectivity of infected.βᴬ::Array{Float64, 1}
: Infectivity of asymptomatic.ηᵍ::Array{Float64, 1}
: Exposed rate for each strata.αᵍ::Array{Float64, 1}
: Asymptomatic infectious rate for each strata.μᵍ::Array{Float64, 1}
: Infectious rate for each strata.θᵍ::Array{Float64, 1}
: Direct death probability for each strata.γᵍ::Array{Float64, 1}
: ICU probability for each strata.ζᵍ::Array{Float64, 1}
: Pre-deceased rate for each strata.λᵍ::Array{Float64, 1}
: Pre-hospitalized in ICU rate for each strata.ωᵍ::Array{Float64, 1}
: Fatality probability in ICU for each strata.ψᵍ::Array{Float64, 1}
: Death rate in iCU for each strata.χᵍ::Array{Float64, 1}
: ICU discharge rate for each strata.T::Int64
: Number of epidemic timesteps.
Compartmental evolution
ρˢᵍ::Array{Float64, 3}
: Matrix of size $G \times M \times T$ containing infomation about the evolution of fraction of suceptible individuals for each strata and patch.ρᴱᵍ::Array{Float64, 3}
: Matrix of size $G \times M \times T$ containing infomation about the evolution of fraction of exposed individuals for each strata and patch.ρᴬᵍ::Array{Float64, 3}
: Matrix of size $G \times M \times T$ containing infomation about the evolution of fraction of asymptomatic individuals for each strata and patch.ρᴵᵍ::Array{Float64, 3}
: Matrix of size $G \times M \times T$ containing infomation about the evolution of fraction of symptomatic individuals for each strata and patch.ρᴾᴴᵍ::Array{Float64, 3}
: Matrix of size $G \times M \times T$ containing infomation about the evolution of fraction of pre-hospitalized to ICU individuals for each strata and patch.ρᴾᴰᵍ::Array{Float64, 3}
: Matrix of size $G \times M \times T$ containing infomation about the evolution of pre-deceased individuals for each strata and patch.ρᴴᴿᵍ::Array{Float64, 3}
: Matrix of size $G \times M \times T$ containing infomation about the evolution of fraction of hospitalized in ICU patients who will recover for each strata and patch.ρᴴᴰᵍ::Array{Float64, 3}
: Matrix of size $G \times M \times T$ containing infomation about the evolution of fraction of hospitalized in ICU patients who will not recover for each strata and patch.ρᴰᵍ::Array{Float64, 3}
: Matrix of size $G \times M \times T$ containing infomation about the evolution of fraction of deceased individuals for each strata and patch.ρᴿᵍ::Array{Float64, 3}
: Matrix of size $G \times M \times T$ containing infomation about the evolution of fraction of recovered individuals for each strata and patch.
Auxiliary
CHᵢᵍ::Array{Float64, 2}
: Fraction of securely confined individuals for each strata and patch.Qᵢᵍ::Array{Float64, 3}
: Suceptible contacts available for each strata on a given patch.
Constructor
Use outer constructor Epidemic_Params
for a proper initialization of this struct.
MMCAcovid19.Epidemic_Params
— MethodEpidemic_Params(βᴵ::Float64,
βᴬ::Float64,
ηᵍ::Array{Float64, 1},
αᵍ::Array{Float64, 1},
μᵍ::Array{Float64, 1},
θᵍ::Array{Float64, 1},
γᵍ::Array{Float64, 1},
ζᵍ::Array{Float64, 1},
λᵍ::Array{Float64, 1},
ωᵍ::Array{Float64, 1},
ψᵍ::Array{Float64, 1},
χᵍ::Array{Float64, 1},
G::Int64,
M::Int64,
T::Int64)
Constructor of the struct Epidemic_Params
.
Arguments
βᴵ::Float64
: Infectivity of infected.βᴬ::Float64
: Infectivity of asymptomatic.ηᵍ::Array{Float64, 1}
: Vector of size $G$ with exposed rates for each strata.αᵍ::Array{Float64, 1}
: Vector of size $G$ with asymptomatic infectious rates for each strata.μᵍ::Array{Float64, 1}
: Vector of size $G$ with infectious rates for each strata.θᵍ::Array{Float64, 1}
: Vector of size $G$ with direct death probabilities for each strata.γᵍ::Array{Float64, 1}
: Vector of size $G$ with ICU probabilities for each strata.ζᵍ::Array{Float64, 1}
: Vector of size $G$ with pre-deceased rates for each strata.λᵍ::Array{Float64, 1}
: Vector of size $G$ with pre-hospitalized in ICU rates for each strata.ωᵍ::Array{Float64, 1}
: Vector of size $G$ with fatality probabilities in ICU for each strata.ψᵍ::Array{Float64, 1}
: Vector of size $G$ with death rates for each strata.χᵍ::Array{Float64, 1}
: Vector of size $G$ with ICU discharge rates for each strata.G::Int64
: Number of strata.M::Int64
: Number of patches.T::Int64
: Number of epidemic timesteps.
Return
Struct that contains the parameters related with the epidemic parameters and compartmental evolution.
MMCAcovid19.Population_Params
— TypePopulation_Params
Struct that contains the parameters related with geographical, population and mobility data.
Fields
G::Int64
: Number of population strata.M::Int64
: Number of patches.nᵢ:Array{Float64, 1}
: Population of each patch.nᵢᵍ:Array{Float64, 2}
: Population of each strata on each patch.nᵢ_eff:Array{Float64, 1}
: Effective population on each patch after taking into account mobility.nᵢᵍ_eff:Array{Float64, 1}
: Effective population of each strata on each patch after taking into account mobility.N::Int64
: Total population.Nᵍ::Array{Int64, 1}
: Total population of each strata.pᵍ::Array{Float64, 1}
: Vector with the degree of mobility of each strata.pᵍ_eff::Array{Float64, 1}
: Vector with the current degree of mobility of each strata.edgelist::Array{Int64, 2}
: Matrix with the directed edgelist between patches, where $L$ is the number of edges.Rᵢⱼ::Array{Float64, 1}
: Vector with the transition probabilities for each edge in the edgelist.mobilityᵍ::Array{Float64, 1}
: Effective mobility of each strata between patches (used to optimize performance).kᵍ::Array{Float64, 1}
: Average number of contacts of each strata.kᵍ_h::Array{Float64, 1}
: Average number of contacts at home of each strata.kᵍ_w::Array{Float64, 1}
: Average number of contacts at work of each strata.kᵍ_eff::Array{Float64, 1}
: Current average number of contacts of each strata.C::Array{Float64, 2}
: Matrix with the probability of contact between different stratifications.zᵍ::Array{Float64, 1}
: Nomalization factor each strata.normᵍ::Array{Float64, 2}
: Normalization of each strata (used to optimize performance).sᵢ::Array{Float64, 1}
: Surface of each patch.ξ::Float64
: Densisty factor.σ::Float64
: Average household size.
Constructor
Use outer constructor Population_Params
for a proper initialization of this struct.
MMCAcovid19.Population_Params
— MethodPopulation_Params(G::Int64,
M::Int64,
nᵢᵍ::Array{Float64, 2},
kᵍ::Array{Float64, 1},
kᵍ_h::Array{Float64, 1},
kᵍ_w::Array{Float64, 1},
C::Array{Float64, 2},
pᵍ::Array{Float64, 1},
edgelist::Array{Int64, 2},
Rᵢⱼ::Array{Float64, 1},
sᵢ::Array{Float64, 1},
ξ::Float64,
σ::Float64)
Constructor of the struct Population_Params
.
Arguments
G::Int64
: Number of population strata.M::Int64
: Number of patches.nᵢᵍ::Array{Float64, 2}
: Matrix of size $G \times M$ with the population at each strata and patch.kᵍ::Array{Float64, 1}
: Vector of size $G$ with the average number of contacts of each strata.kᵍ_h::Array{Float64, 1}
: Vector of size $G$ with the average number of contacts at home of each strata.kᵍ_w::Array{Float64, 1}
: Vector of size $G$ with the average number of contacts at work of each strata.C::Array{Float64, 2}
: Matrix of size $G \times G$ with the probability of contact between different stratifications.pᵍ::Array{Float64, 1}
: Vector of size $G$ with the degree of mobility of each strata ranged between 0 and 1.edgelist::Array{Int64, 2}
: Matrix of size $L \times 2$ containing the directed edgelist between patches, where $L$ is the number of edges. The IDs of the patches have to go from $1$ to $M$.Rᵢⱼ::Array{Float64, 1}
: Vector of size $L$ containing the transition probabilities for each edge in the edgelist.sᵢ::Array{Float64, 1}
: Vector of sizeM
with the surface of each patch.ξ::Float64
: Density factor.σ::Float64
: Average household size.
Return
Struct that contains the parameters related with geographical, population and mobility data.
Public
MMCAcovid19.compute_R_eff
— Functioncompute_R_eff(epi_params::Epidemic_Params,
population::Population_Params;
τ::Int64 = 21)
Compute the effective reproduction number R.
Arguments
epi_params::Epidemic_Params
: Structure that contains all epidemic parameters and the epidemic spreading information.population::Population_Params
: Structure that contains all the parameters related with the population.
Optional
τ::Int64 = 21
: kernel length.
Return
Tuple formed by:
- DataFrame containing information about the evolution of the effective reproduction number R for each strata and patch.
- DataFrame containing information about the evolution of the total effective reproduction number R.
MMCAcovid19.reset_params!
— Methodreset_params!(epi_params::Epidemic_Params,
population::Population_Params)
Reset the epidemic and population parameters to reuse the structure and avoid additional data allocations.
Arguments
epi_params::Epidemic_Params
: Structure that contains all epidemic parameters and the epidemic spreading information.population::Population_Params
: Structure that contains all the parameters related with the population.
MMCAcovid19.run_epidemic_spreading_mmca!
— Methodrun_epidemic_spreading_mmca!(epi_params::Epidemic_Params,
population::Population_Params,
tᶜs::Array{Int64, 1},
κ₀s::Array{Float64, 1},
ϕs::Array{Float64, 1},
δs::Array{Float64, 1};
t₀::Int64 = 1,
verbose::Bool = false)
Computes the evolution of the epidemic spreading over time, updating the variables stored in epi_params. It provides the option of the application of multiple different containmnets at specific dates.
Arguments
epi_params::Epidemic_Params
: Structure that contains all epidemic parameters and the epidemic spreading information.population::Population_Params
: Structure that contains all the parameters related with the population.tᶜs::Array{Int64, 1}
: List of timesteps of application of containments.κ⁰s::Array{Float64, 1}
: List of mobility reductions.ϕs::Array{Float64, 1}
: List of permeabilities of confined households.δs::Array{Float64, 1}
: List of social distancings.
Optional
t₀::Int64 = 1
: Initial timestep.verbose::Bool = false
: Iftrue
, prints useful information about the evolution of the epidemic process.
MMCAcovid19.run_epidemic_spreading_mmca!
— Methodrun_epidemic_spreading_mmca!(epi_params::Epidemic_Params,
population::Population_Params;
tᶜ::Int64 = -1,
κ₀::Float64 = 0.0,
ϕ::Float64 = 1.0,
δ::Float64 = 0.0,
t₀::Int64 = 1,
verbose::Bool = false)
Computes the evolution of the epidemic spreading over time, updating the variables stored in epi_params. It also provides, through optional arguments, the application of a containmnet on a specific date.
Arguments
epi_params::Epidemic_Params
: Structure that contains all epidemic parameters and the epidemic spreading information.population::Population_Params
: Structure that contains all the parameters related with the population.
Optional
tᶜ::Int64 = -1
: Timestep of application of containment, or out of timesteps range value for no containment.κ⁰::Float64 = 0.0
: Mobility reduction.ϕ::Float64 = 1.0
: Permeability of confined households.δ::Float64 = 0.0
: Social Distancing.t₀::Int64 = 1
: Initial timestep.verbose::Bool = false
: Iftrue
, prints useful information about the evolution of the epidemic process.
MMCAcovid19.set_initial_infected!
— Methodset_initial_infected!(epi_params::Epidemic_Params,
population::Population_Params,
E₀::Array{Float64, 2},
A₀::Array{Float64, 2},
I₀::Array{Float64, 2})
Set the initial number of infected individuals on a population. They can be introduced as exposed (E), asymptomatic (A) or symptomatic (I) individuals.
Arguments
epi_params::Epidemic_Params
: Structure that contains all epidemic parameters and the epidemic spreading information.population::Population_Params
: Structure that contains all the parameters related with the population.E₀::Array{Float64, 2}
: Matrix of size $G \times M$ containing the number of exposed individuals of each strata on each patch.A₀::Array{Float64, 2}
: Matrix of size $G \times M$ containing the number of asymptomatic infected individuals of each strata on each patch.I₀::Array{Float64, 2}
: Matrix of size $G \times M$ containing the number of symptomatic infected individualsof each strata on each patch.
MMCAcovid19.store_R_eff
— Methodstore_R_eff(epi_params::Epidemic_Params,
population::Population_Params,
suffix::String,
folder::String;
τ::Int64 = 21)
Compute and store the effective reproduction number R.
Arguments
epi_params::Epidemic_Params
: Structure that contains all epidemic parameters and the epidemic spreading information.population::Population_Params
: Structure that contains all the parameters related with the population.suffix::String
: String used to identify the experiment.folder::String
: String containing the path where the results will be stored.
Optional
τ::Int64 = 21
: kernel length.
MMCAcovid19.store_compartment
— Methodstore_compartment(epi_params::Epidemic_Params,
population::Population_Params,
compartment::Char,
sufix::String,
folder::String)
Store the evolution of the given epidemic compartment for each strata and patch.
Arguments
epi_params::Epidemic_Params
: Structure that contains all epidemic parameters and the epidemic spreading information.population::Population_Params
: Structure that contains all the parameters related with the population.compartment::String
: String indicating the compartment, one of:"S"
,"E"
,"A"
,"I"
,"PH"
,"PD"
,"HR"
,"HD"
,"D"
,"R"
.suffix::String
: String used to identify the experiment.folder::String
: String containing the path to the folder where the results will be stored.