[R] R2WinBUGS - parameter monitor seting

Doug Lincoln DougL at Nrahs.nsw.gov.au
Thu Nov 30 23:37:51 CET 2006


R2WinBUGS users,

I'm getting the error message "monitor could not be set" when I try to
monitor (and output to R) a response variable that includes missing data
(NAs)...ie.e imputing for y. Setting monitors for other parameters works
OK and running the R-generated WinBUGS script file in WinBUGS, also
works OK. Below is my R code and the log.txt file output by R2WinBUGS.
As I want to run this model 100+ times, i'd prefer to write some looping
code rather than cut and paste 100 times..can anyone help?

thanks
doug

R-code:

bayesimp.sim <- bugs(data, inits, parameters,"bayesimp.bug",
    n.chains = 1, n.iter = 4000, 
    bugs.directory = "c:/Program Files/WinBUGS14/",
    working.directory = NULL, clearWD = TRUE, debug = TRUE)

script.txt:

display ('log')
check ('D:/Work/SpatialEpi/Water/THM Imputation/Rwork/bayesimp.txt')
data ('D:/Work/SpatialEpi/Water/THM Imputation/Rwork/data.txt')
compile (1)
inits (1, 'D:/Work/SpatialEpi/Water/THM Imputation/Rwork/inits1.txt')
gen.inits()
thin.updater (2)
update (1000)
set (y)
set (u)
set (deviance)
dic.set()
update (1000)
coda (*, 'D:/Work/SpatialEpi/Water/THM Imputation/Rwork/coda')
stats (*)
dic.stats()
history (*, 'D:/Work/SpatialEpi/Water/THM
Imputation/Rwork/history.odc')
save ('D:/Work/SpatialEpi/Water/THM Imputation/Rwork/log.odc')
save ('D:/Work/SpatialEpi/Water/THM Imputation/Rwork/log.txt')
  
log.txt:

display(log)
check(D:/Work/SpatialEpi/Water/THM Imputation/Rwork/bayesimp.txt)
model is syntactically correct
data(D:/Work/SpatialEpi/Water/THM Imputation/Rwork/data.txt)
data loaded
compile(1)
model compiled
inits(1,D:/Work/SpatialEpi/Water/THM Imputation/Rwork/inits1.txt)
this chain contains uninitialized variables
gen.inits()
initial values generated, model initialized
thin.updater(2)
update(1000)
set(y)
monitor could not be set
set(u)
set(deviance)
dic.set()
update(1000)
coda(*,D:/Work/SpatialEpi/Water/THM Imputation/Rwork/coda)
stats(*)
This email and any files transmitted with it are confidentia...{{dropped}}



More information about the R-help mailing list