项目作者: bcgov

项目描述 :
Stochastic epidemiological branching simulation
高级语言: R
项目地址: git://github.com/bcgov/epi.branch.sim.git
创建时间: 2020-08-07T04:51:07Z
项目社区:https://github.com/bcgov/epi.branch.sim

开源协议:Apache License 2.0

下载


epi.branch.sim

img

Simulates an epidemic outbreak with a stochastic branching process from
a number of initial seed cases.

Features

Every simulated case has disease and intervention parameters
stochastically drawn from user-provided distributions. These parameters
determine which secondary cases occur, which in turn create the next
generation of cases. This simulation implements modelling of
interventions such as: * manual/conventional contact tracing, *
app-based contact tracing usage and compliance, * reduction of contacts
through physical distancing, * self-isolation of cases after certain
conditions are met, and * quarantine/isolation of new arrivals.

This simulation also includes the option of adding new cases via
importation, which may have different contact tracing and self-isolation
conditions. The simulation itself outputs a dataframe that summarizes
every case generated during the course of the simulation. This can be
used to generate metrics or other statistics across a large number of
runs. Some example driver functions to do this are provided in the
package and as vignettes.

This package is inspired by Hellewell et al. “Feasibility of
controlling COVID-19 outbreaks by isolation of cases and contacts.” The
Lancet Global Health
2020; 8: E488–E496. DOI:
10.1016/S2214-109X(20)30074-7
30074-7).

Installation

To install this package along with the vignettes, use

  1. remotes::install_github("bcgov/epi.branch.sim", ref="main", build_vignettes=TRUE)

Usage

A very simple example of setting up and running a scenario for 30 days.

  1. # Set up simulation objects
  2. sim_params <- epi.branch.sim::initialize_sim_params(
  3. R0=3.0, infect_dur=999, vary_trace=FALSE, p_trace=0.8,
  4. p_trace_app=0, p_trace_app_comp=0, p_symp=0.9, dt=1,
  5. incub_params=list(dist='weibull', shape=2.322737, scale=6.492272),
  6. generation_int_params=list(dist='skew_norm', omega=2, alpha=1.95),
  7. iso_delay_params=list(dist='Hellewell', shape=1.651524, scale=4.287786),
  8. sec_infect_params=list(type='Hellewell', disp=0.16),
  9. import_params=list(type="None"),
  10. phys_dist_params=list(
  11. pd_pop_frac = 0,
  12. pd_contact_rate1 = 1.0,
  13. pd_contact_rate2 = 1.0,
  14. pd_change_t = 0)
  15. )
  16. start_time <- 0
  17. n_initial <- 20
  18. sim_status <- epi.branch.sim::initialize_sim_status(start_time,n_initial)
  19. state_df <- epi.branch.sim::create_state_df(n_initial,sim_params, sim_status, initialize=TRUE)
  20. record_df <- epi.branch.sim::create_record_df(state_df, sim_status, initialize=TRUE)
  21. # Run for 30 steps
  22. for (t in 1:30){
  23. out <- epi.branch.sim::step_simulation(sim_status, state_df, record_df, sim_params)
  24. sim_status <- out$status # update sim_status
  25. state_df <- out$state # update state_df
  26. record_df <- out$record # update record_df
  27. }
  28. # Output products are the state_df and record_df data frames

Detailed documentation on the simulation algorithm, input parameters,
output data frames and examples are provided as vignettes. Once the
package is installed with the build_vignette=TRUE option as above,
these vignettes can be viewed with:

  1. browseVignettes('epi.branch.sim')

For help on all documented functions and objects, use:

  1. help(package='epi.branch.sim')

Project Status

This package is stable. This is a public release of a tool regularly
used within our team in order to share the tool more widely. At release,
the package is functional, all of the intended features are working and
documented. More features may be added based on usage and demand, but there
are no current plans to continue development at this time.

Getting Help or Reporting an Issue

To report bugs/issues/feature requests, please file an
issue.

How to Contribute

If you would like to contribute to the package, please see our
CONTRIBUTING guidelines.

Please note that this project is released with a Contributor Code of
Conduct
. By participating in this project you agree
to abide by its terms.

License

  1. Copyright 2020 Province of British Columbia
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.

This project was created using the
bcgovr package.