In the r-help list, I asked about how to make R talk to WinBUGS and
Gregor Gorjanc explained a workaround that DOES make R2WinBugs work in
Fedora Core Linux version 5.
Gregor asked me to let you know in this list that this does work.
I'm pasting in the working script. As you see below, the new element
is that the WINEPATH variable is explicitly set in R. This addresses
the problem that the Linux version of R2WinBUGS could not find the
winepath binary. Gregor is working out a patch for R2WinBUGS so that
this WINEPATH setting will not be necessary over the long run.
I emphasize, this DOES work with WinBUGS-1.4.1, but not with OpenBUGS,
because the scripting language changed between those two versions.
FC5 users should be cautioned that they need to install wine and
wine-tools rpms, and if you follow my example and put WinBUGS under
/usr/local/share, I promise it will work. Or not. :)
PJ
library(R2WinBUGS)
WINEPATH <- "/usr/bin/winepath"
# An example model file is given in:
model.file <- system.file(package = "R2WinBUGS", "model", "schools.txt")
# Let's take a look:
file.show(model.file)
# Some example data (see ?schools for details):
data(schools)
schools
J <- nrow(schools)
y <- schools$estimate
sigma.y <- schools$sd
data <- list ("J", "y", "sigma.y")
inits <- function(){
list(theta = rnorm(J, 0, 100), mu.theta = rnorm(1, 0, 100),
sigma.theta = runif(1, 0, 100))
}
parameters <- c("theta", "mu.theta", "sigma.theta")
schools.sim <- bugs(data, inits, parameters, model.file, n.chains = 3,
n.iter = 1000,bugs.directory = "/usr/local/share/WinBUGS14/",
working.directory = "/tmp", clearWD = FALSE, useWINE=T, newWINE=T,
WINE="/usr/bin/wine",WINEPATH=WINEPATH)
schools.sim
plot(schools.sim)
--
Paul E. Johnson
Professor, Political Science
1541 Lilac Lane, Room 504
University of Kansas
-------------------------------------------------------------------
This list is for discussion of modelling issues and the BUGS software.
For help with crashes and error messages, first mail [log in to unmask]
To mail the BUGS list, mail to [log in to unmask]
Before mailing, please check the archive at www.jiscmail.ac.uk/lists/bugs.html
Please do not mail attachments to the list.
To leave the BUGS list, send LEAVE BUGS to [log in to unmask]
If this fails, mail [log in to unmask], NOT the whole list
|