๐ค ChatGPT Prompt Collection
AI-Guided SIR Modeling Hackathon
This document contains curated ChatGPT prompts for the
AI-Guided SIR Modeling Hackathon.
It is designed to teach participants how to work with ChatGPT as a scientific coding co-pilot, not as a black box.
๐ง Why Prompt Structure Matters
In this hackathon, ChatGPT is used to:
- Generate scientific Python code
- Explain epidemiological concepts
- Assist with debugging and inference
- Help write clear summaries
Poorly structured prompts often lead to:
- Wrong assumptions (units, data meaning)
- Silent modeling errors
- Overconfident but incorrect explanations
Good prompts dramatically reduce these risks.
โญ Core Prompt Template (RECOMMENDED)
Use this template for all scientific prompts during the hackathon.
๐น Core Prompt Template
Persona:
You are an expert epidemiological modeler and Python educator.
Context:
- Dataset: biweekly measles case counts from Niamey, Niger
- Columns: biweek, community, measles
- Data represent: observed case counts (incidence)
- Time unit: biweeks
- Infectious period โ 2 weeks (gamma โ 1 per biweek)
Task:
[Describe ONE specific task clearly and precisely]
Constraints:
- Use Python compatible with Google Colab
- Allowed libraries: numpy, scipy, pandas, matplotlib
- Keep code minimal, readable, and well commented
- Do not rewrite unrelated code
Verification:
- Include at least one plot
- Include at least one sanity check
- Explain assumptions clearly
Output style:
- Step-by-step explanation
- Code blocks clearly separated
- Avoid unnecessary verbosity
๐ Prompting Rules (Hackathon Ground Rules)
- Always specify units (biweeks, not days)
- Always state what the data represent (case counts vs model states)
- One task per prompt
- Always ask for plots
- Always ask for sanity checks
- Iterate in small steps
- Treat ChatGPT as an assistant, not an authority
๐งฉ Task-Specific Prompts
All prompts below are instances of the Core Prompt Template.
๐งช Prompt 1 โ Load and Explore the Data
Persona:
You are an expert epidemiological modeler and Python educator.
Context:
- Dataset contains biweekly measles case counts from Niamey, Niger
- Columns: biweek, community, measles
Task:
Write Python code to:
1. Load the CSV file
2. Plot measles cases over time for each community (A, B, C)
3. Briefly explain what biweekly case counts mean for modeling
Constraints:
- Use pandas and matplotlib
- Google Colab compatible
Verification:
- One time-series plot with labeled axes and legend
๐งฌ Prompt 2 โ Implement the SIR Model (Biweekly Units)
Persona:
You are an expert epidemiological modeler.
Context:
- Closed SIR model
- Time unit: biweeks
- Infectious period โ 2 weeks (gamma โ 1 per biweek)
Task:
Implement an SIR model using SciPy ODE solving and plot S, I, R.
Constraints:
- Use scipy.integrate
- Comment each equation
Verification:
- Plot S, I, R
- Verify S + I + R โ N at all times
๐ Prompt 3 โ Feature-Based Rโ Estimation (Early Growth)
Persona:
You are an expert in infectious disease modeling.
Context:
- Community A measles outbreak
- Biweekly case counts
- Early outbreak phase shows exponential growth
Task:
Estimate early exponential growth by:
1. Selecting an early biweek window
2. Fitting log(measles) vs time
3. Plotting the semi-log data and fitted line
4. Converting slope to R0 assuming gamma = 1 per biweek
Constraints:
- Use numpy or scipy
- Explain assumptions clearly
Verification:
- Semi-log plot
- Printed slope and R0 estimate
๐ Prompt 4 โ Incidence Mapping via Accumulator H(t)
Persona:
You are an expert epidemic modeler.
Context:
- Observed data are biweekly case counts (incidence)
- SIR model outputs state variables
Task:
Extend the SIR model by:
- Adding an accumulator H(t) with dH/dt = beta * S * I / N
- Computing predicted biweekly cases as ฮH
- Aligning ฮH with observed biweeks
Constraints:
- Keep implementation minimal and readable
Verification:
- Plot ฮH over time
- Explain why ฮH matches the data structure
๐ Prompt 5 โ Least Squares Parameter Fitting
Persona:
You are an expert in numerical optimization.
Context:
- Observed data: biweekly case counts
- Model output: predicted ฮH
Task:
Fit beta (and optionally initial conditions) using least squares.
Constraints:
- Use scipy.optimize
- Use sensible initial values from early-growth estimates
Verification:
- Overlay plot of observed vs fitted cases
- Print best-fit parameter values
๐ฏ Prompt 6 โ Poisson Likelihood Inference
Persona:
You are an expert in statistical inference for epidemic models.
Context:
- Observed data are count data
- Poisson noise is appropriate
- ฮผ_t = rho * ฮH_t (rho = reporting probability)
Task:
Implement maximum likelihood estimation assuming:
y_t ~ Poisson(ฮผ_t)
Constraints:
- Use parameter transforms (log for beta, logit for rho)
- Explain why transforms are needed
Verification:
- Plot observed vs expected counts
- Print estimated parameters
๐ Prompt 7 โ Profile Likelihood (Uncertainty)
Persona:
You are an expert in likelihood-based inference.
Context:
- Poisson likelihood already implemented
Task:
Create a profile likelihood for beta by:
1. Fixing beta over a grid
2. Re-optimizing remaining parameters
3. Plotting profile log-likelihood
4. Indicating an approximate 95% confidence interval
Constraints:
- Keep computation lightweight
Verification:
- Profile likelihood plot
- Explanation of uncertainty interpretation
๐งพ Prompt 8 โ Generate a Markdown Summary
Persona:
You are preparing a short scientific report for hackathon participants.
Task:
Write a Markdown-formatted summary covering:
- Model description
- Parameter estimates and R0
- Comparison of least squares vs Poisson inference
- Interpretation of uncertainty
- Suggested next steps (SEIR, time-varying beta)
Constraints:
- Scientific but accessible language
- Use Markdown headers and bullet points
Verification:
- Clean Markdown output suitable for a notebook cell
๐ซ Bad Prompt vs โ Good Prompt
Learning How to Talk to ChatGPT
Example 1 โ Missing Context & Units
๐ซ Bad Prompt
Help me fit an SIR model to this data.
Problems
- No units
- No data meaning
- Incorrect assumptions likely
โ Good Prompt
Persona:
You are an expert epidemiological modeler and Python educator.
Context:
- Dataset: biweekly measles case counts from Niamey, Niger
- Data represent incidence
- Time unit: biweeks
Task:
Fit an SIR model using Poisson likelihood.
Verification:
- Plot observed vs fitted cases
Example 2 โ Too Many Tasks at Once
๐ซ Bad Prompt
Build an SIR model, fit it, explain R0, and say if the outbreak is controlled.
โ Good Prompt
Task:
Implement and simulate the SIR model only.
โก๏ธ Follow with a second prompt for inference.
Example 3 โ No Verification
๐ซ Bad Prompt
Estimate beta and gamma.
โ Good Prompt
Task:
Estimate beta using Poisson likelihood.
Verification:
- Plot observed vs expected counts
- Print log-likelihood
Example 4 โ Treating ChatGPT as an Oracle
๐ซ Bad Prompt
Is this model correct?
โ Good Prompt
Task:
Critically review the model assumptions and list weaknesses.
๐ง Final Takeaways
- ChatGPT is a co-pilot, not a decision-maker
- You control:
- Assumptions
- Units
- Validation
- Good prompts โ good science
- Bad prompts โ confident nonsense
Happy hacking! ๐