Questions tagged [openbugs]

OpenBUGS is computer software for the Bayesian analysis of complex statistical models using Markov chain Monte Carlo (MCMC) methods.

Overview

BUGS is a software package for performing Bayesian inference Using Gibbs Sampling. The user specifies a statistical model, of (almost) arbitrary complexity, by simply stating the relationships between related variables. The software includes an ‘expert system’, which determines an appropriate MCMC (Markov chain Monte Carlo) scheme (based on the Gibbs sampler) for analysing the specified model. The user then controls the execution of the scheme and is free to choose from a wide range of output types.

Versions

There are two main versions of BUGS, namely WinBUGS and OpenBUGS. This site is dedicated to OpenBUGS, an open-source version of the package, on which all future development work will be focused. OpenBUGS, therefore, represents the future of the BUGS project. WinBUGS, on the other hand, is an established and stable, stand-alone version of the software, which will remain available but not further developed. The latest versions of OpenBUGS (from v3.0.7 onwards) have been designed to be at least as efficient and reliable as WinBUGS over a wide range of test applications. OpenBUGS runs on x86 machines with MS Windows, Unix/Linux or Macintosh (using Wine).

Note that software exists to run OpenBUGS (and analyse its output) from within both R and SAS, amongst others.

For additional details on the differences between OpenBUGS and WinBUGS see the OpenVsWin manual page.

How it works

The specified model belongs to a class known as Directed Acyclic Graphs (DAGs), for which there exists an elegant underlying mathematical theory. This allows us to break down the analysis of arbitrarily large and complex structures into a sequence of relatively simple computations. BUGS includes a range of algorithms that its expert system can assign to each such computational task.

One of the main differences between OpenBUGS and WinBUGS is the way in which the expert system makes its decisions. WinBUGS defines one algorithm for each possible computation type whereas there is no limit to the number of algorithms that OpenBUGS can make use of, making for much greater flexibility and extensibility.

History

The BUGS project grew out of work in artificial intelligence in the early 1980s. Key developments included: exact means of propagating uncertainty in graphical structures; understanding that simulation methods could be used for inference; and recognising that object-oriented programming could be exploited to generalise the simulation algorithm. A start was made on the BUGS program in 1989 with the appointment of chief programmer Andrew Thomas, working under David Spiegelhalter, to the MRC Biostatistics Unit in Cambridge. Coincidentally, at the same time, the classic MCMC work of Gelfand and Smith was being carried out 80 miles away in Nottingham, but entirely independently and from a rather different starting point.

Initially, BUGS only used fairly specialised algorithms. In 1996, however, the project moved to Imperial College, London (headed by Nicky Best, who had already been involved for some years in Cambridge) and work began on expanding the software’s capabilities. In particular, Jon Wakefield and Dave Lunn joined the project at this stage to work on implementing non-linear models, and development of a stand-alone Windows version of the software gained momentum. In subsequent years, a number of other challenging model types were tackled, including spatial models, dynamic models (involving differential equations) and variable-dimension models (fitted using reversible jump MCMC).

In 2004, Andrew Thomas moved to Helsinki to begin work on OpenBUGS, while Dave Lunn and Nicky Best remained at Imperial, continuing maintenance and development of WinBUGS. Thus the two packages diverged somewhat, each with their own advanced features unavailable in the other. However, now that OpenBUGS has progressed from being somewhat experimental to a stable and reliable package, we are now focussing all development efforts on it.

Source: [http://www.openbugs.net/w/FrontPage]

52 questions
0
votes
0 answers

OpenBUGS Error: "Sorry something went wrong in procedure UpdaterStd.Sample in module UpdaterSCAM"

I'm trying to run my below model code on OpenBUGS but I keep getting the error "Sorry something went wrong in procedure UpdaterStd.Sample in module UpdaterSCAM" when trying to update the model. My model is supposed to be an adapted identity link to…
A S
  • 1
0
votes
0 answers

"expected right parenthesis error" using R2OpenBugs

I'm a newby in r programming, somone can help me to fixe this error: expected right parenthesis error pos 169. library(R2OpenBUGS) lineModel <- function() { # I: nbre of measures (Spheres) # J: nbre of energy bins # The likelihood…
0
votes
0 answers

error for node u[1] of type SpatialCARNormal.Node first argument Graph 18......................in openbugs

when i run the bym model in openbugs , i encounter this error when i select the load inits option , please help me… MODEL model { for (i in 1:m) { # Poisson likelihood for observed counts y[i]~dpois(mu[i]) log(mu[i])<-log(e[i])+alpha+u[i]+v[i] #…
shal
  • 1
  • 1
0
votes
1 answer

openBugs error with expected a comma or right parenthesis. where is my mistake?

list(cases=structure(.Data =c(1.10000E+01, 1.20000E+01, 1.10000E+01, 1.20000E+01, 1.10000E+01, 2.20000E+01, 2.30000E+01, 2.20000E+01, 2.30000E+01, 2.20000E+01, 3.30000E+01, 3.40000E+01, 3.30000E+01, 3.40000E+01, 3.30000E+01, 1.10000E+01,…
0
votes
1 answer

OpenBugs/R categorical variable "yes", "no" as 1,0

I have a simple logistical regression like logit(p[i]) <- b0 + b1*x[i] but data for the p[i] is given as "yes", "no". How to encode ("yes"/"no") to (1,0) ? e.g. smt like this logit(encode(p[i])) <- b0 + b1*x[i]
0
votes
1 answer

OpenBUGS: Hierarchical Model unable to compile

I've implement a model in OpenBUGs from the following data: The data consists of 10 independent studies - 5 trials of 2 different medications (Med = 0 or 1) then a total of infected participants for that trial (infected) - and a Total of…
RickPeck
  • 165
  • 2
  • 14
0
votes
1 answer

"empty slot not allowed in variable name" (OpenBUGS, R2OpenBUGS)

I'm a beginner with OpenBUGS which I use through the R2OpenBUGS R package. I try to set state space model for identifying a lognormal signal in very noisy data. After many trials and errors, I managed to get this code but I still get the following…
0
votes
0 answers

"Error: Attempt to redefine node" in Mixture that changes size every iteration

My data has three columns Time, Interval, Count. I have a mixture of Poissons that goes like this mod_string = " model{ for(i in 2:length(Count)){ Count[i] ~ dpois(lambda.hacked[i]*z[i]+0.0001) z[i] ~dbern(p) lambda.hacked[i] <- mu[ clust[i]…
A Doe
  • 301
  • 2
  • 14
0
votes
1 answer

Unable to perform Bayesian analysis on data through jags in R

Here's my code library(R2jags) #library(rjags) library(bayesplot) library(coda) # set working directory setwd("/Users/isa/Desktop/logreg") # BUGS model code cat("model { for( i in 1 : 8 ) { y[i] ~ dbin(theta[i],n[i]) logit(theta[i]) <-…
0
votes
1 answer

Error messgae in JAGS when defining constraints for priors Attempt to redefine node

I am trying to sample from prior distributions and constrain some of the sums and differences to be greater than 0, however, when I run this code that usually works in OpenBugs/WinBugs, I get the following error 'Attempt to redefine node '. I was…
Martin
  • 171
  • 1
  • 7
0
votes
0 answers

Editing an existing .txt file by exporting data from R

I'm creating some simulated disease count data for spatial modeling in OpenBUGS via the BRugs package in R. I have an existing .txt file which contains most of the information I need to run my models in BRugs. Here's what this text file looks…
lecreprays
  • 77
  • 1
  • 13
0
votes
1 answer

R OpenBugs Model Error

I am looking to run a hierarchical poisson model to hockey goal tending data. here is the model as set up in bugs: modelString <- "model { for(i in 1:n_obs){ hockey_goals[i] ~ dpois(p[i]) log(p[i]) <- p_inter + p_age * age[i] +…
jmy
  • 1
0
votes
0 answers

Improve computation time of numerous binomial processes in hierachical model (openbugs/winbugs)

I am currently developing a hierarchical bayesian model in Openbugs that involves a lot (about 6000 sites) of binomial processes. It describes successive removal electric fishing events/pass and the general structure is as follow: N_tot[i]<-d[i] *…
0
votes
1 answer

R - OpenBugs - Multiple Definitions on Node Error - Custom Distribution

I am relatively new to R and OpenBugs and have spent a lot of time troubleshooting this model. I have been able to figure out a fair amount of them on my own through resources online, but I am stuck on this error. It says that are "multiple…
0
votes
2 answers

WinBUGS error: vector valued relation z must involve consecutive elements of variable

I am trying to model a multivariate Probit model for my binary data. I have been trying everything but WinBUGS in return gives me this error. Any ideas or suggestion are warmly welcomed. model{ for (i in 1:ns){ ## loop over studies for (k in…
statsmess
  • 1
  • 3