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
4
votes
0 answers

update / fix for InputChannel is not initialized android open bug?

Any update on the following Android open bug, 04-16 16:12:24.585 28935-28935/ssdsor.qusdse.kalsdsadrket E/AndroidRuntime: FATAL EXCEPTION: main Process: ssdsor.qusdse.kalsdsadrket, PID: 28935 java.lang.RuntimeException: InputChannel is not…
Subin Babu
  • 1,515
  • 2
  • 24
  • 50
3
votes
0 answers

openbugs generating inital values error

I have a model that I can run in winbugs but I get an error in openbugs when loading and generating initial values even when using the same code and the same data. When loading initial values in both winbugs and openbugs I get the message that the…
lg1
  • 31
  • 1
3
votes
1 answer

I have a code in OpenBUGS but the error is "variable CR is not defined"

model { for( i in 1 : N ) { dgf[i] ~ dbin(p[i],n[i]) logit(p[i]) <- a[subject[i]] + beta[1] * CR[i] } for (j in 1:94) { a[j]~dnorm(beta0,prec.tau) } beta[1] ~ dnorm(0.0,.000001) beta0 ~ dnorm(0.0,.000001) prec.tau ~…
Saeed
  • 31
  • 3
3
votes
0 answers

Strange Errors in my OpenBUGS code (using R2OpenBUGS)

I've written a Weibull survival code in OpenBUGS using the R2OpenBUGS package in R. After hours of debugging, I still get the errors below: this component of node is not stochastic Beta0[1] error pos 30 this component of node is not stochastic…
Sam
  • 4,357
  • 6
  • 36
  • 60
3
votes
1 answer

'expected a comma' error in OpenBUGS

I am trying to fit a model using OpenBUGS. Here is the code: model { # N observations for (i in 1:N) { y[i] ~ dbin(p.bound[i],1) p.bound[i]<-max(0,min(1,p[i])) logit(p[i])<-Xbeta[i] Xbeta[i] <-…
Ecology
  • 55
  • 5
2
votes
1 answer

How to dynamically create an openbugs model file (R, bash) given a set of model parameters

I am fitting a set of models using r2openbugs. This requires me to create a new model file for each model I try. I have a set of combinations that I want to test (different covariate sets, whether to include random effects, whether to calculate…
2
votes
1 answer

Specify logit function explicitly in WinBUGS/OpenBUGS

I'm new to OpenBUGS and I got some problem in fitting a model with the logit() function. Reading around I found that one possible solution for this would be explicit specify the logit function without using the WinBUGS’ own logit function: In…
Vincenzo G
  • 41
  • 5
2
votes
0 answers

Bayesian categorical-logistic model in R2OpenBUGS

I'm trying to fit a categorical-logistic model using the painters dataset contained in the MASS library. I divided the dataset in two parts, so i can predict in the future the values of School variable using the baseline category logistic…
2
votes
0 answers

OpenBUGS, can/should I change the RNG seed when (re)starting?

So I'm trying to fit a quite complex model using OpenBUGS from R using R2OpenBUGS, short runs of the model work, but longer runs fail. When I set debug = T in the bugs call in R2OpenBUGS the log says: sorry something went wrong in module…
2
votes
1 answer

Openbugs too many constants error

I'm trying to run the code below in which I used a zero trick for my log-likelihood expression(phi is my log-likelihood): model{ for (l in 1:k) { d.1[l] ~ dbern(p.1) d.2[l] ~ dbern(p.2) d.3[l] ~ dbern(p.3) d.4[l] ~ dbern(p.4) } for (l in 1:k)…
sciury
  • 21
  • 3
1
vote
0 answers

Failed to generate posterior samples in OpenBUGS

I am trying to calculate the Bayesian predictive probability P(P(Diff>0)>0.95), for two sample means. I assume the following (1) Standard deviation = 1.44 for both groups (2) mean 1 = 2.06, mean 2 = 1.34 so we expect to show a mean difference of…
Eric
  • 11
  • 1
1
vote
2 answers

How do I obtain Monte Carlo error in R2OpenBugs?

Has anyone managed to obtain a Monte Carlo error for a parameter when running bayesian model un R2OpenBugs? It is provided in a standard output of OpenBugs, but when run under R2OpenBugs, the log file doesn't have MC error.Is there a way to ask…
marina_esp
  • 13
  • 3
1
vote
0 answers

OpenBugs: invalid or unexpected token scanned

I keep getting the "invalid or unexpected token scanned", but I can't find the problem. Can someone help me, please? model { for (i in 1: n ) { dummy[i] <- 0 x [ i ] <- y [ i ] dummy[ i ] ~ dloglik (…
1
vote
1 answer

Problem loading in data from R to OpenBUGS?

I am trying to construct a data set in R and then load that into OpenBUGS to perform some bayesian analysis but am having difficulties in loading the data in. Here is my R code: library(BRugs) y <- c(16,9,10,13,19,20,18,17,35,55) m <-…
Brandon Barry
  • 61
  • 1
  • 6
1
vote
0 answers

Problem using inprod() to summarise linear predictor

I am having a problem when trying to summarise my aditive predictor: mu[j] <- b0 + weights1[1] * A[j] + weights1[2] * A[j+1] + weights1[3] * A[j+2] + weights1[4] * A[j+3] + weights1[5] * A[j+4] + weights1[6] * A[j+5] + weights1[7] * A[j+6] +…
IosuP
  • 11
  • 2
1
2 3 4