Hello everyone,
 
I am hoping for advice on how to get around an issue I am encountering in my OpenBUGS script.  I am running OpenBUGS version 3.2.3 rev 1012 on a Windows computer.  The oddity involves a difference in operation when running the model manually through the GUI and running in batch mode.  The manual GUI operation is as expected.  Through the GUI, I am allowed to add a sampling node for my model's jointloglikelihood variable (a vector) and this variable is sampled correctly when running the model.  The batch mode complains about my samplesSet("jointloglikelihood") command for the same jointloglikelihood variable, with the "no monitors set" warning from the log.  Also, everything in the script works correctly, it just doesn't save the samples from the jointloglikelihood variable in the CODA output (probably a result of the samplesSet not working for that variable). 
 
The syntax from the script I am using for the line in question is:
 
samplesSet("logjointlikelihood")
 
My model is:
 

#Author: [log in to unmask]

#Description: NHPP with the generalized Goel cumulative intensity function
THE MODEL:
model {
for (i in 2:Tau) {
#joint likelihood function
A[i-1] <- -exp(-zeta*pow(t[i],kappa))+exp(-zeta*pow(t[i-1],kappa))
B[i-1] <- N[i]-N[i-1]
dummy[i-1] <- 0
dummy[i-1] ~ dloglik(logjointlikelihood[i-1])
logjointlikelihood[i-1] <- phi*(-1*logfact(B[i-1])+B[i-1]*log(u)+B[i-1]*log(A[i-1])-u*A[i-1])
}
#prior distribution for zeta (stochastic portion)
zeta ~ dbeta(c,d)
#prior distribution for kappa (stochastic portion)
kappa ~ dgamma(g,h)
}
DATA:
#random expert data
list(phi=1,u=148,c=1.1,d=1.0,g=1.1,h=1.0,Tau=6,t=c(0,10,20,30,40,50),N=c(0,74,111,129,138,143))#Gamma=148
INITIAL VALUES:
list(zeta=.0203,kappa=1.37)#Gamma=148

 
You may be asking why I need these samples.  Well, this is related to my dissertation research.  I am using MATLAB to implement power-posteriors method of Friel et al. (2008) to estimate the marginal likelihood (to compute Bayes factor for model comparison).  This method involves sampling from multiple MCMC chains, and I am using MATLAB to control setup of and post-processing of OpenBUGS (which is being used for computing the MCMC samples).  The post-processing necessitates having the joint loglikelihood samples.  I have a temporary workaround where I am separately computing the joint loglikelihood samples in MATLAB (but this isn't preferable).  I would like to be able to obtain the jointloglikelihood samples in batch mode (manually performing this on 100 chains in OpenBUGS GUI is not an option).
 
Thanks for your suggestions,
 
Reuben Johnston
[log in to unmask]
George Washington University PhD student
------------------------------------------------------------------- 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