我运行您给出的SV-T MCMC程序时候出错,麻烦您帮我看一下。
程序为:
model{ for (i in 1:n) {yisigma2[i]<-1/exp(theta[i]) y[i] ~dt(0,yisigma2[i],s); } s~dchisqr(8)I(2,50); phi1~dbeta(20,1.5) phi<-2*phi1-1 mu~dnorm(0,0.01) beta<-exp(mu/2) itau2~dgamma(2.5,0.025) 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(-8.76,-35.27,-41.52,10.83,22.37,-8.00,11.34,20.42,-23.44,-9.92,15.79,13.96, -36.52,4.71,-23.26,-24.59,-2.17,-36.65,-40.37,24.96,11.22,-1.97,-45.92,0.95,-6.29,-55.69 ,48.26,-2.08,-70.60,5.61,28.96,43.54,3.58,-56.55,16.80,6.07,-57.82,15.55,-17.09, -21.14,-40.55,7.18,9.84,40.63,88.87,-7.08,-23.61,13.92),n=48) list(mu=0,itau2=0.5,s=6,theta0=0.97)
在gen ints 时 报错: unable to generate initial values for node[01055130H] of type GraphT.Mixing. 若我再给其他的变量赋初值,仍然处现错误,只不过 node的位置变化了。