This code replicates Figure 6 in Berger, Herkenhoff, Mongey (2020) - *An SEIR Infectious Disease Model with Testing and Conditional Quarantine".
To replicate this figure for a number of different rates of testing $\left(\tau\right)$ follow these instructions:
Below we describe other parameters. To change other parameters refresh this page in your browser. Repeat the above and then before pressing [Run model], choose alternative values for model parameters.
To download the underlying code, please follow the link to 'Download underlying model files' at http://www.simonmongey.com, or alternatively access the files at http://www.github.com/simonmongey/covidtesting. This code can be ran, more quickly and offline using Jupyter Notebook
The first set appear in Table 4 of the paper, and below are divided into three blocks
The second set appear in Tables 5 and 6 of the paper, these are the very simply 'policy parameters' $\tau\geq 0$ and $\Delta\in[0,1]$ which represent the rate of daily testing and the slackening of quarantine measures that we use to construct our counterfactual.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# INSTRUCTIONS: Click to place cursor in this box, and then press Ctrl+Enter
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
from IPython.display import Javascript
Javascript("Jupyter.notebook.execute_cells([3,4,5,6])")
from model_code import *
from jupyterWidgets import *
# Toggle on/off the raw code
from IPython.display import HTML
HTML('''<script>
code_show=true;
function code_toggle() {
if (code_show){
$('div.input').hide();
} else {
$('div.input').show();
}
code_show = !code_show
}
$( document ).ready(code_toggle);
</script>
<form action="javascript:code_toggle()"><input type="submit" value="Click here to switch on/off the raw code"></form>''')
display(paramsPanel)
display(run_box)
τ_list = np.arange(0., τ_max.value + τ_step.value, τ_step.value)
Δ_list = np.arange(Δ_min.value, 1. + Δ_step.value, Δ_step.value)
if slide_var.value == 1:
f = generate_plots(Δ.value, τ_list, ξ_base.value, A_rel.value, d_vaccine.value*14+3*14, \
rel_ρ.value, δ_param.value, ωR_param.value, π_D.value, \
R_0.value, rel_λ.value, initial_infect.value, slide_var.value)
elif slide_var.value == 2:
f = generate_plots(Δ_list, τ.value, ξ_base.value, A_rel.value, d_vaccine.value*14+3*14, \
rel_ρ.value, δ_param.value, ωR_param.value, π_D.value, \
R_0.value, rel_λ.value, initial_infect.value, slide_var.value)
print("Done solving model.")
f