bayesian-inference
Skill0 starsChanged 2 days agoMITView on GitHub
Bayesian inference in Julia: Turing.jl model design, priors and reparameterisation, MCMC diagnostics, consensus sampling, and variational approximations. Use when a posterior is the deliverable.
In this repository55 other files it gives its agents.
- advanced-optimizationSkill
- bayesian-pinnSkill
- bayesian-ude-workflowSkill
- catalyst-reactionsSkill
- continuum-mechanics-and-rheologySkill
- control-theorySkill
- creating-julia-appSkill
- debugging-toolkitSkill
- differential-equationsSkill
- differentiationSkill
- equation-discoverySkill
- experiment-trackingSkill
- fem-feaSkill
- julia-graph-neural-networksSkill
- julia-languageSkill
- julia-ml-and-dlSkill
- julia-model-deploymentSkill
- julia-paper-implementationSkill
- julia-pro-helpSkill
- julia-pro-modeSkill
- julia-reinforcement-learningSkill
- modeling-toolkitSkill
- neural-pdeSkill
- nonlinear-dynamicsSkill
- numerical-methods-implementationSkill
- package-development-workflowSkill
- performance-tuningSkill
- physical-learning-systemsSkill
- playbook-debugSkill
- playbook-model-validateSkill
- playbook-package-releaseSkill
- playbook-paper-implementSkill
- playbook-perfSkill
- playbook-test-specSkill
- principle-both-sidesSkill
- principle-breakingSkill
- principle-file-is-truthSkill
- principle-gateSkill
- principle-limitsSkill
- principle-loud-failureSkill
- principle-one-stepSkill
- principle-proof-listSkill
- principle-rebuttalSkill
- principle-runtime-surfaceSkill
- principle-three-boundsSkill
- principle-three-clocksSkill
- scientific-visualizationSkill
- sciml-and-diffeqSkill
- setup-julia-proSkill
- signal-processingSkill
- simulation-and-hpcSkill
- statistical-physicsSkill
- symbolic-mathSkill
- web-development-juliaSkill
- zarr-cloud-arraysSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
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
- Distinctive: line 19
Write the generative story in words: before the code: what is observed, what is latent, what the prior says about each.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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.
Files
Bayesian inference
The model is a generative story; the sampler is a diagnostic problem. Most "the sampler is broken" cases are a model that is not identified, or a prior that fights the data.
| Task | Page |
| design a Turing.jl model, choose priors, reparameterise | turing-model-design |
| read the diagnostics: R-hat, ESS, divergences, tree depth | mcmc-diagnostics |
| when and how to use variational inference instead | variational-inference-patterns |
| multi-modal posteriors, parallel tempering, consensus | consensus-mcmc-pigeons |
The working order
- Write the generative story in words before the code: what is observed, what is latent, what the prior says about each.
- Simulate from the prior. Draw parameters, generate data, refit. If the fit does not recover the truth, the model or the prior is wrong, and no sampler will fix it.
- Non-centred parameterisation for hierarchical scales. A centred scale parameter and few groups is the classic funnel that produces divergences.
- Sample with four chains, more than you think. Then read R-hat, ESS, divergence count, and tree depth together.
- Posterior predictive check. Simulated data from the posterior must look like the data you have, on the statistic you care about.
Diagnostics that mean something
- Divergences present → the geometry is bad (funnel, unidentifiable pair), not a tuning problem. Increase
adapt_deltaonly to confirm it is geometry. - R-hat > 1.01 → chains disagree; often a multi-modal posterior or a chain stuck in a region.
- Low ESS with high R-hat fix → autocorrelation; thin nothing, sample longer.
- Tree depth at the maximum → the sampler is hitting the limit every iteration; reparameterise.
- Prior and posterior nearly identical → the data say nothing; that is a result, report it.
Traps
- Uniform prior on a scale. It pushes mass to large values; use a half-normal or half-Cauchy with a stated scale.
- Comparing models by marginal likelihood without checking the sampler. Bridge sampling and WAIC disagree for a reason; look at the posterior predictive first.
- Variational inference for a decision. VI underestimates posterior variance; use it for exploration, not for an interval you will publish.
- Ignoring the warm-up. Draws before adaptation are not from the posterior.
Done when
The prior for every scale parameter has a stated scale and a justification (a half-normal on a physical bound, not a flat line to infinity), the sampler was checked on a problem with a known posterior before the real one, every reported interval carries R-hat, ESS, and divergences, and the posterior predictive was compared against held-out data rather than against the training set.
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
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.

