Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Models infectious disease spread with SIR and SEIR compartmental models, R0 estimation, outbreak simulation, and intervention analysis.
95% 100%+5 ptsof test cases passed
Passed 22 of 22 test cases with the skill, and 21 of 22 without it.
3 of 3 safety checks passed
Not used yet
Epidemiological disease modeling with compartmental models (SIR, SEIR), R0 estimation, outbreak simulation, incidence/prevalence forecasting, and intervention impact analysis. Covers the core ODE-based approach used in public health and infectious disease research.
uv pip install scipy numpy matplotlib
import numpy as np
from scipy.integrate import solve_ivp
def sir(t, y, beta, gamma):
S, I, R = y
dS = -beta * S * I
dI = beta * S * I - gamma * I
dR = gamma * I
return [dS, dI, dR]
beta, gamma = 0.3, 0.1
R0 = beta / gamma
print(f"R0 = {R0:.2f}")
sol = solve_ivp(sir, [0, 160], [0.99, 0.01, 0], args=(beta, gamma), dense_output=True)
def seir(t, y, beta, sigma, gamma):
S, E, I, R = y
dS = -beta * S * I
dE = beta * S * I - sigma * E
dI = sigma * E - gamma * I
dR = gamma * I
return [dS, dE, dI, dR]
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.