# NOT RUN {
data(pumps)
pumps.data <- list(t = pumps$t, x = pumps$x, N = nrow(pumps))
pumps.model <- system.file("bugs/model/pumps.bug", package="rbugs")
file.show(pumps.model)
pumps.inits <- system.file("bugs/inits/pumps.txt", package="rbugs")
file.show(pumps.inits)
inits <- list(dget(pumps.inits))
parameters <- c("theta", "alpha", "beta")
# }
# NOT RUN {
## Windows using WinBugs
pumps.sim <- rbugs(data = pumps.data, inits, parameters,
pumps.model, n.chains = 1, n.iter = 1000,
bugs = "C:/Program Files/WinBUGS14/WinBUGS14.exe",
bugsWorkingDir="C:/TEMP/rbugs/",
OpenBugs = FALSE)
## Windows using OpenBUGS
pumps.sim <- rbugs(data = pumps.data, inits, parameters,
pumps.model, n.chains = 1, n.iter = 1000,
bugs = "C:/Program Files/OpenBugs321/OpenBugs.exe",
bugsWorkingDir="C:/TEMP/rbugs/",
OpenBugs=TRUE)
## MCMC Analysis
library("coda")
pumps.mcmc <- rbugs2coda(schools.sim)
summary(pumps.mcmc)
effectiveSize(pumps.mcmc)
pumps.sim <- rbugs(data = pumps.data, inits, parameters,
pumps.model, n.chains = 1, n.iter = 1000,
workingDir="~/tmp/",
useWine=TRUE)
## MCMC Analysis
library("coda")
pumps.mcmc <- rbugs2coda(pumps.sim)
summary(pumps.mcmc)
effectiveSize(pumps.mcmc)
# }
Run the code above in your browser using DataLab