The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
0answers
20 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 (...
0
votes
0answers
12 views

How to form input parameters for global time trend CAR prior from spatial map (WINBUGS)?

I have a spatiotemporal model found here. In this model, car.normal is used twice, one for spatial areal units: ...
0
votes
0answers
8 views

Pseudo T-stat in Winbugs?

I am trying to obtain the "Pseudo T-stat" in Winbugs for a Poisson Log-normal model. Any suggestion of how can I get that.
0
votes
0answers
39 views

Winbugs code multivariate hierarchical Poisson Log-normal CAR model

I am looking for some example code to develop multivariate hierarchical Poisson Log-normal CAR model using Winbugs. Can anyone help me with similar reserach that added their code? Also, how can I ...
2
votes
2answers
97 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 ...
0
votes
0answers
47 views

Simulating data in JAGS “ones trick”

I am trying to simulate data to use for posterior predictive checks in JAGS running through R, which is relatively simple for pre-loaded distributions, but I am looking to simulate data when I have ...
0
votes
0answers
5 views

How does RJags handle situations in which we have a constraint on combined parameters, but the parameters may take on values outside the constraints?

Suppose we have the following model for the difference in two proportions from a binomial. ...
0
votes
1answer
278 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
54 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
54 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(\...
2
votes
1answer
89 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....
1
vote
1answer
70 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
120 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] } ...
1
vote
1answer
180 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
161 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
1k 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
52 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
355 views

Winbugs beta distribution

I have fitted a likelihood function with a dbeta function in WinBUGs as follows ...
0
votes
0answers
97 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
2k 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
61 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
975 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
183 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
3k 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
77 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 ...
12
votes
1answer
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 ...
3
votes
0answers
510 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
776 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
939 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
599 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
133 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
499 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
929 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
791 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
339 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
522 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
157 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
79 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
757 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 ...
16
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
191 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
600 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
223 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
804 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
230 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
222 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/...