Hello again,

        I thank everyone who responded to my BRugs problem. I have overcome 
this one. I have several new ones. Some problems do not seem serious. My 
difficulty is not knowing which problem is serious and must be solved.

        #1. WINE is installed properly (I believe). Despite the "socket path 
error" the OpenBUGS Setup Wizard opens and I am able to successfully install 
OpenBUGS on my computer. See #6 below.


bash-3.2$ wine OpenBUGS322setup.exe 
Dynamic session lookup supported but failed: launchd did not provide a socket 
path, verify that org.freedesktop.dbus-session.plist is loaded!
err:ntdll:RtlpWaitForCriticalSection section 0x7bc9791c "loader.c: 
loader_section" wait timed out in thread 0021, blocked by 0022, retrying (60 
sec)

        #2. My next step is to open OpenBUGS. I get a second "socket path 
error".

bash-3.2$ wine OpenBUGS.exe
Dynamic session lookup supported but failed: launchd did not provide a socket 
path, verify that org.freedesktop.dbus-session.plist is loaded!

        I ran this script. It is based on the R help and example given in 
http://www.davideagle.org/r-2/running-openbugs-on-mac-using-wine.

> library(R2OpenBUGS)
> 
> #schools data in the R2OpenBUGS library
> data(schools)
> 
> #define the model
> nummodel <- function(){
+ for (j in 1:J){
+                y[j] ~ dnorm(theta[j], tau.y[j])
Error: unexpected input in:
"for (j in 1:J){
¬"
>                theta[j] ~ dnorm mu.theta, tau.theta)
Error: unexpected input in "¬"
>                tau.y[j] <- pow(sigma.y[j], -2)}
Error: unexpected input in "¬"
>       mu.theta ~ dnorm(0.0, 1.0E-6)
mu.theta ~ dnorm(0, 1e-06)
>       tau.theta <- pow(sigma.theta, -2)
Error: could not find function "pow"
>       sigma.theta ~ dunif(0, 1000)
sigma.theta ~ dunif(0, 1000)
> }
Error: unexpected '}' in "}"
> # write the model code out to a file
> write.model(nummodel, "nummodel.txt")
Error in body(model) : object 'nummodel' not found

#3. The "nummodel" model correctly shows up in a window. 

>       model.file1 = paste(getwd(),"nummodel.txt", sep="/")
> file.show("nummodel.txt")
> #prepare the data for input into OpenBUGS
> J <- nrow(schools)
> y <- schools$estimate
> sigma.y <- schools$sd
> data <- list ("J", "y", "sigma.y")
> 
> #initialization of variables
> inits <- function(){
+   list(theta = rnorm(J, 0, 100), mu.theta = rnorm(1, 0, 100), sigma.theta = 
runif(1, 0, 100))}
Error: unexpected input in:
"inits <- function(){
¬"
> #set the WINE working directory and the directory to OpenBUGS - change the 
> # OpenBUGS.exe location as necessary
> WINE="/opt/local/bin/wine"
> WINEPATH="/opt/local/bin/winepath"
> OpenBUGS.pgm="/Users/XPJO/Desktop/OpenBUGS/OpenBUGS.exe"
> parameters = c("theta", "mu.theta", "sigma.theta")
> #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=TRUE)
#4. Error in bugs.run(n.burnin, OpenBUGS.pgm, debug = debug, WINE = WINE,  : 
  Look at the log file in  
/private/var/folders/1h/5nhp6jsd6jb3c7fz1n3rg3ph0000gn/T/RtmpVN2HkI  and
try again with 'debug=TRUE' to figure out what went wrong within OpenBUGS.
> 

#4. I don't know how to access /private/... and debug = TRUE does offer me 
useful information.

#5. A popup menu appears with the message: "Init: code file not found."

#6.     In addition, I have executed WinBUGS using XQuartz. The last line gives 
a "socket path'' message.

bash-3.2$ wine OpenBUGS322setup.exe 
Dynamic session lookup supported but failed: launchd did not provide a socket 
path, verify that org.freedesktop.dbus-session.plist is loaded!
err:ntdll:RtlpWaitForCriticalSection section 0x7bc9791c "loader.c: 
loader_section" wait timed out in thread 0021, blocked by 0022, retrying (60 
sec)
... Many fixes appear!!!
fixme:sfc:SfcIsFileProtected (0x0, 
L"Z:\\Users\\PJO\\Desktop\\OpenBUGS\\%SystemDrive%\\Program 
Files\\OpenBUGS\\OpenBUGS322\\unins000.exe") stub
bash-3.2$ ls -l
total 25336
drwxr-xr-x  4 PJO  staff       136 Feb 11 16:06 %SystemDrive%
-rw-r--r--  1 PJO  staff       164 Feb 10 13:59 OpenBUGS.R
-rw-r--r--@ 1 PJO  staff  12963689 Jan 13 22:45 OpenBUGS322setup.exe
-rw-r--r--  1 PJO  staff      2935 Feb 11 15:49 Test.R
bash-3.2$ ls -l
total 25776
drwxr-xr-x  4 PJO  staff       136 Feb 11 16:06 %SystemDrive%
-rw-r--r--  1 PJO  staff       164 Feb 10 13:59 OpenBUGS.R
-rwxr-xr-x  1 PJO  staff    222845 Jun 18  2012 OpenBUGS.exe
-rw-r--r--@ 1 PJO  staff  12963689 Jan 13 22:45 OpenBUGS322setup.exe
-rw-r--r--  1 PJO  staff      2935 Feb 11 15:49 Test.R
bash-3.2$ wine OpenBUGS.exe
Dynamic session lookup supported but failed: launchd did not provide a socket 
path, verify that org.freedesktop.dbus-session.plist is loaded!

Thanks,

Paul
        [[alternative HTML version deleted]]

_______________________________________________
R-SIG-Mac mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-mac

Reply via email to