Questions tagged [winbugs]

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

247 questions
4
votes
1 answer

R2WinBUGS error in R

I'm trying to duplicate some code and am running into troubles with WinBUGS. The code was written in 2010 and I think that back then, the package was installed with additional files which R is now looking for and can't find (hence the error), but…
Maya Hadar
  • 41
  • 1
  • 2
4
votes
0 answers

Why am I getting "Error in handleRes(res) : NA" when running bugs() with syntactically correct model?

I'm trying to run a bayes model through R using R2WinBugs and BRugs but running into an error which I cannot solve. I've checked that my model is syntactically correct, and this is the output from when I try running (example below): model is…
Polly
  • 41
  • 4
4
votes
0 answers

JAGS - unable to find appropriate sampler

I am trying to develop a hierarchical Dirichlet-multinomial process hidden Markov model in JAGS to estimate multiparty, primary voting intention based on opinion poll results. I also use the primary vote estimate to calculate a two-party preferred…
Mark Graph
  • 4,969
  • 6
  • 25
  • 37
4
votes
0 answers

Comparing two biased coins (newbie example from Kruschke book)

I'm an absolute newbie to Bayesian stats and MCMC, so I'm working my way through "Doing Bayesian Data Analysis: A Tutorial with R and BUGS" by John Kruschke. To test my understanding, I'm trying to translate his examples from BUGS to PyMC. In Ch.…
Ian Davis
  • 41
  • 2
4
votes
1 answer

Dirichlet-Multinomial WinBUGS code

I'm trying to code a dirichlet-multinomial model using BUGS. Basically I have 18 regions and 3 categories per region. In example, Region 1: 0.50 belongs to Low, 0.30 belongs to Middle, and 0.20 belongs to High. The list goes on to Region 18 of…
user3764358
  • 41
  • 1
  • 2
4
votes
1 answer

Multiple definitions of node winbugs

I have some problem with this code in winbugs. The model is sintatically correct and data are loaded, but when I compile, software output is "multiple definitions of node Z". I don't know how to solve the problem. This is the model: #BUGS…
mina
  • 55
  • 7
4
votes
1 answer

OpenBUGS Code gives error 'expected a comma'

I am trying to fit a hierarchical model using OpenBUGS, with the following code: model { for( i in 1:n){ tausq[i] <- 1/pow(sigma[i], 2) psi[i] ~ dnorm(psi, tausq) psihat[i] ~ dnorm(psi[i], tausq[i]) } psi ~ dnorm(0, 1000) tausq ~…
Kyle N Payne
  • 79
  • 11
4
votes
1 answer

WINBugs: array index is greater than array upper bound

I need help to find the error in my WINBUGS code (v. 1.4.3). While in the "Model Specification" step, the model looks syntatically correct. However, in my attempt to load the data, I got this error: array index is greater than array upper bound for…
Camila Mendes
  • 107
  • 2
  • 6
4
votes
1 answer

What's wrong with this WinBUGS model

I used Winbugs from R via R2WinBUGS and BRugs package, I write the model and try to run it, but the result didn't come out, and I read the WinBUGS log, seems nothing got wrong. Here is the model: require(BRugs) require(R2WinBUGS) # MCMC…
PepsiCo
  • 1,399
  • 4
  • 13
  • 18
3
votes
0 answers

Error Message Slicer stuck at value with infinite density

I am still green in handling Bayesian methods. In a bit to run Bayesian Analysis with a random effect on a real data , I encountered the following error "slicker stuck at value with infinite density", I tried altering the starting values of the…
mymymine
  • 49
  • 7
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

The pow() operator in JAGS/BUGS

This is probably unimportant, but something I've been curious about for a while. When constructing a model in JAGS/BUGS, I was initially taught to handle power transformations using the pow() function (e.g. tau <- pow(sigma, -2) to convert from a…
Matt Tyers
  • 2,125
  • 1
  • 14
  • 23
3
votes
2 answers

Translating WinBUGS model to JAGS (using R)

I am trying to implement the following model written for WinBUGS in JAGS: model { for (i in 1:N) { wtp[i] ~ dweib(r[G[i]], mu[i])I(lower[i], upper[i]) mu[i] <- exp(beta[G[i]]) G[i] ~ dcat(P[]) } …
johnson-shuffle
  • 1,023
  • 5
  • 11
3
votes
1 answer

A simple model in Winbugs but it says "This chain contains uninitialized variables"

I have some simple time to event data, no covariates. I was trying to fit a Weibull distribution to it. So I have the following code. Everything looks good until I load my initials. It says "this chain contains uninitialized variables". But I don't…
3
votes
0 answers

Slow sampling of STAN compared to BUGS

I am trying to make a switch from WinBugs to Stan, since I like the programming language and usage in R is better for Stan than WinBugs. I recoded my hierarchical Bayesian model to the Stan language, and applied all recommended settings I found on…
Aron
  • 31
  • 2
1
2
3
16 17