Conclusion

Bayesian Modeling with RJAGS

Alicia Johnson

Associate Professor, Macalester College

Bayesian modeling with RJAGS

  • Define, compile, & simulate intractable Bayesian models.
  • Explore the Markov chain mechanics behind RJAGS simulation.

Bayesian Modeling with RJAGS

The power of Bayesian modeling

  • Combine insights from your data and priors to inform posterior insights.

Bayesian Modeling with RJAGS

The power of Bayesian modeling

  • Combine insights from your data and priors to inform posterior insights.
  • Conduct intuitive posterior inference: posterior credible intervals & probabilities.

Bayesian Modeling with RJAGS

Foundational, flexible, & generalizable Bayesian models

my_model <- "model{
  # Likelihood model
  for(i in 1:length(Y)) {
    Y[i] ~ dnorm(m, s^(-2))
  }

  # Prior models
  m ~ dnorm(...)
  s ~ dunif(...)
}"

Bayesian Modeling with RJAGS

Foundational, flexible, & generalizable Bayesian models

my_model <- "model{
  # Likelihood model
  for(i in 1:length(Y)) {
    Y[i] ~ dnorm(m[i], s^(-2))
    m[i] <- a + b * X[i]
  }

  # Prior models
  a ~ dnorm(...)
  b ~ dnorm(...)
  s ~ dunif(...)
}"

Bayesian Modeling with RJAGS

Foundational, flexible, & generalizable Bayesian models

my_model <- "model{
  # Likelihood model
  for(i in 1:length(Y)) {
    Y[i] ~ dnorm(m[i], s^(-2))
    m[i] <- a + b[X[i]]
  }

  # Prior models
  a ~ dnorm(...)
  b[1] <- 0
  b[2] ~ dnorm(...)
  s ~ dunif(...)
}"

Bayesian Modeling with RJAGS

Foundational, flexible, & generalizable Bayesian models

my_model <- "model{
  # Likelihood model
  for(i in 1:length(Y)) {
    Y[i] ~ dnorm(m[i], s^(-2))
    m[i] <- a + b[X[i]] + c * Z[i]
  }
  # Prior models
  a ~ dnorm(...)
  b[1] <- 0
  b[2] ~ dnorm(...)
  c ~ dnorm(...)
  s ~ dunif(...)
}"

Bayesian Modeling with RJAGS

Foundational, flexible, & generalizable Bayesian models

my_model <- "model{
 # Likelihood model
 for(i in 1:length(Y)) {
 Y[i] ~ dpois(l[i])
 log(l[i]) <- a + b[X[i]] + c*Z[i]
 }
 # Prior models
 a ~ dnorm(...)
 b[1] <- 0
 b[2] ~ dnorm(...)
 c ~ dnorm(...)
}"

Bayesian Modeling with RJAGS

Thank you!

Bayesian Modeling with RJAGS

Preparing Video For Download...