Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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).

0
votes
0answers
3 views

ZINB error code in winbugs: order of negative binomial y[1] must be an integer [migrated]

I have a problem while running ZINB regression using Winbugs, it keeps showing "order of negative binomial y[1] must be an integer" when I click "gen inits" in the Specification Tool tab. This is my ...
0
votes
0answers
3 views
0
votes
0answers
27 views

Bayesian model initial values impact posterior values

I using Winbugs and having trouble getting the model to converge, but I think real question is understanding what is going on with the bayesian model and the initial values which is why I post on ...
0
votes
1answer
200 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: <...
1
vote
1answer
33 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 ...
2
votes
0answers
42 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(\...
0
votes
0answers
161 views

How to obtain the posterior predictive p-value in WinBUGS

I want to assess the goodness-of-fit of a model in WinBUGS. As part of this, I want to calculate the posterior predictive p-value, which should be around 0.5 if the model is a good fit to the data. I ...
2
votes
1answer
75 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....
0
votes
0answers
24 views

How to interpret low posterior probability of covariate's positive or negative association?

I am using the following model in WINBUGS to run a hierarchical Bayesian regression where the beta are my covariates: If I modify this model by adding the ...
0
votes
0answers
42 views

How to validate Bayesian hierarchical (mixed) model ?

I am new to Bayesian analysis and using the following WINBUGS example to understand Bayesian hierarchical modeling: This is a 'mixed' model with both fixed effects (covariates given by 'beta' terms) ...
1
vote
1answer
61 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 ...
0
votes
1answer
70 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] } ...
0
votes
0answers
8 views

Winbugs Criterion

Suppose that we have two general linear models $(M_{1})$ (an additive) and $(M_{2})$ (an multiplicative) .For each of them we use winbugs and calculate DIC in order to compare and find the best model. ...
1
vote
1answer
150 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 ...
2
votes
0answers
121 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: ...
0
votes
1answer
996 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 ...
1
vote
1answer
50 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 ...
0
votes
1answer
319 views

Winbugs beta distribution

I have fitted a likelihood function with a dbeta function in WinBUGs as follows ...
0
votes
0answers
83 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 ...
1
vote
2answers
1k 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 ...
0
votes
1answer
53 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 ...
1
vote
1answer
835 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
1answer
169 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 ...
1
vote
1answer
2k 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 ...
1
vote
0answers
72 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 ...
10
votes
1answer
1k 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 ...
3
votes
0answers
472 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 ...
2
votes
1answer
685 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 (...
1
vote
1answer
848 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 ...
1
vote
0answers
574 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: ...
1
vote
2answers
129 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: ...
1
vote
0answers
55 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 ...
5
votes
1answer
419 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 ...
3
votes
2answers
813 views

Defining prior on variance and not precision

I know that WinBugs uses precision as a parameter in dnorm instead of variance ...
1
vote
1answer
675 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: ...
4
votes
1answer
317 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 ...
1
vote
1answer
483 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' ...
1
vote
0answers
148 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 ...
1
vote
1answer
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, ...
1
vote
1answer
71 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 ...
6
votes
0answers
714 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 ...
1
vote
0answers
1k 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 ...
14
votes
2answers
2k 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 ...
3
votes
0answers
187 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: ...
1
vote
0answers
578 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 ...
1
vote
0answers
207 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 ...
2
votes
0answers
758 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 ...
1
vote
0answers
209 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 ...
1
vote
0answers
214 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 ...
2
votes
0answers
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/...