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
1
vote
0 answers

R2openbugs bugs() winepath error: No such file or directory

My mac system is OS X El Capitan 10.11.6. I installed OpenBUGs using Winebottler(version 1.8.6) and Wine. When I tried to call OpenBUGS using R, the following error occurred: sh: /opt/local/bin/winepath: No such file or directory Error in…
Zoe.J
  • 11
  • 2
1
vote
1 answer

"expected right parenthesis error pos" using OpenBUGS

I'm trying to run a simple linear regression analysis using "R2OpenBUGS" package in R. when i run the "bugs" command, i face with error. After adding "debug = T" to the command line, i get this error in OpenBUGS: expected right parenthesis error pos…
M. white
  • 80
  • 7
1
vote
0 answers

Wishart Prior in OpenBUGS

I am currently working on an OpenBUGS code regarding bivariate normal distribution. The distribution uses a Wishart prior for precision, and I am having some troubling when updating the model. My model will load, and it does compile with my data.…
Oliver
  • 11
  • 1
1
vote
1 answer

Coverting OpenBUGS code to PYMC3

I have previously been working with OpenBUGS/WinBUGS to perform my Bayesian statistics but have decided to move over to using the PYMC3 package in Python. So I am fairly new to the pacakage and still learning how to use it fully. I am having some…
A.Cosmo
  • 11
  • 3
1
vote
1 answer

print DIC in R2OpenBUGS

I'm working in "R2OpenBUGS" in R. I have some mcmc chain: mcmc <- bugs(data = ... DIC=TRUE ... codaPkg=TRUE) My question is how to print DIC when codaPkg = TRUE. If codaPkg = FaLSE, then if I just do print(mcmc), it prints the DIC value at the end.…
Babak
  • 497
  • 1
  • 7
  • 15
1
vote
0 answers

Internal "trap" error in OpenBUGS

I am having trouble with setting up a multivariate normal (MANOVA-like) regression in OpenBUGS on R version 3.3.2 (2016-10-31), Platform: x86_64-pc-linux-gnu (64-bit), Running under: Ubuntu 14.04.5 LTS. My model is: model { ### Likelihood for(i…
1
vote
0 answers

modelCompile function runs forever in BRugs (Open Bugs)

I am running a model using the BRugs package in R for Bayesian inference. The model is syntactically correct and the data loads, however the modelCompile function runs forever, I stopped it after 15 hours, but I don't know what the problem could…
1
vote
0 answers

Array index is not an integer error in OpenBUGS

I am trying to run a Markov model in OpenBUGS to estimate the transitional probabilities. But I am geeting an error "Array index is not an integer" Here is my model code: model{ p[1,1] ~ dnorm(0,1) p[2,2] ~ dnorm(0,1) p[3,3] ~ dnorm(0,1) p[1,2] ~…
Ecology
  • 55
  • 5
1
vote
0 answers

how do to Xb calculation in R2OpenBUGS, when p is not known

I want to calculate x1b1+x2b2+......+xpbp. However, p is not known, I cannot write it down in advance. So I want to do the following. But in BUGS it says multiple definitions error. betax <- 0 for(k in 1:p){ betax <- betax + beta[k]*x[i,k] …
Leo
  • 23
  • 3
1
vote
0 answers

OpenBugs error: expected the collection operator c error pos 7515

I am trying to evaluate hierarchical models from R using the R2OpenBUGS library. I've already looked at the answers to similar questions, but nothing seemed to work. I'd be very pleased if someone could help. The model is the following. model{ for…
1
vote
1 answer

R2OpenBUGS - several problems with matrices, list and vectors

I am new to R2OpenBUGS and the very enigmatic errors are quite frustrating. I try to run a model that is quite simple. I had success running similar models before. Are my problems from the fact that I have a 2-dimensional array (matrix) ? I tried…
RemiDav
  • 463
  • 3
  • 16
1
vote
1 answer

R2OpenBUGS rounding DIC to 4 significant digits

I am using R2OpenBUGS to look at many different models, and I noticed that every reported DIC has at most 4 significant digits. This seemed suspicious, so I set DEBUG=TRUE and sure enough, DIC = pD + Dbar is being rounded. Why is this? Can I tell…
Alex
  • 11
  • 3
1
vote
1 answer

OpenBUGS - Variable is not defined

I'm using the following code in OpenBUGS to perform an analysis: model { for(i in 1:467) { probit(p[i])<-gamma0+gamma1*drug[i]+gamma2*CD41[i] R[i]~dbern(p[i]) junk[i]<-ID[i] } gamma0~dnorm(0,.0001) gamma1~dnorm(0,.0001) gamma2~dnorm(0,.0001) } ID[]…
Ryan Warnick
  • 1,079
  • 2
  • 10
  • 15
0
votes
0 answers

Is there any reliable prior distribution/method for estimating parameter of Weibull Proportional Hazard (PH)

I'm trying to estimate a Weibull PH model using the OpenBUGS algorithm but encounter with some problem on the result of the estimated parameter. The reason for writing this algorithm is because I will extend this study into other PH model that use…
0
votes
0 answers

How to open WinBUGS .odc file in OpenBUGS and import to R

I'm trying to open and test the examples from Lee's (2007) Structural Equation Modeling: a Bayesian Approach. The zip file contains a PDF, a DAT file and a file in with .odc suffix for each chapter. I'm interested in accessing the content of the…
Pål Bjartan
  • 793
  • 1
  • 6
  • 18