Learn R Programming

rbugs (version 0.5-9.1)

pumps: 10 Power Plant Pumps

Description

10 Power Plant Pumps.

Usage

data(pumps)

Arguments

Format

A data frame with 10 observations on the following 2 variables.

t

The length of the operation time.

x

The number of failures.

Examples

Run this code
# 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