OpenHealthMeasures Home > WinBUGS Index > Errors

array index is greater than array upper bound for [last variable in rectangle]

This is one of two problems. The first potential problem is miscounting, depending on how your indexing works. As in, you think you have 1000 observations, but you really only have 999.

Even if you counted correctly, this error message occurs when you don't have an extra blank line *after* "END". So, your rectangular form must be:
list(N=n)
a[] b[] c[]
a1 b1 c1
a2 b2 c2
.....
an bn cn
END
[blank line]

On a related note, you can have any value for n that is less than the total number of observations and it will just read in that many observations.

made use of undefined node

This error seems to appear when there is missing data (designated NA) in a dependent variable. The only way I've found to get around it is to drop the observations with missing data.

I also received the comment:

Thank you for your blog. I was trying to figure out an error message of WinBUGS for a while and a Google lead me here and "This error seems to appear when there is missing data (designated NA) in a dependent variable" reminded me that I should assign a distribution for missing data. For example, in my case, d[127] is a missing data and I write down: d[127] ~ dflat() then it works. WinBUGS is great but the error message has no meaning to me at all.

this chain contains uninitialized variables

This error appears after loading in your list of initial variable values. This error drives me nuts because I think I have specified all the variables and I panic/stop thinking. It shows up when I, obviously, haven't specified initial values for all variables. Usually, I get thrown off when I have multiple observations per object with an object-level error term and I forget that all those errors need to be initialized. To get past this error in that sort of situation, all you have to do is hit "gen inits" and you will be ready to go.

incomplete row of data

It seems like this should be a fairly straightforward error, but managed to confuse me for hours (shut up, I'm 39 weeks pregnant). It confused me because the cursor would show up on the "END" line, not at the line where the incomplete data were.

I use rectangular input for data. It turns out that, back in my excel spreadsheets, I had 10 blank cells in one of the dependent variables which had carried forward. Once I actually replaced *all* blank cells with NA's, it ran just fine.

multiple definitions of node [x]

This is just me being sloppy. It is a node within one of the plates that does not have the appropriate subscripts with it. For instance, if I have a plate for(i IN 1:N) and a node called "mu" within the plate, it won't work. The node must be called "mu[i]"

Somehow, I manage to make this mistake just about every time I create a model. Oh, the basics . . .

incompatible copy

I have only gotten this error when I'm using batch scripts. It appears when the pathname to a file is very long. You'll need to move your files so that the pathname is shorter.

Also, John notes that this error comes up when something in your initial values file(s) doesn't match up with your model, e.g. you have five predictors but only one initial parameter or variance value.