idbrm | R Documentation |
Interface for infectious disease modelling using brms.
idbrm(data, formula, family, priors, custom_stancode, dry = FALSE, ...)
data |
A data frame as prepared for modelling using |
formula |
A formula as defined using |
family |
A observation model family as defined in |
priors |
A list of priors as defined using |
custom_stancode |
A list of |
dry |
Logical, defaults to TRUE. For testing purposes should just the
|
... |
Additional arguments to pass to |
Sam Abbott
# define some example data library(data.table) dt <- data.table( region = "France", cases = seq(10, 500, by = 10), date = seq(as.Date("2020-10-01"), by = "days", length.out = 50) ) dt[, deaths := as.integer(shift(cases, 5) * 0.1)] dt[is.na(deaths), deaths := 0] dt <- prepare( dt, model = "convolution", location = "region", primary = "cases", secondary = "deaths", ) # fit the convolution model using a Poisson observation model fit <- idbrm(data = dt, family = poisson(link = "identity"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.