bpmodels

[RETIRED. Use the epichains package instead]. Methods for simulating and analysing the sizes and lengths of chains from branching process models

https://github.com/epiforecasts/bpmodels

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    3 of 8 committers (37.5%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.2%) to scientific vocabulary

Keywords

branching-process epidemic-dynamics epidemic-modelling epidemic-simulations epidemiology epiverse outbreak-simulator r r-package transmission-chain transmission-chain-reconstruction

Keywords from Contributors

cmdstanr effective-reproduction-number-estimation infectious-disease-surveillance nowcasting outbreak-analysis pandemic-preparedness real-time-infectious-disease-modelling stan covid-19 best-practices
Last synced: 10 months ago · JSON representation

Repository

[RETIRED. Use the epichains package instead]. Methods for simulating and analysing the sizes and lengths of chains from branching process models

Basic Info
Statistics
  • Stars: 7
  • Watchers: 3
  • Forks: 7
  • Open Issues: 6
  • Releases: 5
Topics
branching-process epidemic-dynamics epidemic-modelling epidemic-simulations epidemiology epiverse outbreak-simulator r r-package transmission-chain transmission-chain-reconstruction
Created over 7 years ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog Contributing License Citation

README.Rmd

---
output: github_document
bibliography: vignettes/references.json
link-citations: true
---

```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = file.path("man", "figures", "README-"),
  out.width = "100%"
)
```

# _bpmodels_: Methods for simulating and analysing the size and length of transmission chains from branching process models


[![Lifecycle: retired](https://img.shields.io/badge/lifecycle-retired-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#retired)
![GitHub R package version](https://img.shields.io/github/r-package/v/epiforecasts/bpmodels)
[![R-CMD-check](https://github.com/epiforecasts/bpmodels/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/epiforecasts/bpmodels/actions/workflows/R-CMD-check.yaml)
[![codecov](https://codecov.io/github/epiforecasts/bpmodels/branch/main/graph/badge.svg)](https://app.codecov.io/github/epiforecasts/bpmodels) 
![GitHub contributors](https://img.shields.io/github/contributors/epiforecasts/bpmodels)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/license/MIT/)



## WARNING

> `{bpmodels}` is now *retired and will no longer be maintained*. We recommend using [`{epichains}`](https://github.com/epiverse-trace/epichains) instead. If you need help converting your code to use `{epichains}`, please [open a discussion on epichains](https://github.com/epiverse-trace/epichains/discussions).

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

_bpmodels_ is an R package to simulate and analyse the size and length of 
branching processes with a given offspring distribution. These models are often 
used in infectious disease epidemiology, where the chains represent chains of
transmission, and the offspring distribution represents the distribution of 
secondary infections caused by an infected individual.

# Installation

The latest development version of the _bpmodels_ package can be installed via

```{r eval=FALSE}
# check whether {pak} is installed
if (!require("pak")) install.packages("pak")
pak::pkg_install("epiforecasts/bpmodels")
```

To load the package, use

```{r eval=TRUE}
library("bpmodels")
```

# Core functionality

_bpmodels_ provides three main functions: 

`chain_ll()`: calculates the likelihoods of observing a vector of chains 
  of given sizes or lengths.

Here is a quick example of estimating the loglikelihood of an observed chain:
```{r}
# example of observed chain sizes
chain_sizes <- c(1, 2, 3, 4) 
# estimate loglikelihood of the observed chain sizes
chain_ll_eg <- chain_ll(x = chain_sizes, offspring = "pois", 
                        stat = "size", lambda = 0.5)
chain_ll_eg
```


`chain_sim()`: simulates transmission chains until all chains stop producing
  offspring.

Below is a quick example where we simulate the chain sizes of $5$ chains with 
a poisson offspring with mean, $\text{lambda} = 0.5$:
```{r}
set.seed(123)

chain_sim_eg <- chain_sim(n = 5, offspring = "pois", stat = "size", 
                          lambda = 0.5, tree = TRUE)

head(chain_sim_eg)
```

`chain_sim_susc()`: simulates transmission chains from a specified population
  size with pre-existing immunity until the susceptible pool runs out.
  
Below is a quick example where we simulate chains with a poisson 
offspring with mean, $\text{lambda} = 0.5$, and serial interval of $3$:
```{r}
set.seed(1234)

chain_sim_susc_eg <- chain_sim_susc(pop = 1000, offspring = "pois",
                                    mn_offspring = 0.5,
                                    serial = function(x) {3}
                                    )

head(chain_sim_susc_eg)
```

See the ["Get started vignette"](https://epiforecasts.github.io/bpmodels/articles/bpmodels.html) for a detailed illustration of 
each function.

## Package vignettes

Specific use cases of _bpmodels_ can be found in 
the [online documentation as package vignettes](https://epiforecasts.github.io/bpmodels/), under "Articles".

## Reporting bugs 

To report a bug please open an [issue](https://github.com/epiforecasts/bpmodels/issues/new/choose).

## Contribute

We welcome contributions to enhance the package's functionalities. If you 
wish to do so, please follow the [package contributing guide](https://github.com/epiforecasts/bpmodels/blob/main/.github/CONTRIBUTING.md).

## Code of conduct

Please note that the _bpmodels_ project is released with a [Contributor Code of Conduct](https://github.com/epiforecasts/.github/blob/main/CODE_OF_CONDUCT.md). 
By contributing to this project, you agree to abide by its terms.

## Citing this package

```{r message=FALSE, warning=FALSE}
citation("bpmodels")
```

Owner

  • Name: Epiforecasts
  • Login: epiforecasts
  • Kind: organization
  • Email: sebastian.funk@lshtm.ac.uk
  • Location: London

Researchers at the London School of Hygiene & Tropical Medicine doing research to forecast infectious diseases and perform real-time analyses.

GitHub Events

Total
  • Issues event: 1
  • Watch event: 1
  • Delete event: 5
  • Push event: 12
  • Pull request event: 7
  • Create event: 4
Last Year
  • Issues event: 1
  • Watch event: 1
  • Delete event: 5
  • Push event: 12
  • Pull request event: 7
  • Create event: 4

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 385
  • Total Committers: 8
  • Avg Commits per committer: 48.125
  • Development Distribution Score (DDS): 0.457
Past Year
  • Commits: 27
  • Committers: 2
  • Avg Commits per committer: 13.5
  • Development Distribution Score (DDS): 0.296
Top Committers
Name Email Commits
jamesaazam j****m@l****k 209
James Azam j****m@s****a 88
Sebastian Funk s****k@l****k 67
GitHub Action a****n@g****m 15
ffinger 1****r 3
Zhian N. Kamvar z****r@g****m 1
Tim Taylor t****r@h****k 1
Hugo Gruson B****o 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 55
  • Total pull requests: 45
  • Average time to close issues: 25 days
  • Average time to close pull requests: 9 days
  • Total issue authors: 5
  • Total pull request authors: 4
  • Average comments per issue: 0.47
  • Average comments per pull request: 1.2
  • Merged pull requests: 42
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 6
  • Average time to close issues: 5 months
  • Average time to close pull requests: 16 minutes
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 5
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • jamesmbaazam (43)
  • joshwlambert (3)
  • avallecam (1)
  • sbfnk (1)
  • Karim-Mane (1)
Pull Request Authors
  • jamesmbaazam (37)
  • sbfnk (4)
  • TimTaylor (1)
  • Bisaloo (1)
Top Labels
Issue Labels
good first issue (14) documentation (14) enhancement (3) pkg infrastructure (1) website (1) question (1)
Pull Request Labels
documentation (2) enhancement (2) pkg infrastructure (1)

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.4.1 composite
  • actions/checkout v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v3 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION cran
  • bookdown * suggests
  • covr * suggests
  • knitr * suggests
  • rmarkdown * suggests
  • testthat * suggests
  • truncdist * suggests
.github/workflows/render_readme.yml actions
  • actions/checkout v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/update-citation-cff.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite