No description, website, or topics provided.
Clone or download
Lam Ho Lam Ho
Lam Ho and Lam Ho try to fix Travis
Latest commit 44ef669 Mar 22, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R try to fix Travis Mar 21, 2018
data add Eyam data to package, cache vignette intermediates Mar 8, 2016
inst compressed data a bit Jul 19, 2016
man try to fix Travis Mar 21, 2018
src adding general SIR model Mar 21, 2018
tests adding general SIR model Mar 21, 2018
vignettes compressed data a bit Jul 19, 2016
.Rbuildignore compressed data a bit Jul 19, 2016
.gitignore ignore latex intermediates Jul 19, 2016
.travis.yml try to fix Travis Mar 22, 2018
DESCRIPTION update Mar 20, 2018
MultiBD.Rproj clean R CMD CHECK as-cran Jul 19, 2016
NAMESPACE update Mar 19, 2018
NEWS initial NEWS file Jul 28, 2016
README.md Update README.md Mar 20, 2018
cran-comments.md tests are crashing on win-builder Jul 19, 2016

README.md

MultiBD

CRAN_Status_Badge

MultiBD is an R package for direct likelihood-based inference of multivariate birth-death processes.

Installation

  1. Install CRAN release version:
install.packages("MultiBD")
  1. Install the bleeding-edge version of MultiBD from github:
devtools::install_github("msuchard/MultiBD")

Short example

library(MultiBD)
data(Eyam)

loglik_sir <- function(param, data) {
  alpha <- exp(param[1]) # Rates must be non-negative
  beta  <- exp(param[2])
  
  # Set-up SIR model
  drates1 <- function(a, b) { 0 }
  brates2 <- function(a, b) { 0 }
  drates2 <- function(a, b) { alpha * b     }
  trans12 <- function(a, b) { beta  * a * b }
  
  sum(sapply(1:(nrow(data) - 1), # Sum across all time steps k
             function(k) {
               log(
                 dbd_prob(  # Compute the transition probability matrix
                   t  = data$time[k + 1] - data$time[k], # Time increment
                   a0 = data$S[k], b0 = data$I[k],       # From: S(t_k), I(t_k)                                      
                   drates1, brates2, drates2, trans12,
                   a = data$S[k + 1], B = data$S[k] + data$I[k] - data$S[k + 1],
                   computeMode = 4, nblocks = 80         # Compute using 4 threads
                 )[1, data$I[k + 1] + 1]                 # To: S(t_(k+1)), I(t_(k+1))
               )
             }))
}

loglik_sir(log(c(3.204, 0.019)), Eyam) # Evaluate at mode

Vignettes

  1. Simple MCMC under SIR
  2. SIR model and proposed branching approximation

License

MultiBD is licensed under Apache License 2.0

Development status

Build Status

Beta

Acknowledgements

  • This project is supported in part through the National Science Foundation grant DMS 1264153 and National Institutes of Health grant R01 AI107034.

References

  1. Ho LST, Xu J, Crawford FW, Minin VN, Suchard MA (2018). Birth/birth-death processes and their computable transition probabilities with biological applications. Journal of Mathematical Biology 76(4) 911-944.
  2. Ho LST, Crawford FW, Suchard MA (2018). Direct likelihood-based inference for discretely observed stochastic compartmental models of infectious disease. Annals of Applied Statistics. In press.