[LCMATE] openBUGS vs. winBUGS script mode
Dufour Simon
simon.dufour at umontreal.ca
Fri Oct 12 20:58:32 EEST 2018
Exactly!
Thanks Nandini.
Simon
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
De : Nandini Dendukuri <nandini.dendukuri at mcgill.ca>
Envoyé : 12 octobre 2018 13:48
À : Dufour Simon <simon.dufour at umontreal.ca>; lcmate at lists.uth.gr; Buczinski Sébastien <s.buczinski at umontreal.ca>; Juan Carlos Arango Sabogal (juancarlosarangosabogal at gmail.com) <juancarlosarangosabogal at gmail.com>
Objet : RE: openBUGS vs. winBUGS script mode
Hi Simon,
Just compared with an old script of mine and I think the only thing you are missing is quotation marks:
samplesStats(*) # SUMMARY STATISTICS OF THE PARAMETERS OF INTEREST
should be replaced by
samplesStats("*") # SUMMARY STATISTICS OF THE PARAMETERS OF INTEREST
Similarly for Density and History.
Hope this helps,
Nandini
From: Dufour Simon <simon.dufour at umontreal.ca<mailto:simon.dufour at umontreal.ca>>
Sent: Friday, October 12, 2018 12:16 PM
To: lcmate at lists.uth.gr<mailto:lcmate at lists.uth.gr>; Nandini Dendukuri <nandini.dendukuri at mcgill.ca<mailto:nandini.dendukuri at mcgill.ca>>; Buczinski Sébastien <s.buczinski at umontreal.ca<mailto:s.buczinski at umontreal.ca>>; Juan Carlos Arango Sabogal (juancarlosarangosabogal at gmail.com<mailto:juancarlosarangosabogal at gmail.com>) <juancarlosarangosabogal at gmail.com<mailto:juancarlosarangosabogal at gmail.com>>
Subject: openBUGS vs. winBUGS script mode
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