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
0 votes
0 answers
15 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 ...
user avatar
1 vote
1 answer
41 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 ...
user avatar
2 votes
1 answer
197 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 ...
user avatar
  • 43
0 votes
1 answer
536 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 ...
user avatar
  • 23
0 votes
0 answers
310 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 ...
user avatar
  • 115
1 vote
0 answers
41 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 (...
user avatar
  • 113
3 votes
2 answers
304 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 ...
user avatar
  • 877
0 votes
1 answer
699 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: <...
user avatar
  • 289
1 vote
1 answer
113 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 ...
user avatar
  • 289
1 vote
0 answers
130 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(\...
user avatar
2 votes
1 answer
261 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....
user avatar
  • 289
1 vote
1 answer
165 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 ...
user avatar
  • 289
0 votes
1 answer
434 views

How to identify prior for the precision parameter in Winbugs

I have the following model: model{ for (i in 1:n){ y[i] ~dnorm(mu[i], tau) mu[i] <- a + b*x[i] } ...
user avatar
2 votes
1 answer
323 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 ...
user avatar
  • 41
2 votes
0 answers
314 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: ...
user avatar
  • 21
2 votes
1 answer
2k 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 ...
user avatar
  • 25
1 vote
1 answer
103 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 ...
user avatar
  • 111
0 votes
1 answer
467 views

Winbugs beta distribution

I have fitted a likelihood function with a dbeta function in WinBUGs as follows ...
user avatar
0 votes
0 answers
148 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 ...
user avatar
2 votes
2 answers
3k 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 ...
user avatar
0 votes
1 answer
76 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
338 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 ...
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 ...
user avatar
  • 47
1 vote
0 answers
84 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 ...
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 ...
user avatar
3 votes
0 answers
640 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 ...
user avatar
4 votes
1 answer
1k 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 (...
user avatar
  • 873
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 ...
user avatar
1 vote
0 answers
698 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: ...
user avatar
1 vote
2 answers
170 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: ...
user avatar
  • 151
1 vote
0 answers
69 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 ...
user avatar
  • 1,817
5 votes
1 answer
830 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 ...
user avatar
  • 1,817
3 votes
2 answers
2k views

Defining prior on variance and not precision

I know that WinBugs uses precision as a parameter in dnorm instead of variance ...
user avatar
2 votes
1 answer
1k 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: ...
user avatar
  • 5,835
5 votes
1 answer
547 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 ...
user avatar
  • 5,835
1 vote
1 answer
738 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' ...
user avatar
1 vote
0 answers
207 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 ...
user avatar
  • 161
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, ...
user avatar
  • 21
1 vote
1 answer
146 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 ...
user avatar
  • 161
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 ...
user avatar
  • 751
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 ...
user avatar
  • 1,061
17 votes
2 answers
3k 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 ...
user avatar
  • 25.9k
3 votes
0 answers
214 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: ...
user avatar
  • 131
1 vote
0 answers
681 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 ...
user avatar
1 vote
0 answers
275 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 ...
user avatar
  • 11
2 votes
0 answers
926 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 ...
user avatar
2 votes
0 answers
252 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 ...
user avatar
  • 1,061
1 vote
0 answers
264 views

Multigroup Longitudinal Item Response WinBUGS OpenBUGS

I was able to fit the Longitudinal IRT model in Winbugs for an ordinal response by extending the BUGS code I took from the paper by Curtis in JSS http://www.jstatsoft.org/v36/c01/paper/ However, I am ...
user avatar
2 votes
0 answers
2k views

Dummy coding from a Bayesian point of view

If we want to use categorical variables in regression context, we are allowed to use dummy codings such as these schemes. Is this also required in a Bayesian (MCMC) context, such as with WinBUGS/...
user avatar
  • 141