make_rindex: Prepare index matrix for Rt

View source: R/fit.R

make_rindexR Documentation

Prepare index matrix for Rt

Description

Prepare index matrix for Rt

Usage

make_rindex(window, nloc, T)

Arguments

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.

nloc

integer. Number of locations.

T

integer. Number of time steps

Details

This is a utility function that prepares the index matrix for Rt estimation in Stan. Say we have two locations and a time series of cases over 14 days. For each location, we want to estimate Rt over a 7 day window so that in all, the model has 4 parameters for Rt (two for each location). The matrix looks like:

1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
2 4
2 4
2 4
2 4
2 4
2 4
2 4

The columns index the locations and the rows index the time points.

Value

matrix of R index

Author(s)

Sangeeta Bhatia, Anne Cori, Pierre Nouvellet

Examples

make_rindex(7, 2, 14)
make_rindex(4, 2, 14)

mrc-ide/spatialbranchr documentation built on Oct. 2, 2022, 5:56 p.m.