spatial_estimate | R Documentation |
Given past incidence in N locations, this function (a) jointly estimates the reproduction number and the probability of movement, or (b) if pmovement is not NULL, estimates only the reproduction number
spatial_estimate( x, si, window = 7L, pmovement = NULL, population, distance, alpha, beta, K, model = "poisson", priors, ... )
x |
A matrix of past incidence (integer). The matrix has 1 column for each location; that is, each column is interpreted as the incidence in a location. |
si |
A matrix of discretised serial interval, assumed to be the same same for all locations. These can be generated easily using the package EpiEstim. See vignettes for examples. |
window |
integer indicating the length of the window over which Rt is to be estimated. Window length is assumed to be the same for all locations. Default value is 7 i.e. Rt is estimated over a weekly window. Currently only non-overlapping windows are supported. |
pmovement |
either NULL or a N X N matrix where N is the number of locations. If pmovement is NULL, then this function jointly estimates the parameters of gravity and branching process models. The gravity model describes the population movement and the brancing process model describes the underlying transmission process. |
population |
a vector of length N giving the populations of each location. Silently ignored if pmovement is not NULL |
distance |
N X N matrix of the distances between the N locations. Silently ignored if pmovement is not NULL |
alpha |
gravity model paramater; exponent on source population |
beta |
gravity model paramater; exponent on destination population |
K |
gravity model paramater |
model |
Currently only "poisson" is supported |
priors |
a list specifying priors for the model. To use the default priors, use the function 'spatial_priors' |
... |
Additional parameters to be passed to stan |
Fitted stan model, a stanfit object
Sangeeta Bhatia
# Fake incidence matrix x <- rpois(14, 2) y <- rpois(14, 3) incid <- matrix(c(x, y), nrow = 14, ncol = 2) # Fake serial interval si <- c(0, 0.01, 0.02, 0.07, 0.12, 0.14, 0.15, 0.13, 0.11, 0.08, 0.06, 0.04, 0.03, 0.02, 0.02) pops <- c(1e6, 1e6) dist <- matrix(c(0, 1e3, 1e3, 0), nrow = 2) priors <- spatial_priors() spatial_estimate(incid, si, 7L, NULL, pops, dist, 1, 1, 1, "poisson", priors)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.