make_rindex | R Documentation |
Prepare index matrix for Rt
make_rindex(window, nloc, T)
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 |
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.
matrix of R index
Sangeeta Bhatia, Anne Cori, Pierre Nouvellet
make_rindex(7, 2, 14) make_rindex(4, 2, 14)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.