make_par_list: Create a list of parameter values

Description Usage Arguments Value Concordance of ℛ0 and ⟨β⟩ Missing N0, S0, and I0 Examples

View source: R/make_par_list.R

Description

make_par_list() creates a list of parameter values that may be passed as an argument of:

As these methods deal with equally spaced time series data with fixed observation interval Δt, make_par_list() defines time (or rate) parameters in units (or per unit) Δt.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
make_par_list(
  dt_weeks = 1,
  t0 = 2000 * (365/7)/dt_weeks,
  prep = 1,
  trep = 0,
  hatN0 = 1e+06,
  N0 = NA,
  S0 = NA,
  I0 = NA,
  nu = 0.04 * (7/365) * dt_weeks,
  mu = 0.04 * (7/365) * dt_weeks,
  tgen = 13 * (1/7)/dt_weeks,
  Rnaught = 20,
  beta_mean = NA,
  alpha = 0.08,
  epsilon = 0,
  ode_control = list(method = "lsoda", rtol = 1e-06, atol = 1e-06)
)

Arguments

dt_weeks

[ Δt ] Observation interval in weeks.

t0

[ t0 ] Time of the first observation in units Δt.

prep

[ prep ] Case reporting probability.

trep

[ trep ] Case reporting delay in units Δt.

hatN0

[ Ñ0 ] Population size at time t = 0 years (see Details).

N0

[ N0 ] Population size at time t = t0. Can be set to NA (see Details).

S0

[ S0 ] Number of susceptibles at time t = t0. Can be set to NA (see Details).

I0

[ I0 ] Number of infecteds at time t = t0. Can be set to NA (see Details).

nu

[ νc ] Birth rate expressed per unit Δt and relative to Ñ0 (if modeled as constant).

mu

[ μc ] Natural mortality rate expressed per unit Δt and per capita (if modeled as constant).

tgen

[ tgen ] Mean generation interval of the disease of interest in units Δt.

Rnaught

[ ℛ0 ] Basic reproduction number of the disease of interest. Should be set to NA when specifying beta_mean (see Details).

beta_mean

[ ⟨β⟩ ] Mean of the seasonally forced transmission rate β(t) expressed per unit Δt per susceptible per infected. Should be set to NA when specifying Rnaught (see Details).

alpha

[ α ] Amplitude of the seasonally forced transmission rate β(t) relative to the mean.

epsilon

[ ϵ ] Standard deviation of the random phase shift in the seasonally forced transmission rate β(t).

ode_control

A list of arguments to be passed to deSolve::ode(), specifying options for numerical integration (see Details), such as method, rtol, and atol.

Value

A list of the arguments of make_par_list() (not counting ...), including values for Rnaught, beta_mean, N0, S0, and I0 if not defined in the function call (see Details).

Concordance of ℛ0 and ⟨β⟩

make_par_list() enforces the identity

ℛ0 = (νc Ñ / μc)(⟨β⟩ / (γ + μc))

as follows. If exactly one of Rnaught and beta_mean is NA in in the function call, then that parameter is internally assigned the value satisfying the identity. If both are NA, then an error is thrown. If neither is NA, then the value of beta_mean is replaced with the value satisfying the identity.

Missing N0, S0, and I0

If any of N0, S0, and I0 is NA in the function call, then, via a call to deSolve::ode(), make_par_list() numerically integrates the system of SIR equations

S′ = νcÑ0β(t)SIμcS
I′ = β(t)SIγIμcI
R′ = γIμcR

with γ = 1 / tgen and β(t) = ⟨β⟩ (1 + α cos(2πt / (1 year))) between times t = 0 years and t = t0, taking for the initial state (S(0),I(0),R(0)) the endemic equilibrium of the system with β(t) ≡ ⟨β⟩ and νc = μc. Then make_par_list() defines N0, S0, and I0 (only those that were NA in the function call) as follows:

N0

The value of S(t0)+I(t0)+R(t0).

S0

The value of S(t0).

I0

The value of I(t0).

A warning is issued if the ODE solver cannot complete the integration, A different solver may have more success (e.g., consider method = "ode45" instead of the default method = "lsoda"). Using different rtol and atol may also help.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# All arguments have default values
par_list <- make_par_list()
unlist(par_list)

# Time and rate parameters must be specified
# in terms of the observation interval
dt_weeks <- 1
nu_peryear <- 0.04
tgen_days <- 13
par_list <- make_par_list(
  dt_weeks = dt_weeks,
  nu       = nu_peryear * (7 / 365) * dt_weeks,
  tgen     = tgen_days * (1 / 7) / dt_weeks
)
unlist(par_list)

davidearn/fastbeta documentation built on June 14, 2020, 3:11 p.m.