est.R0.SB | R Documentation |

Estimate R by a sequential Bayesian method, using known data up to a point in time as a Bayesian prior for the next iteration (see details).

```
est.R0.SB(
epid,
GT,
t = NULL,
begin = NULL,
end = NULL,
date.first.obs = NULL,
time.step = 1,
force.prior = FALSE,
checked = FALSE,
...
)
```

`epid` |
Object containing epidemic curve data. |

`GT` |
Generation time distribution from |

`t` |
Vector of dates at which incidence was observed. |

`begin` |
At what time estimation begins (unused by this method, just there for plotting purposes). |

`end` |
At what time estimation ends (unused by this method, just there for plotting purposes). |

`date.first.obs` |
Optional date of first observation, if |

`time.step` |
Optional. If date of first observation is specified, number of day between each incidence observation. |

`force.prior` |
Set to any custom value to force the initial prior as a uniform distribution on [0 ; value]. |

`checked` |
Internal flag used to check whether integrity checks were ran or not. |

`...` |
Parameters passed to inner functions. |

For internal use. Called by `estimate.R()`

.

Initial prior is an unbiased uniform distribution for R, between 0 and the maximum of incid(t+1) - incid(t). For each subsequent iteration, a new distribution is computed for R, using the previous output as new prior.

The 95% confidence intervan is achieved by a cumulative sum of the posterior distirbution of R and corresponds to the 2.5-th and 97.5-th percentiles.

A list with components:

`R` |
vector of R values. |

`conf.int` |
95% confidence interval for estimates. |

`proba.Rt` |
A list with successive distribution for R throughout the outbreak. |

`GT` |
Generation time distribution used in the computation. |

`epid` |
Original epidemic data. |

`begin` |
Begin date for the fit. |

`begin.nb` |
Index of begin date for the fit. |

`end` |
End date for the fit. |

`end.nb` |
Index of end date for the fit. |

`pred` |
Predictive curve based on most-likely R value. |

`data.name` |
Name of the data used in the fit. |

`call` |
Complete call used to generate results. |

`method` |
Method for estimation. |

`method.code` |
Internal code used to designate method. |

This is the implementation of the method provided by Bettencourt & Ribeiro (2008).

Pierre-Yves Boelle, Thomas Obadia

Bettencourt, L.M.A., and R.M. Ribeiro. "Real Time Bayesian Estimation of the Epidemic Potential of Emerging Infectious Diseases." PLoS One 3, no. 5 (2008): e2185.

```
#Loading package
library(R0)
## Data is taken from the paper by Nishiura for key transmission parameters of an institutional
## outbreak during 1918 influenza pandemic in Germany)
data(Germany.1918)
mGT <- generation.time("gamma", c(3,1.5))
SB <- est.R0.SB(Germany.1918, mGT)
## Results will include "most likely R(t)" (ie. the R(t) value for which the computed probability
## is the highest), along with 95% CI, in a data.frame object
SB
# Reproduction number estimate using Real Time Bayesian method.
# 0 0 2.02 0.71 1.17 1.7 1.36 1.53 1.28 1.43 ...
SB$Rt.quant
# Date R.t. CI.lower. CI.upper.
# 1 1918-09-29 0.00 0.01 1.44
# 2 1918-09-30 0.00 0.01 1.42
# 3 1918-10-01 2.02 0.97 2.88
# 4 1918-10-02 0.71 0.07 1.51
# 5 1918-10-03 1.17 0.40 1.84
# 6 1918-10-04 1.70 1.09 2.24
# 7 1918-10-05 1.36 0.84 1.83
# 8 1918-10-06 1.53 1.08 1.94
# 9 1918-10-07 1.28 0.88 1.66
# 10 1918-10-08 1.43 1.08 1.77
# ...
## "Plot" will provide the most-likely R value at each time unit, along with 95CI
plot(SB)
## "Plotfit" will show the complete distribution of R for 9 time unit throughout the outbreak
plotfit(SB)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.