
model
{
  # Likelihood
  for( t in 1:Today ){
    for(d in 0:D){
      n[t,(d+1)] ~ dnegbin(p[t,(d+1)],r)
      log(lambda[t,(d+1)]) <- alpha[t] + beta.logged[(d+1)]
      # Conversions
      p[t,(d+1)] <- r/(r+lambda[t,(d+1)])
    }
    sum.n[t] <- sum(n[t,]) + m[t]
  }
  # Prior for neg binomial rate
  r ~ dgamma(dispersion.prior.shape,dispersion.prior.rate)
  # Prior for alpha
  alpha[1] ~ dnorm(alpha1.mean.prior, alpha1.prec.prior)
  for( t in 2:Today ){
    alpha[t] ~ dnorm(alpha[t-1],tau2.alpha)
  }
  ## Prior for beta
  beta.logged <- log(beta)
  beta ~ ddirch(beta.priors)
  
  # Prior for variance
  tau2.alpha ~ dgamma(alphat.shape.prior,alphat.rate.prior)
}