## Ebola estimates of the SI distribution from the first 9 months of
## West-African Ebola oubtreak
mu <- 15.3 # days
sigma <- 9.3 # days
param <- gamma_mucv2shapescale(mu, sigma / mu)
if (require(distcrete)) {
w <- distcrete("gamma", interval = 1,
shape = param$shape,
scale = param$scale, w = 0)
r2R0(c(-1, -0.001, 0, 0.001, 1), w)
## Use simulated Ebola outbreak and 'incidence' to get a log-linear
## model of daily incidence.
if (require(outbreaks) && require(incidence)) {
i <- incidence(ebola_sim$linelist$date_of_onset)
plot(i)
f <- fit(i[1:100])
f
plot(i[1:150], fit = f)
R0 <- lm2R0_sample(f$model, w)
hist(R0, col = "grey", border = "white", main = "Distribution of R0")
summary(R0)
}
}
Run the code above in your browser using DataCamp Workspace