Two questions about larger BUGS programs:
i In Classic BUGS (Linux 0.6), I get a message Too many nodes with a
program with 23 nodes. Is it actually the number of nodes or the number
of elements within the nodes? The total there is over 1 million,
presumably about 8Mb. What is the best way round this? In WinBUGS (same
program suitably adapted on VMware on Linux) demands an enormous memory
(>50 Mb) and compilation doesn't complete in sensible time.
ii Is the best way to use a stochastic discrete node to select a
left-hand side element to use the step function? What I want to do is
essentially:
for (i in 1:max.i){
for (k in 1:max.j){
day[i,k]~dbin(prob,number[i,k])
offset[i,k]<-base[i,k]+day[i,k]
array[i,k,offset[i,k])<-result[i,k]
}
}
where base, prob, number and result are data nodes (ie read in) and
dimensioned accordingly.
The problem with this is that the array[] has to be sized within a loop
(or declared in Classic BUGS) in order that the dimensions be known, so
the above coding obviously won't work - well there is probably a
BUGS-speak interpretation of this simple view!
So far, I can only come up with
for (i in 1:max.i){
for (k in 1:max.j){
day[i,k]~dbin(prob,number[i,k])
offset[i,k]<-base[i,k]+day[i,k]
for (l in 1:max.l){
array[i,k,l]<-result[i,k]*
(step(l-0.5-offset[i,k])-step(l+0.5-offset[i,k]))
}
}
}
Rather ugly I think and carrying round enormous arrays doesn't help.
(Sorry about the wrap-round if it occurs).
Any ideas?
John
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|