NJR - 2014-01-06

I'm interested in how the for loop sequence in "for (i in 1:n)" is parsed
when n = 0. Does 1:n give c(1, 0), so the for loop run for the indices 1
and 0, or is the for loop then skipped over?

An example: Say I have observations from 10 groups, and I have default and
special observations which I model with a normal and t-distribution
respectively. Each group can have both types of observations, or only
default, or only special observations. Is it possible to set up the model
in this way:

model {
for (g in 1:ngroups) {
for (i in 1:ndefault.g[g]) { # ndefault.g[g] may be 0 for certain groups
y.gi[g, i] ~ dnorm(yhat.gi[g, i], tauy.gi[g, i])
}
for (i in 1:nspecial.g[g]) { # nspecial.g[g] may be 0 for certain groups
y.gi[g, i] ~ dt(yhat.gi[g, i], tauy.gi[g, i], dft)
}
}

...
}

Thanks!