Questions tagged [winbugs14]

Questions about BUGS language for defining Bayesian models that can be run by the WinBUGS software package. It is advised to supplement your question with a reproducible BUGS example (https://stackoverflow.com/q/5963269); for statistical questions please use crossvalidated.com.

WinBUGS

WinBUGS is a software program for Bayesian analysis of complex statistical models using Markov chain Monte Carlo (MCMC) methods. WinBUGS implements the BUGS language for defining Bayesian models. WinBUGS was created by Dave Lunn, Andrew Thomas, Nicky Best, and David Spiegelhalter in 1996. In 2007 the last stable version (1.4.3) was released. Thereafter development focused on the OpenBUGS project.

Official WinBUGS Documentation

Other Documentation

41 questions
13
votes
3 answers

How can I convert an mcmc.list to a bugs object?

I am using the rjags R library. The function coda.samples produces an mcmc.list, for example (from example(coda.samples)): library(rjags) data(LINE) LINE$recompile() LINE.out <- coda.samples(LINE, c("alpha","beta","sigma"),…
David LeBauer
  • 31,011
  • 31
  • 115
  • 189
8
votes
2 answers

WinBUGS Weibull Network Meta-Analysis

I am currently working on a meta-analysis of survival data across several clinical trials. To do this, I have code from a published analysis using the same methodology. However, when running this code using the data from the published analysis, I…
jrdnmdhl
  • 1,935
  • 18
  • 26
6
votes
1 answer

R2WinBUGS - logistic regression with simulated data

I am just wondering whether anyone has some R code that uses the package R2WinBUGS to run logistic regression - ideally with simulated data to generate the 'truth' and two continous co-variates. Thanks. Christian PS: Potential code to generate…
cs0815
  • 16,751
  • 45
  • 136
  • 299
6
votes
0 answers

Decoding a Trap - "Index Out of Range" Message in WinBUGS

I've been tasked with re-running someone else's model with updated data (I did the data update and formatting). I understand how the model works but didn't write it, and it's quite long and detailed. On top of that, I exclusively use JAGS and this…
stewart6
  • 259
  • 2
  • 4
  • 15
6
votes
1 answer

OpenBUGS fails to converge on model that converges in WinBUGS. Precision limit?

As the title of this post says, when I try to run code and data that work fine in WinBUGS from R using BRugsFit (with coda=T), I get these errors: Error in glm.fit(x = structure(c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, : NA/NaN/Inf in foreign…
bokov
  • 3,444
  • 2
  • 31
  • 49
5
votes
2 answers

How to obtain the full marginal distribution of a parameter in stan

when starting a standard example from the stan webpage like the following: schools_code <- ' data { int J; // number of schools real y[J]; // estimated treatment effects real sigma[J]; // s.e. of effect estimates } …
Seb
  • 5,417
  • 7
  • 31
  • 50
4
votes
1 answer

OpenBUGS: missing value in Bernoulli distribution

I'm trying to model the observation "time" as random variable with OpenBUGS via R (R2OpenBUGS). If all the observation times are available (no NA's) everything works, but if I set one of the times to NA, nothing happens. I tested the same code with…
Jouni Helske
  • 6,427
  • 29
  • 52
4
votes
1 answer

R2WinBUGS - how to reload the WinBUGS computation results to bugs object again

I have run a looong computation in WinBUGS (million iterations) using the R2WinBUGS package from within R: bugs.object <- bugs(...) but the R crashed. How do I reload the bugs.object into R again without running winbugs again? I tried this (I have…
Tomas
  • 57,621
  • 49
  • 238
  • 373
4
votes
3 answers

JAGS - hierarchical model comparison not jumping between models even with pseudopriors

I'm using the hierarchical modelling framework described by Kruschke to set up a comparison between two models in JAGS. The idea in this framework is to run and compare multiple versions of a model, by specifying each version as one level of a…
Tim
  • 69
  • 6
3
votes
3 answers

R2WinBUGS - Warning messages

I am trying to use R2WinBUGS using this example: code (Please only consider the part: ### 5.4. Analysis using WinBUGS) I am getting this error message: Error in file(con, "wb") : cannot open the connection In addition: Warning messages: 1: In…
cs0815
  • 16,751
  • 45
  • 136
  • 299
3
votes
0 answers

WinBUGS Code for Bayesian hierarchical model

I’m reading this paper (which aims to model the nanowires (NW) growth using a Bayesian hierarchical approach). In page 7, the author proposed a model to describe the growth of nanowires. I’m trying to write a WinBUGS code (Please see below), but I’m…
user9292
  • 1,125
  • 2
  • 12
  • 25
3
votes
3 answers

Interpreting WinBUGS traps and how to automate the program?

First of all, does anybody know of a developer's guide for WinBUGS? The website is full of detailed examples for Doodles and documentation for the model language, but I have yet to find anything about how to interpret trap windows. Secondly, has…
bokov
  • 3,444
  • 2
  • 31
  • 49
2
votes
1 answer

How to obtain multinomial probabilities in WinBUGS with multiple regression

In WinBUGS, I am specifying a model with a multinomial likelihood function, and I need to make sure that the multinomial probabilities are all between 0 and 1 and sum to 1. Here is the part of the code specifying the likelihood: e[k,i,1:9] ~…
Sprog
  • 75
  • 6
2
votes
2 answers

"Array index is less than one" error at Winbugs

I am working on a multilevel differential item functioning model using WinBUGS package. I have successfully built simpler models, but I have also gotten the error "array index is less than one". I'd be very pleased if you could help. # Model …
sibel
  • 25
  • 1
  • 6
2
votes
1 answer

Automation of WinBUGS from R

I have a question related to the R Code which calls BUGS. I have run the model in WinBUGS and it runs fine giving me the expected results. Below is the automation code used when I had single outcome or univariate data for Y’s. Now I want to use it…
user1560215
  • 227
  • 1
  • 13
1
2 3