A more complex SHLIR model flow diagram, with risk groups, treatment, and reinfection for those who have recovered from active disease

SHLITR_risk_ode(t, x, params)

Arguments

t

The timestep over which to calculate derivatives

x

A numeric vector of compartment populations.

params

A named vector of parameter values.

Value

A vector of derivatives

Examples


## initialise
inits <- c(
# General population
S = 800,
H = 0,
L = 0,
I = 0,
Tr = 0,
R = 0,
## High risk population
S_H = 199,
H_H = 0,
L_H = 0,
I_H = 1,
Tr_H = 0,
R_H = 0
)

parameters <- c(
beta = 3, # Rate of transmission
beta_H = 6, # High risk rate of transmission
gamma_H = 1/5, # Rate of progression to active symptoms from high risk latent
nu = 1/2, #Rate of progression from high to low risk latent
gamma_L = 1/100, # Rate of progression to active symptoms for low risk latent
epsilon = 1/3, # Rate of treatment
tau = 1/2, # Rate of recovery
M = 0.2 # Between group mixing
)

SHLITR_risk_ode(1, inits, parameters)
#> [[1]]
#>          S          S          H          H          I         Tr        S_H 
#> -0.9600000  0.9600000  0.0000000  0.0000000  0.0000000  0.0000000 -1.1940000 
#>        S_H        H_H        H_H        I_H       Tr_H 
#>  1.1940000  0.0000000 -0.3333333  0.3333333  0.0000000 
#>