run_simulation_shp: Runs the spatial epidemic simulation (Shapefile)

Description Usage Arguments Details Value Examples

View source: R/run_simulation_shp.R

Description

Simulates an epidemic using the provided Shapefile, spatial kernel, contact matrix, and infection parameters.

Usage

1
2
3
run_simulation_shp(shp_data, D, contact_mat, beta, alpha = 1, sigma = 1/2.6,
  stoch = FALSE, step = 1, start_area = NA, start_num = 10,
  t_max = 100)

Arguments

shp_data

The dataframe object containing the population data extracted from the Shapefile object (generated by the prep_simulation_shp function)

D

The expanded kernel matrix to use for FOI calculation (generated by the calc_beta_shp function).

contact_mat

The contact matrix for mixing between age groups.

beta

The beta value for the epidemic (calculated from a given R0 using the calc_beta_shp function).

sigma

The recovery rate for the epidemic (must match the one used to calculate beta from R0 using the calc_beta_shp function).

stoch

Logical. If TRUE, the simulation is stochastic.

step

Size of time step for stochastic simulation, in days (default is 1 day).

start_area

Where to start the epidemic. You can provide the name of the area directly (you can check which are possible by looking inside the shp_data dataframe). If using the District, County or Region resolution, the default is London. Otherwise, no default is provided.

start_num

Number of infected individuals to start the epidemic.

t_max

How many days to run the simulation for.

Details

This functions requires specific objects to run. These can be generated using the prep_simulation_shp function (e.g. if you want to simulate an epidemic using the Shapefile object "region_shp", you must prep_simulation_shp(region_shp) first). The model used is an SIR model, where individuals can be either Susceptible, Infected or Recovered with regards to the disease. This assumes that Infected individuals are infectious, and that Recovered individuals are immune and cannot be reinfected.

Value

Returns one dataframe object containing the estimates of Susceptible, Infected and Recovered individuals for each time step.

Examples

1
2
3
4
5
6
#load the data: (note this assumes you have this file in this specific directory)
region_shp = readShapeSpatial("data/Regions/infuse_rgn_2011.shp")

prep_simulation_shp(region_shp)

results = run_simulation_shp(shp_data, expanded_D, contact_mat, beta)

qleclerc/efficientspatial documentation built on May 23, 2019, 1:24 p.m.