Suppose I have

for (i in 1:n){ for (j in 1:n){ a[i,j] <- some number (e.g. based on data) that never changes } } b[1:n,1:n] <- inverse(a[1:n,1:n])

If n is large then there will be a huge penalty per iteration because of the matrix inversion. Is JAGS smart enough to realise that b only needs to be calculated once and then never again at subsequent iterations? If not, then b should be calculated in R and passed as data to JAGS. However, for some things it is convenient to calculate this in JAGS.

I suppose this is what the data block is for (rather than the model block). It would still be good to know what the behaviour of JAGS is in the model block.

Thanks