model
{
for( i in 1 : batches ) {
m[i] ~ dnorm(theta, tau.btw)
for( j in 1 : samples ) {
y[i , j] ~ dnorm(m[i], tau.with)
}
}
sigma2.with <- 1 / tau.with
sigma2.btw <- 1 / tau.btw
tau.with ~ dgamma(0.001, 0.001)
tau.btw ~ dgamma(0.001, 0.001)
theta ~ dnorm(0.0, 1.0E-10)
}
数据文件如下:
list(batches = 6, samples = 5,
y = structure(
.Data = c(1545, 1440, 1440, 1520, 1580,
1540, 1555, 1490, 1560, 1495,
1595, 1550, 1605, 1510, 1560,
1445, 1440, 1595, 1465, 1545,
1595, 1630, 1515, 1635, 1625,
1520, 1455, 1450, 1480, 1445), .Dim = c(6, 5)))
初始数据为:
list(theta=1500, tau.with=1, tau.btw=1)
前几步都是正常的,在装载初始数据时提示如下:this chain contains uninitialized variables。
这个例子是WinBUGS帮助文件中给出的,不知道哪个变量没有初始化,请高手指点!!!!!


雷达卡



京公网安备 11010802022788号







