-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Episode suggestion: disease burden model #74
Comments
Thanks for the code - very useful to get things started. The output from
Is there a method you have used before to convert cases from continuous to discrete for this purpose? |
I suppose if the number of infections is large, we could use the normal approximation to the binomial distribution? |
The number of new infections early in the outbreak is small but the issue of continuous cases also arises with simulating the number of hospitalization delay times here:
we need a discrete number of cases here otherwise we would try to simulate a delay time for a proportion of a case |
The alternative would be to do everything with expectations (e.g. multiply continuous value by the continuous distributional value). Actually, perhaps this is cleaner, because the above code has a stochastic element, so we'd ideally simulate more than once... |
Something like :
|
Thanks. It would be good to represent the distributional spread rather than just the mean (e.g. if 100 people get ill today, it would be useful to plot the expected distribution of admissions over the coming weeks, according to Below is quickest way I could think to code this up - would need to explain to learner what a convolution is (but perhaps not a bad thing, given it's so fundamental to modelling, and methods like this act by doing de-convolution: https://epiverse-trace.github.io/howto/analyses/reconstruct_transmission/estimate_infections.html): # Simulate some random new cases
n_days <- 200 # Number of days in the simulation
new_cases <- rpois(n_days, lambda = 10) # Random daily new cases (Poisson distributed)
new_cases[101:200] <- 0 # End outbreak after day 100
# Define delay parameters
onset_to_admission <- epiparameter(
disease = "Disease X",
epi_name = "onset to admission",
prob_distribution = create_prob_distribution(
prob_distribution = "gamma",
prob_distribution_params = c(shape = 5, scale = 4),
discretise = T
)
)
admission_to_discharge <- epiparameter(
disease = "Disease X",
epi_name = "admission to discharge",
prob_distribution = create_prob_distribution(
prob_distribution = "gamma",
prob_distribution_params = c(shape = 10, scale = 2),
discretise = T
)
)
ihr <- 0.1 # Infection-hospitalisation ratio
# Calculate expected numbers with convolution:
hosp <- new_cases * ihr
hospitalizations <- convolve(hosp, rev(density(onset_to_admission,0:50)), type = "open")[1:length(hosp)]
discharges <- convolve(hospitalizations, rev(density(admission_to_discharge,0:50)), type = "open")[1:length(hospitalizations)]
in_hospital <- cumsum(hospitalizations) - cumsum(discharges)
plot(new_cases,type="l",ylim=c(0,30))
lines(as.numeric(hospitalizations),col="red")
lines(as.numeric(in_hospital),col="blue") |
Also, would need to tweak the hard coded |
It would be useful to have an episode illustrating how new infections in {epidemics} translate into hospitalisations and stock-and-flow issues with hospital capacity (i.e. people can remain in a bed for multiple days. Key learning objectives could include how models of transmission can be separated from models of burden if hospitalised cases contribute little to transmission (as well as mentioning where this assumption breaks down, e.g. Ebola).
Could also cover difference between age distribution of infections vs severe disease, and delayed outcomes (linking with this howto: https://epiverse-trace.github.io/howto/analyses/reconstruct_transmission/estimate_infections.html)
Could also be nice opportunity to show how to get parameters in/out of epiparameter.
Some rough illustrative code:
The text was updated successfully, but these errors were encountered: