множественные определения узла y [1,1] - PullRequest
0 голосов
/ 10 июня 2019

У меня есть некоторые проблемы с этим кодом в winbugs. y [] является функцией необработанных данных и неизвестных параметров, поэтому я вычисляю y, но когда я компилирую, программный вывод «множественные определения узла y [1,1]». Я не знаю, как решить проблему.

model
{
for(i in 1:n){
y[i,1] <- 1/3*sum(x1[i,1:9])/(sqrt(0.01*v1)*u1)-3*sqrt(v1*0.01)
y[i,2] <- 1/3*sum(x2[i,1:9])/(sqrt(0.01*v2)*u2)-3*sqrt(v2*0.01)
#y[i,1:2] ~ dmnorm(mu[],tau[,])
}
gv1 <- 0.01*v1
gv2 <- 0.01*v2
mu[1] <- 0
mu[2] <- 0
tau[1,1] <- 1
tau[1,2] <- rho
tau[2,1] <- rho
tau[2,2] <- 1
for(i in 1:n){
for(j in 1:m){
x1[i,j] ~ dgamma(gv1,u1)
x2[i,j] ~ dgamma(gv2,u2)
}
y[i,1:2] ~ dmnorm(mu[],tau[,])
}
v1~dflat()T(0,)
u1~dflat()T(0,)
v2~dflat()T(0,)
u2~dflat()T(0,)
rho~dunif(0,1)
}
data
list(n=10,m=9,
x1=structure(
.Data=c(0.05,0.05,0.05,0.07,0.07,0.08,0.08,0.13,0.16,
0.04,0.04,0.05,0.05,0.06,0.07,0.07,0.09,0.1,
0.04,0.04,0.05,0.05,0.05,0.06,0.07,0.09,0.11,
0.04,0.04,0.05,0.04,0.05,0.07,0.06,0.09,0.09,
0.04,0.04,0.05,0.04,0.05,0.07,0.05,0.1,0.09,
0.04,0.04,0.05,0.04,0.05,0.06,0.05,0.1,0.08,
0.04,0.04,0.04,0.05,0.04,0.06,0.06,0.09,0.09,
0.03,0.04,0.03,0.06,0.05,0.06,0.06,0.07,0.09,
0.02,0.05,0.04,0.04,0.04,0.06,0.06,0.07,0.08,
0.02,0.04,0.04,0.04,0.04,0.05,0.06,0.07,0.08),
.Dim=c(10,9)),
x2=structure(
.Data=c(0,0.06,0.04,0.04,0.04,0.05,0.05,0.06,0.07,
0.03,0.04,0.03,0.03,0.04,0.03,0.06,0.06,0.07,
0.02,0.05,0.02,0.04,0.03,0.04,0.04,0.06,0.06,
0.03,0.03,0.04,0.03,0.04,0.05,0.04,0.04,0.06,
0.02,0.04,0.03,0.04,0.03,0.04,0.06,0.05,0.06,
0.02,0.03,0.02,0.03,0.03,0.04,0.04,0.05,0.06,
0.03,0.03,0.01,0.03,0.05,0.03,0.03,0.05,0.04,
0.02,0.02,0.03,0.04,0.03,0.03,0.02,0.05,0.05,
0.02,0.02,0.03,0.02,0.03,0.03,0.03,0.04,0.04,
0.02,0.02,0.03,0.02,0.03,0.03,0.03,0.04,0.04),
.Dim=c(10,9)))
list(v1=100,u1=1,v2=100,u2=1,rho=0.5)
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...