1

I want to be able to specify how much of the "alpha" in t-1 goes onto the prior for t. I tried alpha[t,1:k] <- theta[t-1,1:k]*alpha0*n[t-1]; alpha0<-.5, but it didn't work.

model {
for(t in 1:T){
  alpha[t,1:k] ~ ddirch(theta[1:k])
  #alpha[t,1:k] <- theta[t-1,1:k]*alpha0*n[t-1]; alpha0<-.5
  y[t,1:k] ~ dmulti(alpha[t,1:k], n[t])
  #N <- sum(y[1:k])
  delta[t]<-step(alpha[t,1]-alpha[t,2]-alpha[t,3]-alpha[t,4]-alpha[t,6]) 
}
#gamma prior for the alpha vector
for(i in 1:k){
  theta[i] ~ dgamma(0,.01)
} 
}

# DATA
list(k=6, T=4, 
n = c(600,600,600, 600), 
y= structure(.Data=c(
100, 100, 100, 100, 100, 100,
100, 100, 100, 100, 100, 100,
100, 100, 100, 100, 100, 100, 
100, 100, 100, 100, 100, 100), 
.Dim = c(4, 6)) )

# INITIALIZATION: Informative Prior
list(theta=c(.270,.160,.270,.09,.02,.08))
guyabel
  • 8,014
  • 6
  • 57
  • 86
user45367
  • 151
  • 1
  • 3
  • 14

0 Answers0