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 (http://stackoverflow.com/q/5963269).

Filter by
Sorted by
Tagged with
1 vote
2 answers
66 views

Missing data imputation in univariate meta analysis with binary data using WinBUGS

I want to impute missing data in univariate meta-analysis. My outcome (no. fractures) is a binary variable. Below is the WinBUGS code I have tried. The code is ...
M Attanayaka's user avatar
0 votes
0 answers
79 views

How to correctly include an offset in a bernouli model in JAGS/WINBUGS (Only one success, but number of choices can change)

I am trying to fit a Bernoulli model in Jags. This is for mate choice - whether a male interacts with a given female out of a selection of females. For the purpose of the model they only get one ...
Graham Birch's user avatar
1 vote
1 answer
63 views

Zero and One tricks for INLA?

The Zero and One tricks are used to sample from a model not included in the basic functions in BUGS: http://www.medicine.mcgill.ca/epidemiology/Joseph/courses/common/Tricks.html I have a general and ...
not that INLA's user avatar
1 vote
1 answer
77 views

how to overcome error while defining multiple loops for model specification in OpenBUGS?

I'm using following program for MCMC simulation. While compiling this code, I am getting error message which is multiple definition of node s[1]. I am not able to ...
Pulkit Srivastava's user avatar
2 votes
1 answer
698 views

How many chains should i run in winBUGS?

i am relatively new to winBUGS and i am running a meta-regression model for bayesian meta-analysis. This model tracks the posterior distributions of the parameters mean and tau-square. Moreover,which ...
Selly's user avatar
  • 43
0 votes
1 answer
875 views

How to correctly include offset in Bayesian Zero-Inflated Poisson model in winbugs

I am trying to fit a Bayesian Zero-inflated model and I want to include an offset term. When I compared the output of the pscl package; the result of the count model from the winbugs and pscl package ...
tk001's user avatar
  • 23
0 votes
0 answers
622 views

Posterior Predictive Check for Hierarchical Logistic Regression Model

I need to apply Posterior Predictive Check (PPC) on Hierarchical Logistic Regression Model (so I have binary outcome) to validate my model (to see goodness of fit of my model). I know that I need to ...
yer's user avatar
  • 125
2 votes
0 answers
49 views

Is there something wrong with my Bayesian hierarchical spatio-temporal model?

I built a Bayesian spatio-temporal model and one of the parameters to be estimated is the random spatial effects s. The random spatial effect is assigned an intrinsic conditional autoregressive prior (...
Outlier's user avatar
  • 123
3 votes
2 answers
662 views

Are "improper uniform priors" in Bayesian analysis equivalent to maximum likelihood estimations?

The improper uniform distribution for parameter $\theta$ is : $p(\theta)=1,\ for -\infty<\theta<\infty$. It is called "improper" since it does not integrate to 1. Because Bayesian theorem is ...
T X's user avatar
  • 1,017
0 votes
1 answer
933 views

How to interpret Zero-Inflated Poisson in WINBUGS?

I have Winbugs code for a zero-inflated Poisson (ZIP) model. I obtained this code from my lab at university and the person who wrote it is not accessible for me to ask questions. Here is the code: <...
user121's user avatar
  • 309
2 votes
1 answer
150 views

How to interpret zero-inflation model for Bayesian regression?

I am trying to understand the zero-inflated poisson (ZIP) model used in Bayesian regression modelling. I came across code here for the ZIP model. My question is related to the 3rd line of code within ...
user121's user avatar
  • 309
1 vote
0 answers
198 views

How to specify a new joint prior distribution restricted to (0,1) interval in WinBUGS?

I am doing some Bayesian analysis in OpenBUGS and I need to specify a joint prior distribution for parameters $\gamma_1$ and $\gamma_2$ (the Jeffreys prior related to my model), such that $$\pi(\...
Guilherme Oliveira's user avatar
2 votes
1 answer
352 views

How does WINBUGS determine the posterior density of a parameter with multiple chains?

I am a new user to WINBUGS. I am running a model with 2 chains. When my model has finished running I have the following posterior density plot of my parameter: The plot only shows one distribution (i....
user121's user avatar
  • 309
1 vote
1 answer
320 views

How do interpret a vague prior for hierarchical modeling?

I am new to Bayesian analysis and using the following WINBUGS example to understand Bayesian hierarchical modeling: I have 2 questions: 1) For the fixed effects terms, i.e., the beta0 and beta1 ...
user121's user avatar
  • 309
0 votes
1 answer
815 views

How to identify prior for the precision parameter in Winbugs

I have the following model: ...
user3546966's user avatar
2 votes
1 answer
397 views

"Undefined real result" with inverse() function in WinBUGS

Using WinBUGS, I'd like to generate the posterior distribution for a function of several other variables (stochastic nodes). One step in building up this function involves taking the inverse of a ...
Sprog's user avatar
  • 41
2 votes
0 answers
387 views

How do I specify a random effect in Bayesian beta regression model?

My response data are proportions that I want to model with one continuous predictor and a random effect of group. Here's my winbugs code: ...
Desiree's user avatar
  • 21
2 votes
1 answer
3k views

How do I calculate the posterior predictive distribution in WinBUGS?

I would like to work out the posterior predictive distribution from the following multilevel (mixed effect) model in WinBUGS. The example is taken from an example I found online for illustrative ...
gemster's user avatar
  • 25
1 vote
1 answer
128 views

Winbugs fixed effects stats output: mean or median?

I am running a fixed effects hazard ratios model with WinBUGS and I can't tell if I've run into a potential problem. In the stats output, my mean and median are similar, but generally differ by ...
Tom's user avatar
  • 111
0 votes
1 answer
585 views

Winbugs beta distribution

I have fitted a likelihood function with a dbeta function in WinBUGs as follows ...
Adrian Santos's user avatar
0 votes
0 answers
185 views

Left or right skewed prior in WinBUGS

I am trying to find a proper way of defining a right or left skewed continuous (0...100) distribution for my priors in a simple linear regression. Furthermore, I expect to find some outliers in my ...
Adrian Santos's user avatar
3 votes
2 answers
4k views

Bayesian t-test assumptions

I know that the traditional independent t-test assumes homoscedasticity (i.e., equal variances across groups) and normality of the residuals. They are usually checked by using levene's test for ...
Adrian Santos's user avatar
0 votes
1 answer
107 views

Reference for modeling with WinBugs

Does anyone have any good reference for beginners in WinBUGS about modeling? I already have some familiarity with R, but I had never used R2WinBUGS before. I'm interested in making beta, beta ...
2 votes
1 answer
2k views

Learning WinBUGS programming for network meta-analysis

I'm currently interested in learning NMA using WinBUGS. I studied the general concepts behind multiple treatment comparisons and i have a good base on classic pair-wise meta-analysis. I can also do a ...
0 votes
1 answer
426 views

Simple explanation of a WinBUGS code

Can anyone give me a quick walkthrough of what this code is doing? I think the line log( mu[i] ) <- alpha + beta * (year[i]-1970) + log( pop[i] ) is updating ...
Jon's user avatar
  • 47
2 votes
1 answer
4k views

WinBUGS error - undefined real result

I am trying to run this WinBUGS code to get a prediction for the number of fatalities in 1975 ...
Jon's user avatar
  • 47
1 vote
0 answers
94 views

Change a random effects model into a fixed effects model in *BUGS

I want to manipulate this RE model into a FE model for sensitivity analysis. The model is described here: Baseline natural history model ...
Pharmaco economics's user avatar
12 votes
1 answer
2k views

Which is the best method for network meta-analysis?

There are now several different approaches to perform a network meta-analysis or mixed treatment comparison. The most commonly used and accessible ones are probably the following: in a Bayesian ...
Giuseppe Biondi-Zoccai's user avatar
3 votes
0 answers
763 views

Modeling quadratic function parameters as a function of variables

I'm modeling a response variable that varies seasonally. The pattern is relatively well described by a quadratic function. As the data have been collected over many (~50) years, I'm interested to ...
adamdsmith's user avatar
4 votes
1 answer
2k views

Priors for Truncated Parameters - RJAGS

I would like to estimate the parameters of a specific model. The model specification is as follows: $p_t = k_t + B_t/(1-B_t) + \eta_t$, where $ \eta_t \sim N(0, \sigma^2)$ $R_{t+1} = R_{t} + R_t (...
rbm's user avatar
  • 983
2 votes
1 answer
2k views

"Multiple definitions of node p[1]" Error using WinBUGS [closed]

I have written the following code in WinBUGS and every time I try to compile the data after loading in the data I get the same error which is "Multiple definitions of node ...
user70799's user avatar
1 vote
0 answers
783 views

code works in jags but not winbugs [closed]

I have band-recovery data from several areas, and am trying to get survival rates for adult and juvenile for each area. Brownie model is used. The model is: ...
Qing Zhao's user avatar
1 vote
2 answers
221 views

(Failure) probability calculation

I am working on mortality in 12 hospitals performing cardiac surgery in babies. The dataset is available here: Surg dataset. The dataset is structured in this way: ...
Fabio's user avatar
  • 153
1 vote
0 answers
80 views

OpenBUGS and coda library

I've fitted a hierarchical model with OpenBUGS using R2WinBUGS package of R. Now, I'd like to use the functions contained in the ...
John M's user avatar
  • 2,097
5 votes
1 answer
943 views

Can improper priors be implemented in some way?

I'm new to bayesian inference. I've just discovered that improper priors can't be specified in WinBUGS/OpenBUGS. I was wondering if this is common or not in bayesian inference. Are there same cases ...
John M's user avatar
  • 2,097
3 votes
2 answers
3k views

Defining prior on variance and not precision

I know that WinBugs uses precision as a parameter in dnorm instead of variance ...
user3706794's user avatar
2 votes
1 answer
2k views

Is multinomial the same as multiple binomial?

I wonder, if I write - in JAGS, WinBUGS, or in a paper: x[] ~ dmulti(p[], N) is it the same as if I write: ...
Tomas's user avatar
  • 6,133
5 votes
1 answer
603 views

How can regression trees be fit in WinBUGS/OpenBUGS/JAGS?

There is an R package called BayesTree which can fit regression trees in Bayesian environment. However, this way only simple regression is possible. I would like to use regression trees as a part of a ...
Tomas's user avatar
  • 6,133
1 vote
1 answer
790 views

WinBUGS: multiple definitions of node [duplicate]

I wrote this code in WinBUGS but I can't run it! It says 'multiple definitions of node tau' ...
blitzstat's user avatar
1 vote
0 answers
232 views

Confidence intervals of proportions for clustered data

I am trying to compute the proportion of "yes"'s in data that is clustered (participants within cities). If I ignore the cities, I get very nice and narrow confidence intervals. If I compute the ...
Brian's user avatar
  • 171
2 votes
1 answer
3k views

Undefined real result error at WinBUGS

I am currently working on my thesis and interested in estimating a multilevel differential item functioning model and I using at WinBUGS. Until I had done model check-up, there are no errors. However, ...
sibel's user avatar
  • 21
1 vote
1 answer
174 views

Measurements from two raters. Should I use multilevel/"random-effects" model?

I have several variables that were measured on patients, for most patients the variables of interest were measured by 2 independent "raters". Most of the variables are binary. I need to compute the ...
Brian's user avatar
  • 171
8 votes
0 answers
1k views

Is my OpenBUGS / WinBUGS model well specified?

I've just started trying to use OpenBUGS for Bayesian analysis of stochastic volatility models. In particular, I'm trying to calculate stochastic covariance, similar to the DC-MSV model specified by ...
ch-pub's user avatar
  • 771
2 votes
0 answers
2k views

What is the form of link function in this BUGS multinomial regression example?

The alligators example from openbugs examples repository is the same example that comes with winbugs. Basically this is a multinomial logistic regression example in which the outcome variable has 5 ...
mahonya's user avatar
  • 1,111
18 votes
2 answers
4k views

Bayesian estimation of $N$ of a binomial distribution

This question is a technical follow-up of this question. I have trouble understanding and replicating the model presented in Raftery (1988): Inference for the binomial $N$ parameter: a hierarchical ...
COOLSerdash's user avatar
  • 29.4k
3 votes
0 answers
226 views

Dawid Skene model for BUGS

I'm a beginner in BUGS. I'm trying to code the Dawid Skene model in BUGS. The model is as follows: Currently, I'm adapting the code from Stan, here. Here is the code: ...
v4r's user avatar
  • 131
1 vote
0 answers
729 views

Longitudinal data format in WinBUGS or OpenBUGS, different number of items per time point

I am working with longitudinal data, where there are a different number of "items" per time point. I am working with the MCMCdynamicIRT1d function in ...
user521500's user avatar
1 vote
0 answers
311 views

WinBUGS multinomial all parameters are random variables

everyone here. I want to use multinomial distribution, but p[] and N are all random. model is correct and data loaded , model compilied, but it can't still run , it says:value of binomial f[1] must be ...
Silvia's user avatar
  • 11
2 votes
0 answers
1k views

Zero trick in WinBUGS for truncation

I am using the Zero-trick to create a prior for correlation parameter. Data y is a bi-variate normal with covariance matrix with same diagonal elements and ...
Paramjit's user avatar
2 votes
0 answers
263 views

How are deterministic/logical nodes represented mathematically in directed graphical models?

Various software for performing inference on graphical models support logical(a.k.a deterministic) nodes. PyMc, Winbugs, Smile are the ones I'm aware of. Based on the different inference methods ...
mahonya's user avatar
  • 1,111