Questions tagged [bugs]

BUGS is an acronym for Bayesian inference Using Gibbs Sampling; BUGS is also a software package for doing this.

Filter by
Sorted by
Tagged with
0 votes
0 answers
25 views

Hiearchical Beta-Binomial model via rjags: How to draw posterior sample/do inference on posterior exactly?

I have the following code for bugs model which I want to use with rjags: ...
  • 11
1 vote
1 answer
30 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 ...
0 votes
1 answer
122 views

Jags: Attempt to redefine node error, mixed effect regression [closed]

I want to perform a mixed effect regression in rjags, with a random slope and intercept. I define the following toy dataset: ...
  • 211
0 votes
0 answers
30 views

Mean vs residual parameterization in JAGS / BUGS

I have two different versions of a state-space model in JAGS. Both yield equivalent inferences, but are wildly different in terms of run-time and convergence. The only difference between the two is ...
1 vote
0 answers
100 views

How to fit a mixture of 2D Gaussian in BUGS/JAGS?

I am trying to estimate the parameters of a mixture of 2D Gaussian distribution using JAGS. I first created two components from a multivariate normal distribution and then combined them to get a ...
1 vote
1 answer
48 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 ...
2 votes
1 answer
707 views

Bayesian p-value in wrong direction using step function in JAGS / BUGS

I have estimated a Weibull regression model in JAGS using rjags and R2JAGS. The estimated posterior predictive p-values using the step() function confuse me. They make sense (comparing them to lower ...
  • 85
3 votes
0 answers
348 views

How to specify a zero-inflated Dirichlet model in JAGS/BUGS

There was a recent publication discussing the advantages of the zero-inflated dirichlet for microbiome count data which is compositional (you are modeling a matrix of species relative abundance data ...
  • 1,122
0 votes
1 answer
373 views

Predict credible interval of Poisson-distributed response based on Lambda credible interval

I am approaching Bayesian inference. Could you review my steps and give me a hand with my model predictions? I am using a N-mixture model to predict how many individuals N of a rare species inhabit a ...
1 vote
2 answers
219 views

Framework for simulation study to validate bayesian models

I am looking for a framework that would allow to take JAGS/bugs model and on many sets of simulated data test if there is a bias (or not) in the parameter estimates (the real parameters would be known ...
  • 5,925
1 vote
0 answers
149 views

Random effects in ZIP or ZINB models - count portion, Bernoulli portion, or both?

I'm building some zero-inflated models that need to include random effects, and I can't find a definitive answer for whether I should include the random effects in the part of the model that describes ...
4 votes
1 answer
926 views

"Mixed effect" ANOVA in R with JAGS/BUGS

I would like to be able to code the following linear mixed model into a bayesian framework. In the traditional/frequentist view, the model would be coded like this: ...
2 votes
0 answers
314 views

Standard Deviations of Random Effects

I would have a question regarding the estimates of the random effects for a model fitted with JAGS. I want to fit a mixed model of the form: $$y_{ij}=\beta_{0j}+\beta_{1j}x_{ij}+\beta_2+e_{ij}$$ $$\...
2 votes
0 answers
346 views

Comparing the Widths of two Posterior Distributions

I have a question regarding the task of my term paper case study, which is about Bayesian multilevel modelling and I would greatly appreciate it, if you could help me out. The exact assignment reads ...
0 votes
1 answer
581 views

Cumulative link model in JAGS or BUGS [closed]

I'm trying to implement a cumulative link model in JAGS. My outcome variable (Likert-style questionnaire) has four categories. There is currently no predictor in the model, I will add them once the ...
1 vote
0 answers
119 views

Meaning of Intercept Parameter in a Bayesian Longitudinal HLM

I have been working through John Kruschke's excellent book on Bayesian Data Analysis but now have found myself in experimental-design territory not covered in the book: a longitudinal linear mixed-...
  • 1,483
3 votes
1 answer
128 views

Recovering noise-free variables in binary trials

I have a collection of $N$ different objects. An expert "looks" at the object $O_i$ and produces a prediction: binary label $y_i\in\{0,1\}$. The predicted binary label $y_i$ is observed (data) and is ...
0 votes
1 answer
1k views

Bayesian estimation of Dynamic Linear Models with RStan

I'm reading the Dynamic Linear Models with R book, where most of chapter 4 is devoted to bayesian estimation of parameters. They code most of it manually though, and it seems it can get quite tricky ...
  • 237
2 votes
1 answer
1k views

Marginal prior $p(\mu)$ of mean of a normal distribution when both mean and variance are unknown

I read that if the data is normally distributed with mean $\mu$ and variance $\sigma^2$ (both unknown) then to have the joint posterior distribution $p(\mu, \sigma^2 | y)$ in closed form, one has to ...
  • 1,004
0 votes
1 answer
436 views

Hierarchical Bayesian model - issues with JAGS/BUGS switching between lognormal and normal

I'm trying to construct a hierarchical model using JAGS, but I'm running into issues converting between normal/lognormal distributions and the more I stare at my problem, the more confused I get. ...
  • 53
1 vote
0 answers
87 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 ...
1 vote
0 answers
22 views

OpenBUGS intuition with data [duplicate]

I've recently discovered Bayesian statistics, currently I am experimenting with Openbugs, yet I cant grasp the concept of what happens with the inputted data. I understand mcmc, yet all of examples I'...
1 vote
0 answers
171 views

Testing Key Assumptions of Cultural Psychology with Bayesian Analysis [closed]

I have been trying to come up with a way to represent some of the key assumptions of culture in actual measurement and statistical modeling practices. For all of these points, it seems like the ...
  • 386
1 vote
1 answer
139 views

How to include Cohen's D from Meta-Analysis into JAGS/BUGS mean difference model

I was wondering if anyone knew of a way to use Cohen's D (and Standard Error) as an informed prior while building a BUGS model (to be tested in JAGS through R) that compares the mean difference ...
  • 386
2 votes
1 answer
4k views

Gamma parameterization and how to randomly generate $\sigma$'s for use in `rnorm(n, $\mu$, $\sigma$)`

Say I have a normal distribution parameterized with a mean ($\mu$) and precision ($\tau = 1/\sigma^2)$. In JAGS, I would specify a prior for $\tau$ as ...
  • 938
0 votes
1 answer
121 views

Observed function of hidden random variables

Let's say a worker can perform 4 types of tasks in a day: A,B,C,D. Each of which tasks takes time that is distributed according to some probability distribution, say $$ T_A \sim Gamma(\alpha_A, \...
  • 3
2 votes
0 answers
613 views

Discrete MCMC JAGS chains get stuck

I have been running a model where one of the parameters is discrete. I can't think of a simple way to represent this model, so I won't (unless necessary) post it here. My issue is, that when I look ...
  • 738
2 votes
2 answers
749 views

JAGS choosing a random subset of a vector

I would like to allow the subset of a vector I am summing over to be a random quantity. My model is of the form (albeit more complex): ...
  • 738
3 votes
1 answer
886 views

Bayesian meta analysis: implementation in BUGS/JAGS/STAN

I would like to conduct a meta analysis in order to collate the information from a number of studies. The parameter of interest is a probability $\theta$. In each of the studies, the observed data $...
  • 738
5 votes
1 answer
1k views

Crossvalidation in hierarchical bayesian models (HBMs)

I am trying to find a way to cross-validate Hierarchical Bayesian Models used for predicting and modelling abundance in Species Distribution Models. For this purpose, I have tried posterior predictive ...
  • 5,925
2 votes
2 answers
1k views

Suspiciously high Multivariate PSRF from gelman.diag()

I am using "Multivariate PSRF" statistics from gelman.diag() function to analyze my MCMC chains. Now I analyzed convergence 471 variables (parameters for each site)....
  • 5,925
1 vote
0 answers
70 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 ...
  • 2,027
0 votes
2 answers
941 views

Comparing a model with two rate parameters to a model with one. Conjugate priors?

I have a model which includes two exponential rate parameters. I would like to test whether a model with two individual rates describes some data better than a model for which both rates are the same. ...
9 votes
1 answer
7k views

What is the difference between R hat and psrf?

In convergence diagnosis in WinBUGS/JAGS/Stan, there are different statistics reported for each variable. In WinBUGS/Stan, Rhat ($\hat{R}$) is reported. In JAGS with the ...
  • 5,925
1 vote
1 answer
685 views

How to define function in OpenBUGS

In my Hierarchical Bayesian Model, in the data layer y[i] <- M(t,u,v)+ N[0,sigma_y] where M is a complicated function. I have generated the output of this M by ...
  • 111
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 ...
  • 761
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 ...
  • 1,111
1 vote
0 answers
137 views

Point Estimate of normally distributed threshold parameter with unknown mean and variance

I'm new to Bayesian analysis an applied what I learned in John Kruschke's book to simplified versions of a model I previously fitted with non-Bayesian methods. For those simplified versions, even ...
3 votes
0 answers
217 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: ...
  • 131
3 votes
1 answer
455 views

Concern with using the DIC to compare Bayesian models

The deviance information criterion (DIC) is a very popular tool for Bayesian model selection, due, in part, to its support by the BUGS platforms. However, there are some remaining limitations as ...
  • 1,731
1 vote
0 answers
270 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 ...
4 votes
0 answers
1k views

How to Implement an Empirical Bayes Analysis in BUGS/JAGS/Stan

My data is a set of $N$ observations $y_i$. I would like to estimate $\mu$ and $\sigma$ in the following model: $y_i \sim \mathrm{Normal}(\theta, \sigma)$ $\theta \sim \mathrm{Normal}(\mu, \frac{\...
1 vote
1 answer
103 views

Linear Regression with Outlier accounting in Bugs

I'm trying to redo an exercise in BUGS from this webpage: a linear regression over a data set with some outliers, using a model that accounts for them. This model uses a mixture of signal and noise (...
  • 732
1 vote
0 answers
250 views

BUGS/JAGS for Nominal Response Model

I am a beginner with BUGS/JAGS and I was hoping to gather the opinion of you, experts. I am trying to implement a Nominal Item Response Analysis (Polytomous, not ordered, like a multiple-choice exam) ...
2 votes
0 answers
58 views

BUGS with very large sample size

I posted this question on the JAGS help discussion, I was seeing if I could get any help here: I wish to fit a survival model using the data below (first two columns are time points, NA represents ...
  • 6,440
2 votes
0 answers
5k 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
1 answer
532 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,925
0 votes
0 answers
56 views

Regarding three R packages for Bayesian analysis [duplicate]

There are several R packages for Bayesian analysis, i.e., RBugs, JAGS,MCMCPack. Are there ...
  • 4,812
2 votes
0 answers
190 views

Is this JAGS model ok, and can it be made faster?

I'm very new to Bayesian analysis, and I've come up with the following model. My goal is to get for each individual "test unit" a distribution that describes the lift in success rate under one of ...
5 votes
0 answers
1k 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), ...