Skip to contents

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

Usage

daedalus(
  country,
  infection,
  response_strategy = NULL,
  vaccine_investment = NULL,
  response_time = 30,
  response_duration = 365,
  auto_social_distancing = c("off", "independent", "npi_linked"),
  initial_state_manual = NULL,
  time_end = 600,
  ...
)

Arguments

country

A country or territory object of class <daedalus_country>, or a country or territory name from those included in the package; see daedalus.data::country_names, or a country ISO2 or ISO3 code; see daedalus.data::country_codes_iso2c and daedalus.data::country_codes_iso3c. 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 <daedalus_infection>, or an epidemic name for which data are provided in the package; see daedalus.data::epidemic_names for historical epidemics or epidemic waves for which parameters are available. Passing the name as a string automatically accesses the default parameters of an infection. Create and pass a <daedalus_infection> to tweak infection parameters using daedalus_infection().

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.data::closure_data.

vaccine_investment

Either a single string or a <daedalus_vaccination> object specifying the vaccination parameters associated with an advance vaccine-investment scenario. Defaults to NULL for absolutely no vaccination in the model. A vaccination investment of "none" indicates no prior investment, but the model will include vaccination beginning after 1 year, at a low rate across all age groups. Other accepted values are "low", "medium" and "high". See daedalus_vaccination() for more information.

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_duration

A single integer-ish number that gives the number of days after response_time that an NPI should end.

auto_social_distancing

A string giving the option for the form of spontaneous social distancing in the model, which reduces infection transmission as a function of daily deaths. See Details for more.

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.

...

Optional arguments that are passed to dust2::dust_ode_control().

Value

A <daedalus_output> object if infection is a string or a single <daedalus_infection> object. Otherwise, a list of <daedalus_output>s of the same length of infection if a list of <daedalus_infection>s is passed to infection.

Details

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.

Details: Spontaneous social distancing

There are three possible options for this behavioural module, given below. Note that a major issue with including this in a model run (any value other than "off") is that it leads to substantially lower response costs, and generally better health outcomes (lives lost), without accounting for any attendant economic or social costs. As such, please treat this option as highly experimental.

  • "off": There is no effect of daily deaths on infection transmissibility. This is the default choice.

  • "independent": Public-concern over deaths reduces transmissibility, and is independent of any mandated responses. It begins at the start of the simulation, and continues until the simulation ends.

  • "npi_linked": Public-concern over deaths reduces transmissibility, but only when a mandated response is active. Note that there is currently no way to end a response triggered by a state, i.e., an NPI launched due to hospital capacity being breached.

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)
)