Skip to content

[sir_model] Some suggestions on code and wording #1049

Description

@longye-tian

Hi @jstac

I was reading through the sir_model lecture and noted some possible updates.

Overview and model description

  • Change both occurrences of “Modeling COVID 19” to “Modeling COVID-19,” including the index entry to make them consistent with the main text and also consistent with Wikipidea.

  • update the “COVID-19 Working papers and code” link to https://sites.google.com/site/andyatkeson/home/covid-work, currently, this link goes to the personal website of Andrew Atkeson instead of this paper and code.

  • update the four-state model as an SEIR (Susceptible-Exposed-Infected-Removed) model rather than an SIR model. In this lecture, we uses 4 state instead of three states as the name SIR suggested.

  • [qe-writing-006] Use sentence case for the lower-level headings at lectures/sir_model.md:68,82,236,284,347:

    • The SEIR model
    • Time path
    • Experiment 1: constant R0 case
    • Experiment 2: changing mitigation
    • Ending lockdown

State definitions and assumptions

  • At line 74, we could update the compartment symbols in math delimiters: susceptible ($S$), exposed ($E$), infected ($I$), and removed ($R$). Currently, we have (R) for the removed ones and markdown rendered this as a trademark ®.

  • At line 76-80, replace the “Comments:” label with a prf:assumption environment since they are all assumptions used later in this lecture:

```{prf:assumption}
- Those in state $R$ were previously infected and have either recovered or died.
- Those who have recovered are assumed to have acquired immunity.
- Those in the exposed group are not yet infectious.
```

Time path and parameters

  • At line 86-87, replace the claim that positive transmission and $i(0)>0$ imply everyone is eventually infected as this is not true in this model And we didn't introduce the meaning of $i$ yet. Suggested text:

    When the effective reproduction number exceeds one, infections initially increase but eventually decline as the susceptible population falls.

  • Apply the following small prose corrections at line 91,94,112,114,131:

    • Change “lower case” to “lowercase.”
    • Add the missing period to the $\sigma$ definition.
    • Capitalize “The dot symbol.” as it is a beginning of a new sentence.
    • Write “for a suitable definition of $F$.” by adding the missing article "a"
  • [qe-math-001] At line 103, 105 , replace the raw Unicode symbols inside the math directive with \sigma and \gamma.

  • At line 113, call $\gamma$ the removal rate, since the transition includes both recovery and death. Currently it is calle d recovery rate which doesn't reflect that this also include dealth.

Implementation

  • At line 192-199, explain the initial-condition calibration. With a population of 330 million, $i_0=10^{-7}$ represents 33 initially infected people, $e_0=4i_0$ represents 132 exposed people, and $s_0=1-i_0-e_0$ sets the initial removed fraction to zero. This makes the calibrated number economically meaningful.

  • At line 207, format odeint as inline code.

Experiments and figures

  • At line 244, render the zero in the legend variable as a subscript:

    labels = [f'$R_0 = {r:.2f}$' for r in R0_vals]
  • [qe-fig-008] At line 261,317, add lw=2 to the line plots.

  • At line 256-265,313-320, add axis labels and units so that reader can know the unit of the plot. The shared plot_paths helper could accept a y-axis label, while all relevant plots use days on the x-axis. Quantity-specific y-axis labels should distinguish:

    • current cases as a fraction of the population;
    • cumulative cases as a fraction of the population;
    • active infections as a fraction of the population;
    • cumulative deaths;
    • deaths per day.

    The standalone mitigation plot should use $R_0$ on the y-axis.

  • At line 301-309, explain that $\eta$ is measured per day because $t$ is measured in days. Its reciprocal is the characteristic adjustment period, so the specified values correspond to adjustment periods of 5, 10, 20, 50, and 100 days.

  • After line 345, add some economic interpretation, currently it finishes with the plot.

    Faster implementation of mitigation mainly delays the infection peak, with a smaller effect on its height.

Ending lockdown and mortality

  • At line 383, describe the plotted quantity as a fraction rather than a number:

    Here is the fraction of the population with an active infection:

  • After the active-infections plot at line 386, add some economic interpretation.

    Both scenarios produce approximately the same infection peak, but the longer lockdown delays it.

  • At line 391, add the missing period after “Suppose that 1% of cases result in death.”

  • At line 397-401, correct the cumulative-deaths calculation. Since $c(t)=i(t)+r(t)$, the current calculation counts a fraction of active infections as deaths and begins with 250 cumulative deaths even though the initial removed fraction is zero. Cumulative deaths should be $\nu r(t)N=\nu[c(t)-i(t)]N$:

    paths = [(c_path - i_path) * ν * pop_size
             for c_path, i_path in zip(c_paths, i_paths)]

    This is consistent with the daily-deaths formula $\nu\gamma i(t)N$. Label the y-axis cumulative deaths.

  • At line 404-408, change the introduction to:

    This is the number of deaths per day:

instead of using daily death rate as the following plot has y-axis as the number of death per day as unit and keep the existing calculation and label the y-axis deaths per day.

  • At line 411, write “the peak of the curve.”

What do you think? I'd be grateful if you could take a look when you have a chance.
Happy to put up a PR.

Best,
Longye

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions