seems to work fine The multivariate normal function dmnorm() expects a vector of length N for the mean and an NxN covariance matrix. Currently, you're passing the full 10x8 matrix of mu values by using mu[,], but instead you only want to pass the 1x8 row vector of mu's that correspond to the ith iteration, i.e., code :
Y[i, 1:8] ~ dmnorm(mu[i,], Omega[,])
Share :

WinBUGS inits: "number of initial values not equal to length of vector"
By : vaishali
Date : March 29 2020, 07:55 AM
will help you When the error message appears, the cursor should be placed after the erroneous vector in the initial values list. In your case this is phi1, because you have supplied 6 initial values, but in the model code, phi1[j] is defined for j=1 to JJ=8.

"Expected collection operator c" error at WinBugs
By : user2530496
Date : March 29 2020, 07:55 AM
this will help In your model, u2 is a vector of 40 values, while you have only provided one number for its initial value. The error should have placed the cursor after the u2 initial value, which tells you where the error is. The "expected collection operator c" meant that it was expecting to see u2=c(0,0,0,... i.e. a vector of initial values. Though since you have provided an initial value for sigma.u2, it's probably safe to let WinBUGS autogenerate the initial values for u2.

"Array index is less than one" error at Winbugs
By : Wortheboy
Date : March 29 2020, 07:55 AM
I wish this help you Indexes start from 1, not 0, in BUGS. The variables stu and tea are used for indexing, but they take the values 0,1  they should be 1,2 instead.

"Multiple definitions of node mu[1,2]" error in WinBUGS
By : André Borges
Date : March 29 2020, 07:55 AM
Hope this helps The error is because you have mu nested within two for loops. Therefore, you are filling row i J times which is not possible. What you have is: code :
for(i in 1:n){
for(k in 1:J){
y[i,k]~ dpois(mu[i,])
log(mu[i,1]) < beta1[1]*x1[i] + beta2[1]*x2[i] + b[,1]
log(mu[i,2]) < beta1[2]*x1[i] + beta2[2]*x2[i] + b[,2]
}}
for(i in 1:n){
log(mu[i,1]) < beta1[1]*x1[i] + beta2[1]*x2[i] + b[,1]
log(mu[i,2]) < beta1[2]*x1[i] + beta2[2]*x2[i] + b[,2]
for(k in 1:J){
y[i,k]~ dpois(mu[i,])
}}

"Multiple definition of node a" error in Winbugs
By : Malik Jezi
Date : March 29 2020, 07:55 AM
Any of those help You get this error because you've defined a, b, c within a for() loop. In other words you've defined a constant node multiple times (n times). You should replace a, b, c with a[i], b[i], c[i]. Think of BUGS as a model description language, not a programming language. Every quantity in your model has to have one single definition as a fixed or random function of other quantities.

