theory-simulation

theory-simulation is a skill for Claude Code from gyf9712/stat-theory-skills. It costs 214 tokens per session (12,046 once invoked), scanned A, original, MIT.

A workflow for connecting mathematical theory with Monte Carlo simulation, which repeatedly generates data to test how methods behave.

In plain words
What is it for?
It designs simulations, checks rates and coverage, stress-tests assumptions, compares finite-sample results with long-run theory, and prepares publication-style figures.
Why use it?
It helps determine whether theoretical claims hold in realistic sample sizes and reveals assumptions or weaknesses that formulas alone may hide.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: model in frontmatter; mentions Codex.

Good fit It designs simulations, checks rates and coverage, stress-tests assumptions, compares finite-sample results with long-run theory, and prepares publication-style figures.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/gyf9712/stat-theory-skills/theory-simulation
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add gyf9712/stat-theory-skills --skill theory-simulation
Clone the repo
git clone --depth 1 https://github.com/gyf9712/stat-theory-skills

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for theory-simulation

README.md
[![agentmods](https://agentmods.dev/badge/skills/gyf9712/stat-theory-skills/theory-simulation/github.svg)](https://agentmods.dev/skills/gyf9712/stat-theory-skills/theory-simulation)
Your own site
<a href="https://agentmods.dev/skills/gyf9712/stat-theory-skills/theory-simulation"><img src="https://agentmods.dev/badge/skills/gyf9712/stat-theory-skills/theory-simulation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for theory-simulation

Your own site · 80×15
<a href="https://agentmods.dev/skills/gyf9712/stat-theory-skills/theory-simulation"><img src="https://agentmods.dev/badge/skills/gyf9712/stat-theory-skills/theory-simulation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 214 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 12,046 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00214 $0.12046
Opus 5 $0.00107 $0.06023
Sonnet 5 $0.00043 $0.02409
Haiku 4.5 $0.00021 $0.01205

Measured 11d ago against content hash 398eede7fbb1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

theory-simulation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/theory-simulation/SKILL.md · 1,015 lines

How it starts

The opening of the file, as written. The whole thing — 1,015 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Theory-Simulation — Bridge Theory and Monte Carlo for Statistics Papers

🔬 Model Recommendation: Run this skill on Claude Opus for best results. Designing rate-verifying experiments and reconciling theory with empirical results requires deep reasoning. If your session is not on Opus, run /model opus.

Bridges theoretical results and simulation experiments, two-way:

Theory ←————— stress tests, rate slopes ——————→ Simulation
       ←————— sharper bounds, weakened —————→
              assumptions discovered from sim

Built to top statistics journal standards: clearly stated DGPs, multiple sample sizes, Monte Carlo replications, rate verification via log-log slopes, stress tests on every assumption, finite-sample vs asymptotic comparisons, and publication-grade figures conforming to AoS / JASA / Biometrika / JRSS-B style.

Context: $ARGUMENTS


Pipeline Position

/proofcheck → /proof-repair → /theory-sharpen → /theory-simulation → /proof-writer
   Correct?     Fix issues       Strengthen theory      Verify + stress         Write proofs
                                                        (this skill)

This skill can also run standalone if user has theorems and wants Monte Carlo verification without a full pipeline.


Core Philosophy

A theoretical result is taken seriously by reviewers when simulation:

  1. Confirms the predicted rate/coverage/bias under stated assumptions
  2. Breaks in the predicted way when assumptions are violated
  3. Quantifies the finite-sample regime where asymptotics kick in
  4. Reveals improvements (sharper rates, weaker assumptions) for theory iteration

A simulation is taken seriously by reviewers when it has:

  • Reproducible DGPs with hierarchical RNG streams (not just a single seed)
  • Multiple cells along the asymptotic path the theory uses (e.g., s log d / n fixed, NOT just "multiple n and d")
  • MCSE-driven replication count for each metric (NOT a fixed B threshold)
  • Honest stress tests, including least-favorable DGPs matched to the theorem
  • Inference diagnostics beyond rate: size, local power, interval length, EmpSE vs ModSE calibration
  • Publication-grade figures with MC uncertainty shown
  • Paired-replicate baseline comparison (all methods on the same synthetic data)
  • Failure handling: nonconvergence, singular Hessian, optimizer stalls all logged and reported per cell

Read the full file on GitHub · 1,015 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 1,015 lines · 214 tokens per session scan A 398eede7fbb1

Subscribe to this mod's changes

theory-simulation is a skill published in the GitHub repository gyf9712/stat-theory-skills (9 stars, last pushed 1mo ago), licensed MIT. It adds 214 tokens to every session and 12,046 once invoked, about $0.0011 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

did

Design, estimate, validate, and write up a difference-in-differences analysis, using the post-2018 heterogeneity-robust toolkit with an explicit statement of which parallel-trends assumption is imposed. TRIGGER on "difference-in-differences", "DiD", "TWFE", "event study", "staggered adoption", "parallel trends"…

ericluo04/claude-academic-workflow · 0 tokens

iv

Design, estimate, validate, and write up an instrumental-variables analysis: single-instrument LATE designs, weak-instrument-robust inference, shift-share instruments, formula instruments that need recentering, and leniency (judge and examiner) designs estimated by UJIVE. TRIGGER on "instrumental variable", "IV"…

ericluo04/claude-academic-workflow · 0 tokens

conjoint

Design, analyze, and write up conjoint experiments in both traditions: as randomized experiments identifying average marginal component effects, and as preference-measurement instruments (hierarchical Bayes partworths, WTP, choice-share simulation), with measurement-error correction, multiple-testing correction, and a…

ericluo04/claude-academic-workflow · 0 tokens

research-talk

Author a Quarto reveal.js deck for a research talk: seminar, conference, job talk, brown bag. TRIGGER on "slides for my talk", "seminar deck", "job talk", "turn this paper into slides", "add an appendix slide", "export a handout". Classroom material is teaching-lecture; auditing an existing deck is slide-review.

ericluo04/claude-academic-workflow · 0 tokens

field-experiment

Design, analyze, and write up randomized experiments (field experiments, A/B tests, RCTs): stratified and clustered designs, randomization inference, covariate adjustment done right, noncompliance, attrition and gated outcomes, treatment-effect heterogeneity, and interference. TRIGGER on "A/B test", "randomized…

ericluo04/claude-academic-workflow · 0 tokens

rdd

Design, estimate, validate, and write up a regression discontinuity analysis, in both the continuity and local-randomization frameworks, with the full falsification battery and a refusal rule for designs that fail validation. TRIGGER on "regression discontinuity", "RDD", "running variable", "cutoff", "rdrobust"…

ericluo04/claude-academic-workflow · 130 tokens