[LCMATE] openBUGS vs. winBUGS script mode
Dufour Simon
simon.dufour at umontreal.ca
Fri Oct 12 19:15:54 EEST 2018
Hello all,
I used to work with script mode with winBUGS and finally moved to openBUGS. I understand that I now have to modify slightly my commands (e.g., sampleSet (*) vs. set(*)) in openBUGS script mode. There is something I do not understand, however. When running my script in winBUGS, when I asked for stats(*), the stats window would appear automatically after updating the model. In openBUGS it does not seem to do anything, I still need to click on the Inference\Samples tab.
I had the same problem with samplesHistory(*), samplesDensity(*) , samplesAutoC(*), samplesBgr(*), and samplesCoda. In that later case my coda are not saved in the destination path.
Anybody can help with that? My script is below.
Thanks,
Simon
# CHECK IF PROGRAM SYNTAX IS CORRECT
modelCheck('C:/Users/dufours/Desktop/BUGS/Two_tests_Cond_Independence.txt')
modelData('C:/Users/dufours/Desktop/BUGS/Data_inactive_active.txt') # READ DATA
modelCompile(3) # COMPILE PROGRAM
modelInits(1, 'C:/Users/dufours/Desktop/BUGS/init1.txt')
modelInits(2, 'C:/Users/dufours/Desktop/BUGS/init2.txt')
modelInits(3, 'C:/Users/dufours/Desktop/BUGS/init3.txt')
# GENERATE INITIAL VALUES FOR UNOBSERVED RANDOM VARIABLES
modelGenInits()
modelUpdate(5000) # BURN-IN ITERATIONS
samplesSet(Se_BORO) # KEEP SAMPLES OF THE PREVALENCE PARAMETER
samplesSet(Sp_BORO)
samplesSet(Se_PAR)
samplesSet(Sp_PAR)
samplesSet(pi)
modelUpdate(20000) # RUN THE GIBBS SAMPLER FOR MORE ITERATIONS
samplesStats(*) # SUMMARY STATISTICS OF THE PARAMETERS OF INTEREST
samplesHistory(*) # HISTORY PLOTS OF THE PARAMETERS OF INTEREST
samplesDensity(*) # POSTERIOR DENSITY PLOTS OF THE PARAMETERS OF INTEREST
samplesAutoC(*) # GENERATE AUTOCORRELATIONM PLOTS
samplesBgr(*) #GENERATE BROOKS-GELMAN-RUBIN DIAGNOSTICS
samplesCoda(*, C:/Users/dufours/Desktop/BUGS/coda) #node for which to save all monitored values in plain text files, formatted for use in the coda package for R
Simon Dufour, DMV, Ph.D.
Professeur/Professor
Département de pathologie et microbiologie
Faculté de Médecine Vétérinaire, Université de Montréal
Directeur Scientifique / Scientific Director
Réseau canadien de recherche sur la mammite bovine et la qualité du lait /
Canadian Bovine Mastitis and Milk Qality Research Network
TEL : 450-773-8521 ext. 8605
"There are 3 kinds of epidemiologist, those who can count and those who cannot" Anonymous
More information about the LCMATE
mailing list