winbugs: array index is greater than array upper bound for model with data type kategoric (ordinal)

52 Views Asked by At

I need help to find the error in my WINBUGS code (v. 1.4.3).

While in the "Model Specification" step, the model looks syntatically correct. However, in my attempt to load the data, I got this error:

array index is greater than array upper bound for a

Could someone please help me? My model is provided below:

{ 
for (i in 1:n) 
{ 
y[i]~dcat(p[i,1:4]) 
p[i,1] <- p.cum[i,1] 
p[i,2] <- p.cum[i,2]-p.cum[i,1] 
p[i,3] <- p.cum[i,3]-p.cum[i,2] 
p[i,4] <- 1 - p.cum[i,3] 
} 
for (i in 1:n) 
{ 
for (k in 1:8) 
{ 
p.cum[i,k]<-1/(1+exp(pi[i,k])) 
pi[i,k]<- -a[k]+b.x1*x1[i]+b.x2*x2[i]+b.x3*x3[i]+b.x4*x4[i]+b.x5*x5[i]+b.x6*x6[i]+b.x7*x7[i]+b.x8*x8[i]
} 
} 
a[1]<-c[1] 
a[2]<-a[1]+c[2] 
a[3]<-a[2]+c[3] 
c[1] ~ dnorm(0.0,1.0E-4)#Prior for intercept 
c[2] ~ dnorm(0.0,1.0E-4)#Prior for intercept 
c[3] ~ dnorm(0.0,1.0E-4)#Prior for intercept 
b.x1~dnorm(0.0,1.0E-4)#Prior for slope ofx1 
b.x2~dnorm(0.0,1.0E-4)#Prior for slope ofx2 
b.x3~dnorm(0.0,1.0E-4)#Prior for slope ofx3 
b.x4~dnorm(0.0,1.0E-4)#Prior for slope ofx4 
b.x5~dnorm(0.0,1.0E-4)#Prior for slope ofx5 
b.x6~dnorm(0.0,1.0E-4)#Prior for slope ofx6 
b.x7~dnorm(0.0,1.0E-4)#Prior for slope ofx7 
b.x8~dnorm(0.0,1.0E-4)#Prior for slope ofx8 
or.x1<-exp(b.x1) 
or.x2<-exp(b.x2) 
or.x3<-exp(b.x3) 
or.x4<-exp(b.x4)
or.x5<-exp(b.x5) 
or.x6<-exp(b.x6) 
or.x7<-exp(b.x7) 
or.x8<-exp(b.x8) 
}

#data 
list( n = 770,
y=c(4,4,4,4,4,4,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,4,5,4,4,3,5,5,5,4,5,4,3,3,4,3,4,5,5,2,5,5,5,4,4,5,5,4,3,3,3,5,5,5,3,5,5,3,5,4,5,5,5,5,3,4,3,5,3,3,5,5,4,5,5,2,5,3,5,4,5,5,4,5,5,5,5,4,3,4,2,5,2,5,3,5,3,5,4,5,5,3,4,5,3,5,5,5,2,4,3,3,3,5,5,5,3,4,5,5,5,4,3,5,4,4,5,5,5,3,5,3,5,5,3,4,3,3,5,3,4,5,4,3,5,3,5,5,5,5,5,3,4,5,5,4,4,5,4,3,5,5,3,5,4,5,5,4,5,5,4,3,3,3,5,5,3,4,3,3,3,4,4,5,3,3,5,4,5,3,3,2,4,3,4,4,5,4,4,4,3,5,2,5,5,5,5,2,5,3,5,3,5,4,5,4,3,3,4,3,5,3,5,3,5,5,5,2,3,5,3,4,5,4,5,3,4,5,4,5,4,5,5,5,5,5,4,4,2,5,5,5,2,4,3,4,5,2,5,5,5,4,3,5,5,5,3,2,4,5,4,5,5,4,5,5,5,5,3,5,5,3,2,2,4,3,5,3,5,4,5,3,4,3,4,5,5,5,3,3,3,4,5))


#inits 
list(c = c(1, 1, 1, 1, 1, 1, 1, 1),  b.x1 = 0, b.x2 = 0, b.x3 = 0, b.x4 = 0, b.x5 = 0, b.x6 = 0, b.x7 = 0, b.x8 = 0) ``` 
1

There are 1 best solutions below

0
On

The problem is that you've only defined 3 a parameters in your model, but you're using a[k] where k ranges from 1 to 8 in the definition of pi[i,k]. So, you would need to either provide the other 5 a parameters as data or define them in the code.