Hi all,
I am running a network meta-analysis model using WinBUGS via R, with the R package R2WinBUGS. I get two trap errors just as WinBUGS is about to close and R is about to import the coda files:
• Index out of range
• NIL dereference (read)
The model runs fine when just using WinBUGS on its own, i.e. not through R.
For context, I am using 3 chains and updating the model with a full-run which uses the last chain values of a burn-in run. That is, I call bugs() twice, once for burn-in, once for full-run. For the burn-in period, I monitor two vectors of parameters of length < 20. This seems to work fine, for at least up to 300,000 iterations (I will typically use much fewer).
The full-run monitors around 500 parameters (including scalars, vectors and arrays). With R2WinBUGS the simulations for up to around 10,000 iterations are produced without problem. It’s only when I increase the number of iterations to approximately 30,000 or more that I start to get the trap errors. Ideally, I would like to have the opportunity to do more: for example, if future analyses produce chains with high auto-correlation. The trap errors occur just as WinBUGS is about to close. That is, just as history(*,…) appears in the WinBUGS script. WinBUGS also tends to enter a state of ‘not responding’ at the coda(*,…) and stats(*) stage. I assume this is due to the size of the files.
I suspect the errors are caused by memory issues, since it is only when the number of iterations increases that the trap errors appear. At the same time, the coda files are not overwhelmingly large and should be able to be read in by R. Since the model runs fine in WinBUGS (on its own); in R with R2WinBUGS for the burn-in run and for a short number of iterations at the full-run; and the model code is very similar to the NICE technical support document, I do not think the issues lie with the model code.
Does anybody know what the source of the two trap errors might be?
Any help would be greatly appreciated – please be in touch if you require any more details.
Best wishes,
Tristan
-------------------------------------------------------------------
This list is for BUGS users to support each other, ask questions or share ideas.
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
|