# DIC is an estimate of expected predictive error (lower deviance is better). # DIC info (using the rule, pD = Dbar-Dhat) # and Rhat is the potential scale reduction factor (at convergence, Rhat=1). # For each parameter, n.eff is a crude measure of effective sample size, # Cumulative: n.sims = 1500 iterations saved # Current: 3 chains, each with 1000 iterations (first 500 discarded) # Inference for Bugs model at "/Users/oliviergimenez/Desktop/nummodel.txt", When the run is complete, a prompt will reappear, then just type the following command to get the result: print(schools.sim)
You might get a weird message starting by err:ole, just ignore it. Run the model schools.sim <- bugs(data, inits, model.file = model.file1,parameters=parameters,n.chains = 3, n.iter = 1000, OpenBUGS.pgm=OpenBUGS.pgm, WINE=WINE, WINEPATH=WINEPATH,useWINE=T) The are the parameters to save parameters = c("theta", "mu.theta", "sigma.theta") OpenBUGS.pgm="/Applications/OpenBUGS323/OpenBUGS.exe" WINEPATH="/usr/local/Cellar/wine/2.0.4/bin/winepath" Set the Wine working directory and the directory to OpenBUGS, and change the OpenBUGS.exe location as necessary: WINE="/usr/local/Cellar/wine/2.0.4/bin/wine" Load the OpenBUGS Package library(R2OpenBUGS)ĭefine the model, write it to a text file and have a look nummodel <- function()
#HOW TO RUN WINE ON MAC INSTALL#
#HOW TO RUN WINE ON MAC DOWNLOAD#
Next, download the Windows version of OpenBUGS here Opening Terminal, then type in the command: brew install wine Wine which will allow you to run any Windows programs (.exe) on your Mac.
#HOW TO RUN WINE ON MAC MAC#
This program will make the installation of any other programs on your Mac so easy! This tutorial is an adaptation of () and (). Below are the steps to install `OpenBUGS` then to run it from your Mac either natively or from `R`. I had to use the good old `OpenBUGS` for some analyses that cannot be done in `JAGS`.