Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Compartmental Models

ASecurity

Infectious disease modeling with SIR/SEIR models — R0, fitting, forecasting, and intervention scenarios.

2 stars
0 votes
0 copies
0 views
Added 9/29/2026
ai-agentspythongotesting

Works with

cli

Security Analysis

A100/100

Scanned 9/29/2026

$npx -y skills add aicodedecode/awesome-muse-skills --skill compartmental-models --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Compartmental Models?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Compartmental Models
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/aicodedecode-compartmental-models/badge)](https://www.skillsdirectory.com/skills/aicodedecode-compartmental-models)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: compartmental-models
description: Infectious disease modeling with SIR/SEIR models — R0, fitting, forecasting, and intervention scenarios.
category: scientific
---

## Overview

compartmental-models covers the workhorse models of infectious-disease dynamics: SIR, SEIR, and
their extensions. It focuses on building models that inform decisions — estimating R0, projecting
under interventions, and communicating uncertainty — rather than on mathematical novelty. A model
is a decision tool; its value is measured in better decisions, not in fit statistics.

## When to use

- Estimating R0/Rt from early outbreak data.
- Projecting epidemic trajectories under different intervention scenarios.
- Evaluating interventions: vaccination coverage, NPIs, test-and-trace.
- Understanding herd-immunity thresholds and final-size relations.
- Fitting models to case/hospitalization data with proper uncertainty.
- Communicating model results and limits to decision-makers.

## Core concepts

- **SIR structure.** Susceptible → Infectious → Recovered, with transmission rate β and recovery
  rate γ. dS/dt = −βSI/N, dI/dt = βSI/N − γI, dR/dt = γI. Simple, interpretable, and the
  foundation everything else extends.
- **SEIR and extensions.** Add Exposed (latent period) for SEIR; add compartments for
  asymptomatic (A), hospitalized (H), quarantined (Q), vaccinated (V), or waning immunity
  (SIRS) as the question demands. Every compartment needs a justification — complexity must
  earn its keep in better decisions.
- **R0, Re, Rt.** R0 = β/γ: expected secondary cases in a fully susceptible population. Re/Rt:
  effective reproduction number given immunity and interventions. Rt > 1 means growing. Estimate
  from the early exponential growth rate (r) via the generation-interval distribution — R0 ≈
  1 + r×Tg for simple models, but use the proper estimator (EpiEstim/cori for Rt).
- **Herd immunity threshold.** 1 − 1/R0 — the immune fraction at which Re < 1 without
  interventions. It's a threshold for decline, not eradication, and it assumes homogeneous
  mixing — heterogeneity (superspreading, structured contacts) changes it substantially.
- **Homogeneous mixing is the big lie.** Real populations have age structure, households,
  networks, and superspreading. Age-structured contact matrices (POLYMOD-style) are the minimum
  realism for policy models; overdispersion (k parameter) matters for outbreak probability and
  control strategy.
- **Fitting.** Fit to the most reliable data stream (hospitalizations/deaths over cases, which
  depend on testing). Use Bayesian inference (MCMC) or likelihood-based methods with proper
  observation models (negative binomial for overdispersed counts, reporting delays modeled
  explicitly). Fit to multiple streams jointly when possible.
- **Forecasting discipline.** Short-term forecasts (1-4 weeks) with quantified uncertainty
  (prediction intervals, ensemble approaches); scenario projections (not predictions) for
  policy — "if X, then Y" with X explicit. Evaluate past forecasts honestly (coverage of
  prediction intervals).
- **Intervention modeling.** Vaccination (reduce susceptibility/infectiousness by coverage ×
  efficacy), NPIs (reduce β or contacts), test-trace-isolate (reduce infectious period or
  remove infecteds). Model the intervention as actually implementable — 100% compliance
  scenarios are fantasies.

## Practical workflow

1. **Question.** What decision does this model inform? (Not "model the epidemic" — a specific
   choice with options.)
2. **Structure.** Simplest model that captures the decision-relevant mechanism; justify each
   compartment.
3. **Parameters.** Literature values with sources and ranges; estimate the rest from data;
   document every number.
4. **Fit.** Bayesian/MCMC with observation model; check convergence, posterior predictive fits,
   and sensitivity to priors.
5. **Scenarios.** Baseline + intervention options with explicit assumptions; present as ranges
   across parameter uncertainty, not point trajectories.
6. **Validate.** Backtest on held-out periods; compare against simple baselines (a naive model
   that beats your SIR is telling you something).
7. **Communicate.** Assumptions up front, uncertainty as intervals, scenarios labeled as
   scenarios. Never present a single trajectory as "the prediction."

Example (Python sketch):
```python
from scipy.integrate import odeint
def seir(y, t, N, beta, sigma, gamma):
    S, E, I, R = y
    return [-beta*S*I/N, beta*S*I/N - sigma*E, sigma*E - gamma*I, gamma*I]
```

## Common pitfalls

- Fitting to case counts without modeling testing/reporting changes.
- Ignoring reporting delays (recent data are always incomplete — nowcasting needed).
- Homogeneous-mixing models for policy without age/behavior structure.
- Presenting scenarios as predictions.
- Overconfident narrow intervals (models are usually overconfident — widen honestly).
- Parameters from a different pathogen/population without adjustment.
- No validation against held-out data or simple baselines.

Attribution

aicodedecodeaicodedecode
View sourceSee grades on GitHubMore from aicodedecode →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698621 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →