agentleFS
Scientific-ToolingScientific-Tooling/structured-intelligence/skills/stat-bayesian-estimation/SKILL.md

stat-bayesian-estimation

Skill4 starsChanged 12 days agoMITView on GitHub

Estimate model parameters using Bayesian inference (MCMC via Stan or PyMC), returning posterior distributions and credible intervals.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use cases: dose-response modeling, population parameter estimation, hierarchical biological models

    line 13
  2. Distinctive:

    Read data; validate response and predictor columns.

    line 30
  3. Distinctive:

    Run MCMC sampling with the specified backend (PyMC or Stan).

    line 32
  4. Distinctive:

    Check convergence: R-hat statistic (should be < 1.01 for all parameters), effective sample size (ESS > 400).

    line 33
  5. Distinctive:

    Write posterior summary (TSV), trace plots (PDF), and posterior plots (PDF) to output directory.

    line 38

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Skill: Bayesian Parameter Estimation

Use When

  • User wants to estimate parameters with full uncertainty quantification via posterior distributions
  • User wants to incorporate prior knowledge about parameters
  • User needs credible intervals instead of frequentist confidence intervals
  • Use cases: dose-response modeling, population parameter estimation, hierarchical biological models

Inputs

  • Required:
    • Data table (CSV or TSV) with observed values
    • Model specification: response variable, predictor variables, model family (normal, poisson, binomial)
  • Optional:
    • Prior distributions for each parameter (default: weakly informative priors — normal(0, 10) for coefficients)
    • Number of MCMC chains (default: 4)
    • Number of samples per chain (default: 2000, warmup: 1000)
    • Target acceptance rate (default: 0.8)
    • Backend: pymc (default) or stan
    • Output directory (default: ./bayes_output)

Workflow

  1. Read data; validate response and predictor columns.
  2. Set up Bayesian model with specified family and prior distributions.
  3. Run MCMC sampling with the specified backend (PyMC or Stan).
  4. Check convergence: R-hat statistic (should be < 1.01 for all parameters), effective sample size (ESS > 400).
  5. Extract posterior samples; compute posterior mean, median, standard deviation, and 94% credible interval (HDI) for each parameter.
  6. Generate trace plots (one per parameter) to visually assess convergence.
  7. Generate posterior distribution plots (one per parameter).
  8. Generate posterior predictive check plot (observed vs. simulated data).
  9. Write posterior summary (TSV), trace plots (PDF), and posterior plots (PDF) to output directory.
  10. Report convergence diagnostics; flag any parameters with R-hat ≥ 1.01 or ESS < 400.
  11. Save the executable analysis script (analysis_code.py or analysis_code.R) and software version manifest (session_info.txt) used to produce results.

Output Contract

  • Posterior summary table (TSV): parameter, mean, sd, median, hdi_lower_94, hdi_upper_94, r_hat, ess_bulk, ess_tail
  • Trace plots (PDF)
  • Posterior distribution plots (PDF)
  • Posterior predictive check plot (PDF)
  • Convergence warnings (printed to stdout if any)
  • Reproducibility artifacts: analysis_code.py or analysis_code.R, plus session_info.txt

Limits

  • Requires PyMC or CmdStanPy to be installed; check environment before running.
  • MCMC can be slow for complex models or large datasets; variational inference (ADVI) is faster but approximate.
  • Weakly informative default priors may be inappropriate for constrained parameters (e.g., probabilities must be [0,1]) — specify priors explicitly when needed.
  • R-hat ≥ 1.01 indicates non-convergence; increase warmup or reparameterize model.
  • Common failure: identifiability issues (collinear predictors) causing MCMC to fail to mix.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.