# Packages for model
import sim.sim_replicate as sim
from sim.parameters import Scenario
# Additional package to record runtime of this notebook
import time
= time.time() start
Reproducing Allen et al. 2020
This notebook runs the simulation model and reproduces the three figures from the original study.
Please refer to the README.md file for further description of the model, set-up and reproduction.
Running the model
Import required packages.
Set parameters for simulation.
# Scenario
= {}
scenarios 'base_3_month'] = Scenario(
scenarios[=150,
run_length=0.6)
proportion_pos_requiring_inpatient
# Number of replications
= 30
number_of_replications
# Base number for creation of random number sets
= 2700 base_random_set
Run simulation. In the order that these appear, these figures are the attempted reproductions of Figure 2, 3 and 4 respectively from the paper.
# Run the simulation
sim.run_replications( scenarios, number_of_replications, base_random_set)
Running 30 reps of base_3_month => 0, 1, 3, 12, 13, 6, 15, 4, 5, 11, 7, 8, 14, 16, 10, 9, 2, 18, 19, 17, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, Done.
# Find run time in seconds
= time.time()
end = round(end-start)
runtime
# Display converted to minutes and seconds
print(f'Notebook run time: {runtime//60}m {runtime%60}s')
Notebook run time: 1m 3s