[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EMCZYVQAM6D80K3GK4ZDEW":3,"skill-same:01M7EMCZYVQAM6D80K3GK4ZDEW":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M7EMCZYVQAM6D80K3GK4ZDEW","bayesian-statistics",null,"Bayesian data analysis — priors, likelihoods, posterior computation, model comparison, and honest reporting.","TanNhatCMS\u002Fjarvis","TanNhatCMS","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F113796420?v=4","01M753MV17KG5CD3152G3WQEQY","KietNT","01M7EKEDYVYQ6PWVJJMZ911VMX",0,"MIT","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-bayesian-statistics\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bayesian-statistics\ndescription: Bayesian data analysis — priors, likelihoods, posterior computation, model comparison, and honest reporting.\ncategory: scientific\n---\n\n## Overview\n\nBayesian statistics treats parameters as random variables and updates\nbeliefs with data: posterior ∝ likelihood × prior. This skill covers\nchoosing priors that regularize without dictating, building likelihoods\nthat respect the data-generating process, computing posteriors (MCMC,\nvariational), checking models (posterior predictive checks), and\ncomparing models without fooling yourself.\n\n## When to use\n\n- Estimating parameters with proper uncertainty quantification\n- Incorporating prior knowledge or handling small datasets where priors matter\n- Hierarchical\u002Fmultilevel modeling: partial pooling across groups\n- Comparing models: Bayes factors, LOO-CV, WAIC\n- Reporting Bayesian results so others can interpret and reproduce them\n\n## Core concepts\n\n- **Bayes' theorem:** p(θ|y) ∝ p(y|θ)·p(θ) — the posterior balances what the data say (likelihood) against what was plausible before (prior); with enough data the likelihood dominates.\n- **Priors:** weakly informative (regularize, keep computation stable — the modern default), informative (real prior knowledge — justify and sensitivity-test), and \"noninformative\" (often informative in disguise — check what they imply on the observable scale).\n- **Hierarchical models:** parameters drawn from group-level distributions — partial pooling: groups borrow strength, extreme small-sample estimates shrink toward the mean. The single most useful Bayesian modeling pattern.\n- **Posterior predictive checks:** simulate data from the fitted model and compare with observed data — systematic misfit means the model is wrong, however well it converged.\n- **Model comparison:** LOO-CV\u002FWAIC estimate out-of-sample predictive accuracy; Bayes factors quantify relative evidence but are exquisitely prior-sensitive — report with the priors that produced them.\n- **Decision framing:** point estimates (posterior mean\u002Fmedian), intervals (credible intervals — and HDI vs equal-tailed), and loss functions — match the summary to the decision.\n\n- **Prior predictive checks:** simulate data from the prior alone — if the prior generates absurd data, it's an absurd prior regardless of its mathematical convenience; tune until prior predictions are plausible-but-broad.\n- **The folk theorem of statistical computing:** computational problems often signal model problems — persistent divergences or poor mixing usually mean the model needs reparameterization or better priors, not more iterations.\n- **Bayesian workflow (Gelman):** build → fit → check (posterior predictive) → compare → expand — iteration is the method, not a sign of failure; document the iterations.\n\n## Practical workflow\n\n### 1. Build the model generatively\n\n1. Write the data-generating story first: how would you simulate this data? That story is the model.\n2. Choose the likelihood for the measurement process: counts → Poisson\u002Fnegative-binomial (overdispersion is the norm), proportions → binomial\u002Fbeta-binomial, positive continuous → lognormal\u002FGamma, not Normal-by-default.\n3. Set weakly informative priors on a standardized scale; prior predictive checks (simulate from priors alone) should produce plausible-but-broad data — absurd prior predictions mean absurd priors.\n\n### 2. Fit with MCMC\n\n```python\n# PyMC sketch: hierarchical model with non-centered parameterization\n# mu_j = mu + tau * z_j ; z_j ~ Normal(0,1)   # non-centered: kills funnels\n```\n\n1. Use non-centered parameterizations for hierarchical models — the centered form creates funnels that HMC can't explore.\n2. Run 4+ chains; require R̂ \u003C 1.01, good ESS, zero divergences (see monte-carlo-methods).\n3. If divergences persist: reparameterize first, strengthen priors second, raise adapt_delta last.\n\n### 3. Check the fit\n\n1. **Posterior predictive checks:** overlay replicated datasets on the observed — check means, variances, extremes, and any statistic the science cares about.\n2. **Residual structure:** patterns in residuals vs predictors or time mean missing structure — add it or acknowledge it.\n3. **Sensitivity:** refit with wider\u002Fnarrower priors on key parameters — conclusions that flip are prior-driven, say so.\n\n### 4. Compare and report\n\n1. Compare models with LOO-CV (arviz.compare) — report elpd differences with standard errors, not just rankings.\n2. Report posteriors as distributions (plots + quantiles), not just point estimates; state priors explicitly — a Bayesian result without priors is irreproducible.\n3. Distinguish credible intervals (\"95% probability the parameter is here, given model+prior\") from confidence intervals — and from prediction intervals for new data.\n\n### 5. Build a hierarchical model correctly\n\n1. Write the generative story: population distribution → group parameters → observations — partial pooling is the payoff: noisy small groups borrow strength from the population.\n2. Use the non-centered parameterization (parameters as population mean + scale × standard normal offsets) — the centered form creates funnels that defeat HMC.\n3. Check shrinkage: group estimates should pull toward the population mean proportionally to their uncertainty — no shrinkage means the hierarchy isn't working (or the groups are truly distinct).\n\n### 6. Quick-reference checklist\n\n- [ ] Generative story written before the model\n- [ ] Likelihood matched to the data type (counts, proportions, positive continuous)\n- [ ] Priors weakly informative with prior predictive checks done\n- [ ] Non-centered parameterization for hierarchical models\n- [ ] ≥4 chains, R̂ \u003C 1.01, good ESS, zero divergences\n- [ ] Posterior predictive checks performed and reported\n- [ ] Prior sensitivity tested on key conclusions\n- [ ] Priors stated explicitly in every report\n\n## Common pitfalls\n\n- **Priors chosen by convenience:** default flat priors on transformed scales can be strongly informative — always inspect prior implications.\n- **Likelihood misspecification:** Normal likelihood on skewed\u002Fcount data — the posterior is precisely wrong; match the likelihood to the data type.\n- **Ignoring hierarchical structure:** complete pooling (ignores group differences) vs no pooling (noisy group estimates) — partial pooling dominates both.\n- **Bayes factors without prior sensitivity:** a BF of 100 that becomes 2 under a reasonable prior change is not evidence — it's prior artifact.\n- **Convergence theater:** R̂ \u003C 1.01 on a misspecified model — diagnostics check computation, not correctness; predictive checks check correctness.\n- **Posterior hacking:** trying models until the credible interval excludes zero — preregister the model or report the multiverse.\n- **Centered parameterization of hierarchical models:** the funnel geometry stalls HMC and produces divergences — non-center by default, center only with strong group-level data.\n- **Posterior predictive checks skipped:** a well-converged chain on a misspecified model is precisely wrong — predictive checks are part of fitting, not optional extras.\n","## Overview\n\nBayesian statistics treats parameters as random variables and updates\nbeliefs with data: posterior ∝ likelihood × prior. This skill covers\nchoosing priors that regularize without dictating, building likelihoods\nthat respect the data-generating process, computing posteriors (MCMC,\nvariational), checking models (posterior predictive checks), and\ncomparing models without fooling yourself.\n\n## When to use\n\n- Estimating parameters with proper uncertainty quantification\n- Incorporating prior knowledge or handling small datasets where priors matter\n- Hierarchical\u002Fmultilevel modeling: partial pooling across groups\n- Comparing models: Bayes factors, LOO-CV, WAIC\n- Reporting Bayesian results so others can interpret and reproduce them\n\n## Core concepts\n\n- **Bayes' theorem:** p(θ|y) ∝ p(y|θ)·p(θ) — the posterior balances what the data say (likelihood) against what was plausible before (prior); with enough data the likelihood dominates.\n- **Priors:** weakly informative (regularize, keep computation stable — the modern default), informative (real prior knowledge — justify and sensitivity-test), and \"noninformative\" (often informative in disguise — check what they imply on the observable scale).\n- **Hierarchical models:** parameters drawn from group-level distributions — partial pooling: groups borrow strength, extreme small-sample estimates shrink toward the mean. The single most useful Bayesian modeling pattern.\n- **Posterior predictive checks:** simulate data from the fitted model and compare with observed data — systematic misfit means the model is wrong, however well it converged.\n- **Model comparison:** LOO-CV\u002FWAIC estimate out-of-sample predictive accuracy; Bayes factors quantify relative evidence but are exquisitely prior-sensitive — report with the priors that produced them.\n- **Decision framing:** point estimates (posterior mean\u002Fmedian), intervals (credible intervals — and HDI vs equal-tailed), and loss functions — match the summary to the decision.\n\n- **Prior predictive checks:** simulate data from the prior alone — if the prior generates absurd data, it's an absurd prior regardless of its mathematical convenience; tune until prior predictions are plausible-but-broad.\n- **The folk theorem of statistical computing:** computational problems often signal model problems — persistent divergences or poor mixing usually mean the model needs reparameterization or better priors, not more iterations.\n- **Bayesian workflow (Gelman):** build → fit → check (posterior predictive) → compare → expand — iteration is the method, not a sign of failure; document the iterations.\n\n## Practical workflow\n\n### 1. Build the model generatively\n\n1. Write the data-generating story first: how would you simulate this data? That story is the model.\n2. Choose the likelihood for the measurement process: counts → Poisson\u002Fnegative-binomial (overdispersion is the norm), proportions → binomial\u002Fbeta-binomial, positive continuous → lognormal\u002FGamma, not Normal-by-default.\n3. Set weakly informative priors on a standardized scale; prior predictive checks (simulate from priors alone) should produce plausible-but-broad data — absurd prior predictions mean absurd priors.\n\n### 2. Fit with MCMC\n\n```python\n# PyMC sketch: hierarchical model with non-centered parameterization\n# mu_j = mu + tau * z_j ; z_j ~ Normal(0,1)   # non-centered: kills funnels\n```\n\n1. Use non-centered parameterizations for hierarchical models — the centered form creates funnels that HMC can't explore.\n2. Run 4+ chains; require R̂ \u003C 1.01, good ESS, zero divergences (see monte-carlo-methods).\n3. If divergences persist: reparameterize first, strengthen priors second, raise adapt_delta last.\n\n### 3. Check the fit\n\n1. **Posterior predictive checks:** overlay replicated datasets on the observed — check means, variances, extremes, and any statistic the science cares about.\n2. **Residual structure:** patterns in residuals vs predictors or time mean missing structure — add it or acknowledge it.\n3. **Sensitivity:** refit with wider\u002Fnarrower priors on key parameters — conclusions that flip are prior-driven, say so.\n\n### 4. Compare and report\n\n1. Compare models with LOO-CV (arviz.compare) — report elpd differences with standard errors, not just rankings.\n2. Report posteriors as distributions (plots + quantiles), not just point estimates; state priors explicitly — a Bayesian result without priors is irreproducible.\n3. Distinguish credible intervals (\"95% probability the parameter is here, given model+prior\") from confidence intervals — and from prediction intervals for new data.\n\n### 5. Build a hierarchical model correctly\n\n1. Write the generative story: population distribution → group parameters → observations — partial pooling is the payoff: noisy small groups borrow strength from the population.\n2. Use the non-centered parameterization (parameters as population mean + scale × standard normal offsets) — the centered form creates funnels that defeat HMC.\n3. Check shrinkage: group estimates should pull toward the population mean proportionally to their uncertainty — no shrinkage means the hierarchy isn't working (or the groups are truly distinct).\n\n### 6. Quick-reference checklist\n\n- [ ] Generative story written before the model\n- [ ] Likelihood matched to the data type (counts, proportions, positive continuous)\n- [ ] Priors weakly informative with prior predictive checks done\n- [ ] Non-centered parameterization for hierarchical models\n- [ ] ≥4 chains, R̂ \u003C 1.01, good ESS, zero divergences\n- [ ] Posterior predictive checks performed and reported\n- [ ] Prior sensitivity tested on key conclusions\n- [ ] Priors stated explicitly in every report\n\n## Common pitfalls\n\n- **Priors chosen by convenience:** default flat priors on transformed scales can be strongly informative — always inspect prior implications.\n- **Likelihood misspecification:** Normal likelihood on skewed\u002Fcount data — the posterior is precisely wrong; match the likelihood to the data type.\n- **Ignoring hierarchical structure:** complete pooling (ignores group differences) vs no pooling (noisy group estimates) — partial pooling dominates both.\n- **Bayes factors without prior sensitivity:** a BF of 100 that becomes 2 under a reasonable prior change is not evidence — it's prior artifact.\n- **Convergence theater:** R̂ \u003C 1.01 on a misspecified model — diagnostics check computation, not correctness; predictive checks check correctness.\n- **Posterior hacking:** trying models until the credible interval excludes zero — preregister the model or report the multiverse.\n- **Centered parameterization of hierarchical models:** the funnel geometry stalls HMC and produces divergences — non-center by default, center only with strong group-level data.\n- **Posterior predictive checks skipped:** a well-converged chain on a misspecified model is precisely wrong — predictive checks are part of fitting, not optional extras.\n",{"name":5,"category":24,"description":7},"scientific","main","af388a77c2fe5e0b4fd879cca4300a0ffa9a6579","skills\u002Fams-bayesian-statistics",1,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis","https:\u002F\u002Fgithub.com\u002FTanNhatCMS","https:\u002F\u002Fmrkiet.name.vn","2026-11-07 14:23:08",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add TanNhatCMS\u002Fjarvis --skill bayesian-statistics",{"tool":39,"command":40},"bunx","bunx skills add TanNhatCMS\u002Fjarvis --skill bayesian-statistics",{"tool":42,"command":43},"pnpm","pnpm dlx skills add TanNhatCMS\u002Fjarvis --skill bayesian-statistics","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-bayesian-statistics\u002FSKILL.md",true,[],[48,55,63,70,77,84],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M7EWYJR0J8DARY7E59Z6Y9MV","web-scrape","Turn web pages into LLM-ready markdown via the Firecrawl API (renders JS, anti-bot handling). Use when browser_open\u002Ffetch fails on JS-heavy pages, or when you need clean markdown\u002Fstructured extraction from a site. Requires FIRECRAWL_API_KEY.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fweb-scrape\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":59,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7EWYBN5P6F2AJG3FR24T9BP","design-taste-frontend","tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One Page Love, Awwwards Sites of the Day). Deals researched directions (idea, composition, type, palette, photographs, section blueprints) from a library, enforces a strict no-slop house style with a real-browser inspector, and runs a look-and-fix loop on screenshots. Use this whenever you build, design, redesign, restyle, polish or review a landing page, marketing site, portfolio, product page, one-pager, hero or any public-facing web page, in any stack (HTML\u002FCSS, React, Next.js, Vue, Svelte, Astro, Tailwind) — also when the user says a page looks generic, templated, \"AI-made\", sloppy, or asks to make it look designed, premium, award-level or less like every other site. Not for dashboards or app screens.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7EWY8FQFNQ2GB7NZZWGSSDX","test-driven-development","Use when implementing any feature or bugfix, before writing implementation code","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-tdd\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7EWY5SHBFRH1HDHVWM9K7TV","systematic-debugging","Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-debugging\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7EWY3NM0Z0JAKS7HDZ24K66","requesting-code-review","Use when completing tasks, implementing major features, or before merging to verify work meets requirements","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-code-review\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7EWY0WRMWX4M9ZFY0WKC593","brainstorming","You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-brainstorming\u002FSKILL.md",[],[]]