确定模型构建没问题model{
for(i in 1:n)
{p[i]<-1/exp(theta[i])
y[i]~dnorm(0,p[i])
}
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)
}
}
数据导入list(y=c(0.2,0.3,0.6,1.2,0.6,0.8,1.5,1.4,1.8,1.3,0.6,0.2,0.4,0.1,0.8),
n=27),,,问题:导入对不?
然后进行模型编译,一会显示:没有定义n,最后一会又显示:educational vertion can not do this model.
我用的是winbugs 14,应该可以做SV吧 出错在哪了?请给予指导 谢谢.......
结果显示