Dear list members:
I am running some analyses in a linux cluster (although I am using only serial jobs) employing Dirichlet process priors. The datasets are very big (30-50 thousands) and, therefore, I have to truncate the DPP with a number of clusters not very small (30 to 80). The analyses take several days to finish. Sometimes, OpenBUGS stops after several thousands of updates without mentioning anything in the log file, but with the message
****** Sorry something went wrong in procedure Node.Prior in module GraphCat ******
in the buffer.txt file.
The error seems to be related to the part of the model
#constructive Dirichlet process prior
for (k in 1:M-1) { V[k] ~ dbeta(1,alpha) }
V[M] <- 1
p[1] <- V[1]
for (j in 2:M) { p[j] <- V[j]*(1-V[j-1])*p[j-1]/V[j-1] }
for( i in 1 : n) {
H[i] ~ dcat(p[])
for (j in 1:M) { SC[i,j] <- equals(j,H[i]) }
mu[i] <- mu.star[H[i]];
x[i] ~ dnorm(mu[i],phiinv)
}
and, I think, the following procedure of GraphCat
PROCEDURE (node: Node) Prior (): REAL;
VAR
i, r, start: INTEGER;
logP, p: REAL;
BEGIN
r := SHORT(ENTIER(node.value + eps));
start := node.start;
i := start + r - 1;
p := node.p[i].Value();
logP := MathFunc.Ln(p);
RETURN logP
END Prior;
I don't know how to debug in linux. If I had to repeat the analysis in the Windows machines that I have access (to be able to debug), it would take several weeks.
I have run some tests: truncate the beta distributions of V, e.g., dbeta(1,alpha)I(0.000001,0.999999) and/or to rescale the probabilities p to ensure sum to 1 (although this didn't seem necessary), but I received the same error when using the same seed.
I noticed that OpenBUGS automatically decided to use discrete slice to update H. Then, I decided to disable discrete slice. As a result, OpenBUGS used categorical updater for H and I did not receive the error anymore using the same seed.
In a certain way, this solves the problem, but for a cost that it takes 5 times more to obtain the sample of the posterior.
I was wondering if the more experienced users of BUGS have already obtained this error and/or could please help me to understand what is generating the problem when discrete slice is used.
Maybe any p in dcat(p[]) too small is generating the error?
Or perhaps this is similar to the problem that logit(prob) samples prob out of the 0-1 bound, and then we have to use prob.bound<-max(0,min(1,prob)) and dbern(prob.bound) instead of dbern(prob) directly ?
Any suggestion, idea or advice is welcome.
Thanks in advance,
Frederico Zanqueta Poleto
University of São Paulo
[log in to unmask]
-------------------------------------------------------------------
This list is for discussion of modelling issues and the BUGS software.
For help with crashes and error messages, first mail [log in to unmask]
To mail the BUGS list, mail to [log in to unmask]
Before mailing, please check the archive at www.jiscmail.ac.uk/lists/bugs.html
Please do not mail attachments to the list.
To leave the BUGS list, send LEAVE BUGS to [log in to unmask]
If this fails, mail [log in to unmask], NOT the whole list
|