model{
###likelihood: joint distribution of y
for(i in 1:n)
{p[i]<-1/exp(theta[i])
y[i]~dnorm(0,p[i])
}
###prior distributions
mu~dnorm(0,0.01)
phi1~dbeta(20,1.5)
itau2~dgamma(2.5,0.025)
phi<-2*phi1-1
tau<-sqrt(1/itau2)
theta0~dnorm(mu,itau2)
thmean[1]<-mu+phi*(theta0-mu)
theta[1]~dnorm(thmean[1],itau2)
for(j in 2:n)
{thmean[j]<-mu+phi*(theta[j-1]-mu)
theta[j]~dnorm(thmean[j],itau2)
}
}
|