Skip to contents

Run the DAEDALUS model from R. This is a work in progress.

Usage

daedalus(
  country,
  infection,
  response_strategy = c("none", "elimination", "economic_closures", "school_closures"),
  implementation_level = c("light", "heavy"),
  response_time = 30,
  response_threshold = 1000,
  initial_state_manual = list(),
  time_end = 300,
  ...
)

Arguments

country

A country or territory object of class <daedalus_country>, or a country or territory name from those included in the package; see country_names. Country-specific data such as the community and workplace contacts, the demography, and the distribution of the workforce into economic sectors is automatically accessed from package data for the relevant country name if it is passed as a string. To override package defaults for country characteristics, pass a <daedalus_country> object instead. See daedalus_country() for more.

infection

An infection parameter object of the class <infection>, or an epidemic name for which data are provided in the package; see epidemic_names for parameters from a historical epidemic or epidemic wave. Passing the name as a string automatically accesses the default parameters of an infection. Create an pass a <daedalus_infection> to tweak infection parameters.

response_strategy

A string for the name of response strategy followed; defaults to "none". The response strategy determines the country-specific response threshold following which the response is activated. See response_threshold.

While the response strategy is active, economic contacts are scaled using the package data object daedalus::closure_data.

implementation_level

A string for the level at which the strategy is implemented; defaults to "light".

response_time

A single numeric value for the time in days at which the selected response is activated. This is ignored if the response has already been activated by the hospitalisation threshold being reached. Defaults to 30 days.

response_threshold

A single numeric value for the total number of hospitalisations that causes an epidemic response (specified by response_strategy) to be triggered, if it has not already been triggered via response_time. Currently defaults to 1000, which overrides the default response- and country-specific threshold values held in country_data.

initial_state_manual

An optional named list with the names p_infectious and p_asymptomatic for the proportion of infectious and symptomatic individuals in each age group and economic sector. Defaults to 1e-6 and 0.0 respectively.

time_end

An integer-like value for the number of timesteps at which to return data. This is treated as the number of days with data returned for each day. Defaults to 300 days.

...

Other arguments to be passed to the ODE solver; these are passed to deSolve::ode().

Value

A <deSolve> object.

Details

Initial state

Users can pass the following initial state parameters to initial_state_manual:

  • p_infectious: A single numeric value in the range \([0.0, 1.0]\) giving the proportion of individuals in each age group and economic sector that are to be initialised as infectious. Defaults to 1e-6, or one in every one million as infectious.

  • p_asymptomatic: A single numeric value in the range \([0.0, 1.0]\) for the proportion of initially infectious individuals who are considered to be asymptomatic. Defaults to 0.0.

Examples

# country and infection specified by strings using default characteristics
output <- daedalus(
  "Canada", "influenza_1918"
)

# country passed as <daedalus_country> with some characteristics modified
country_x <- daedalus_country(
  "Canada",
  parameters = list(contact_matrix = matrix(5, 4, 4)) # uniform contacts
)
output <- daedalus(country_x, "influenza_1918")

# with some infection parameters over-ridden by the user
output <- daedalus(
  "United Kingdom",
  daedalus_infection("influenza_1918", r0 = 1.3)
)

# with default initial conditions over-ridden by the user
output <- daedalus(
  "United Kingdom", "influenza_1918",
  initial_state_manual = list(p_infectious = 1e-3)
)