BUGS/JAGS Fundamentals
When to Use This Skill
- Writing new WinBUGS or JAGS models
- Understanding BUGS declarative syntax
- Converting between BUGS and Stan
- Integrating with R via R2jags or R2WinBUGS
Model Structure
BUGS uses a single declarative block where order doesn't matter:
model {
# Likelihood (order doesn't matter)
for (i in 1:N) {
y[i] ~ dnorm(mu[i], tau)
mu[i] <- alpha + beta * x[i]
}
# Priors
alpha ~ dnorm(0, 0.001)
beta ~ dnorm(0, 0.001)
[Description truncada. Veja o README completo no GitHub.]