Skip to main content

๐Ÿค– 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.


๐Ÿ“Œ Prompting Rules (Hackathon Ground Rules)

  1. Always specify units (biweeks, not days)
  2. Always state what the data represent (case counts vs model states)
  3. One task per prompt
  4. Always ask for plots
  5. Always ask for sanity checks
  6. Iterate in small steps
  7. 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! ๐Ÿš€