我希望能够指定多少" alpha"在t-1中,t为1。我试过alpha [t,1:k]< -ta [t-1,1:k] * alpha0 * n [t-1]; alpha0< - 。5,但它没有用。
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))