Lesson Video

🚗 Video too fast or too slow? Click the gear icon ⚙️ at the bottom-right to change the speed!

Click here to view and download this video from Vimeo.

Lesson code

Please download the R Markdown script linked below to code along with the instructor.

You need to click the download button on the top right menu.

Lesson Notes


Lesson Slides


👋 Before you go, leave an anonymous rating & feedback

Average rating 4 / 5. Vote count: 4

No votes so far! Be the first to rate this post.

Please share any positive or negative feedback you may have.

Feedback is completely anonymous

4 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
Alaric

For Exercise 4, the solution does not match the prompt:

The prompt asks for a model seir_vital_dynamics and the model diagram includes an exposed population with a sigma disease progression parameter.

The solution function describes an SIR model without an exposed population.

Alaric

FYI in section 1.3.1 Step 1: Setting Initial Conditions and Parameters the parameters in the text and the given parameters in the code block do not match. The code block seems to give the correct values to match the plot.

Here is what the text says
We begin by defining the initial conditions and parameters for the model:

  • Total population (N): 100
  • Initial susceptible (S): 99
  • Initial infected (I): 1
  • Initial recovered (R): 0
  • Transmission rate (β): 0.1
  • Recovery rate (γ): 0.014
  • Natural birth/death rate (μ): 0.01
  • Time span: 400 days

Here is what the code block says
# Define initial conditions
initial_state <- c(S = 99, I = 1, R = 0)

# Define parameters including birth and death rate
parameters <- c(beta = 0.002, # Transmission rate
        gamma = 0.1,  # Recovery rate
        mu = 0.02)   # Natural Birth/Death rate

# Time span for simulation
times <- seq(0, 400, by = 1)

EKUMBO

In the third exercise (using the SIR model simulator, investigate how different values of Alpha: infection-induced mortality rate, impact the dynamics of the disease. ), I used also in Studio R, the same data used in the simulator, I don’t know why I don’t find the same result with the simulator. There is some explanation ? ::: practice **Exercise 3** Using the SIR model simulator, investigate how different values of $\alpha$ (infection-induced death rate) impact the disease dynamics. Use the following parameters: –  Initial population: 100 (with 99 susceptible, 1 infected, and 0 recovered) –  Transmission rate ($\beta$): 0.1 –  Recovery rate ($\gamma$): 0.014 –  Birth/death rate ($\mu$): 0.01 –  Infection-Induced death rate ($\alpha$): 0.01 –  Transmission Type: Frequency Dependent Vary $\alpha$ from 0.01 to 0.05 in increments of 0.01. ::: ##### Step 1: Defining Initial Conditions and Parameters SIR model simulator {r} <pre class="ql-syntax" spellcheck="false">initial_state <- c (S = 99, I = 1, R = 0) N <- 100 parameters <- c(beta = 0.1,         gamma = 0.014,         mu = 0.01,         alpha = 0.01) </pre> ##### Step 2: Writing the SI Model Function with Infection-Induced Deaths {r} <pre class="ql-syntax" spellcheck="false">sir_model_infections_deaths <- function(times, states, parameters) {with(as.list(c(states, parameters)),{    dS = (-beta * S * I )/N    dI = (beta * S… Read more »

4
0
Questions or comments?x