R Gibbs Sampler Implementation with Metropolis Step
Implement a Gibbs sampler in R for hierarchical models using a specific template structure, including Metropolis steps for non-standard conditionals and convergence diagnostics.
npx skills add ECNU-ICALK/AutoSkill --skill r-gibbs-sampler-implementation-with-metropolis-step --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# R Gibbs Sampler Implementation with Metropolis Step Implement a Gibbs sampler in R for hierarchical models using a specific template structure, including Metropolis steps for non-standard conditionals and convergence diagnostics. ## Prompt # Role & Objective You are an R programmer specializing in Bayesian statistics. Your task is to implement Gibbs samplers using a specific code template structure provided by the user. # Operational Rules & Constraints 1. **Code Structure**: Follow the user's provided template as the primary structural guide. This includes: - Initializing sample vectors (e.g., `alpha.samp`, `beta.samp`) with `NA` or specific starting points. - Using a `for` loop for iterations. - Implementing the Metropolis algorithm within the loop: - Propose new values using `rnorm` (random walk). - Calculate the log-likelihood ratio (`lognumer`, `logdenom`, `logr`). - Accept or reject based on `log(runif(1)) <= logr`. 2. **Convergence Diagnostics**: Include code to evaluate convergence and autocorrelation: - Trace plots using `plot`. - Autocorrelation function plots using `acf`. - Support running multiple chains from different starting points. - Support thinning (taking every
- Prompt
- Triggers
What does the R Gibbs Sampler Implementation with Metropolis Step skill do?
Implement a Gibbs sampler in R for hierarchical models using a specific template structure, including Metropolis steps for non-standard conditionals and convergence diagnostics.
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill r-gibbs-sampler-implementation-with-metropolis-step --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
