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

learn more… | top users | synonyms

0
votes
0answers
7 views

Categorical variable in WinBUGS, OpenBUGS [migrated]

I am using a script from the following paper (Zipkin, E.F., Royle, J.A., Dawson, D.K., Bates, S., 2010. Multi-species occurrence models to evaluate the effects of conservation and management actions. ...
0
votes
0answers
4 views

WinBUGS - sample from the posterior of exponential distributed survival times

as introduction to WinBUGS, I want to simulate the posterior of the Gamma-Exp-Model. Because the posterior is known, I can varify the result. But the true posterior is always shifted to the right. I ...
0
votes
0answers
6 views

Expected count in Winbug

I have mortality count and total population of each counties of three states for 5 years. I want to get the expected count of mortality at each county and year to input in the Winbug. I wonder how ...
2
votes
1answer
92 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 ...
0
votes
0answers
6 views

Zero-inflated negative binomial non-integer error [migrated]

I am fitting ZINB in WinBugs using R2Winbug and this is WinBugs model code: ...
1
vote
0answers
184 views

Bayesian modelling, measurement error & carrying-over posterior distributions

I have a (fairly convoluted, but well-inentioned) model in my head, and am trying to figure out if it's possible to code (I am currently getting to grips with R2WinBUGS). The final model is basically ...
0
votes
0answers
75 views

WinBUGS/JAGS code for calculating Bayesian p-value from negative binomial model

I have a working negative binomial model written in BUGS code, but am not sure about the appropriate Bayesian p-value code to test goodness of fit. Specifically, I would like to calculate Pearson's ...
0
votes
0answers
20 views

HELP: Bayesian Multi-level model with seasonality

I am trying to define a Bayesian Multi-level model which has seasonality in BUGs. I have defined the model (below).I have attached a graphical representation of what im trying to model. eventually ...
1
vote
1answer
69 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
80 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: ...
0
votes
2answers
68 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
20 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 ...
0
votes
0answers
33 views

Bayesian Time Series Analysis Source

Is anyone able to recommend a source that covers Bayesian time series analysis in Winbugs?
3
votes
1answer
34 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 ...
0
votes
0answers
86 views

Define precision matrix from covariance matrix WinBugs

I have a 2X2 covariance matrix C with known means c0xx,c0xy,c0yx,c0yy and variances ...
2
votes
0answers
76 views

Defining prior on variance and not precision

I know that WinBugs uses precision as a parameter in dnorm instead of variance ...
0
votes
0answers
42 views

find posterior distribution parameters by simulation

I've calculated the posterior distribution parameters of a variable X analytically and by simulation. But doesn't mach. X ~ Normal(mu,s=6).And the prior distribution of X is a Normal(mu=100,s=20). As ...
0
votes
0answers
20 views

Different results from quasipoisson models when using glm and winbugs

I used glm and winbugs to estimate quasipoisson models. I think the results should be very similar theoretically but they are not. Coefficients from winbugs are quite larger than those from glm. Does ...
0
votes
1answer
68 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
112 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 ...
0
votes
0answers
168 views

Estimating NA values in WinBUGS model

I am trying to fit a WinBUGS model with missing (NA) values as part of the input data. I'd like to use WinBUGS to generate missing estimates for the NA values from the full conditional distributions ...
1
vote
1answer
58 views

winbugs multiple definition of node [duplicate]

I wrote this code in WinBUGS but I cant run it! It says 'multiple definitions of node tau' ...
0
votes
0answers
122 views

Wishart distribution in BUGS with prior on the scale matrix

I am attempting to sample from a wishart in WinBUGS where the scale matrix has priors on the entries. dwish() in WinBUGS won't allow this, so I am attempting to ...
1
vote
0answers
50 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 ...
0
votes
1answer
386 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, ...
0
votes
1answer
39 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 ...
4
votes
0answers
220 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 ...
0
votes
0answers
55 views

Simulation m values from posterior distribution with WinBUGS

I try to simulate from posterior distribution with WinBUGS. My data came from Multinomial distribution, i.e. : $y_i~\text{Multi}(n;p_1,p_2,p_3)$. A common prior for multinomial is Dirichlet, i.e.: ...
0
votes
0answers
169 views

Simulation from Dirichlet distribution with WinBUGS

I have a question. Now I am learning WinBUGS, doing bayesian statistics. How, can I simulate a Dirichlet distribution (which is the posterior, for my model ...
1
vote
0answers
409 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 ...
8
votes
2answers
555 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 ...
2
votes
0answers
90 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
118 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
69 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 ...
1
vote
0answers
177 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
55 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
111 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 ...
1
vote
0answers
16 views

WinBUGS sript: display correlation [closed]

Does anybody know if it is possible to display the correlation matrix using WinBUGS script? (with the GUI it can be found in th Inference menu -> correlations -> print) Thank you everybody!
2
votes
0answers
338 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 ...
2
votes
0answers
58 views

Truncated normal in WinBUGS

I want to use the following truncated normal distribution in WinBUGS to estimate parameters of SEM using Bayesian analysis. ...
1
vote
0answers
65 views

Inverse normal distribution in winbugs

I want to use the inverse normal distribution in winbugs but I don't find it there. Please help me to find a solution. I have here truncated normal distribution for y ...
4
votes
2answers
202 views

Joint prior distributions in WinBUGS

Suppose we have a hierarchical model summarised by the following: $y_{i} \sim N(\mu_{i}, \sigma^{2})$, for $i = 1, \ldots, n$; (For these purposes, assume $\sigma^{2}$ is known) where $\mu_{i} = ...
2
votes
0answers
56 views

How to make WinBUGS close when “Trap” occurs [closed]

I'm using R2WinBUGS to process several datasets in WinBUGS in "batch mode". Occasionally traps occur, mainly due to bad parameters (I guess), and I managed to avoid ...
2
votes
0answers
974 views

WinBUGS/OpenBUGS Gamma distribution parameters [closed]

According to the WinBUGS manual the gamma distribution is defined by: dgamma(r,mu) However, what is r? Is it the shape, scale ...
1
vote
1answer
139 views

Specification of logical node (with distribution?) in WINBUGS

For a piece of homework I have an assignment using WINBUGS which I must admit confuses me to say the least. Tangential to my question but I have a few stochastic nodes that are to be gamma ...
1
vote
1answer
155 views

JAGS burn-in phase takes ZERO time? [duplicate]

My breath was taken away by this. I tried to run my JAGS model with different number burn-in samples but it still takes the same amout of time!! ...
5
votes
0answers
499 views

CAR spatial models in JAGS

WinBUGS comes with the GeoBUGS add-on, which contains a number of predefined model structures that are suitable for modelling spatial data structures e.g. geostatical structures (spatial.exp), ...
0
votes
1answer
318 views

Undefined real result in a zero-inflated negative binomial

I have run a zero-inflated Poisson model in WinBUGS without problems, and now I am trying to run its equivalent negative binomial. However, I get an "undefined real result" trap message over and over. ...
1
vote
1answer
765 views

Estimation of the shape parameter of gamma distribution in Winbugs

I want to estimate the shape parameter of gamma distribution in Winbugs. I select gamma distribution as prior for shape parameter. Data set is generated using MATLAB as: ...