We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [jags]

"JAGS is Just Another Gibbs Sampler. It is a program for analysis of Bayesian hierarchical models using Markov Chain Monte Carlo (MCMC) simulation not wholly unlike BUGS." (http://mcmc-jags.sourceforge.net/)

79 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
0answers
2k views

Hyper-prior for negative binomial in hierarchical model using JAGS/BUGS

Below I'm using a negative binomial because it is more flexible than a simple poisson model. The data are counts $y$ of events for 16 individuals $x$. There are 14 counts (i.e. counting periods) for ...
6
votes
0answers
1k views

Label Switching in WinBugs/JAGS

I am using JAGS to estimate a Dirichlet Process Mixture of Normals. The code works well and the estimated density is accurate. However, I would like to know which component each observation is ...
5
votes
0answers
388 views

AR(1) model - which prior to use?

I want to use the following univariate model: $y_t = \mu_t + \epsilon_t, \ \epsilon_t \sim N(0,1)$ $\mu_t = \phi \mu_{t-1} + \omega_t, \ \omega_t \sim N(0,\sigma_\omega^2)$ That is, $\mu_t$ follows ...
5
votes
0answers
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), ...
3
votes
1answer
111 views

Estimating coin bias from multiple adversary observations

I have a set of biased coins $N$, where each coin has a different bias $\theta_i$ (probability of heads for $i$th coin is $\theta_i$). This bias is unknown and needs to be estimated. There are $K$ ...
3
votes
0answers
141 views

Why is this Bayesian estimate of a truncation-point so poor?

I have several datasets. Each dataset holds the masses of objects that have been subject to physical wear, expressed as a proportion of their original mass ($w$), and the amount of time that the ...
3
votes
0answers
2k views

Using JAGS for bayesian parameter estimation

I am using JAGS in R to construct a probabilistic graph model and estimate the corresponding parameters. The models is described as follows: ...
3
votes
0answers
429 views

A better bayesian way of modelling autoregressive mixtures

I have a JAGS hierarchical model which includes a temporal sub-model for the primary vote share between four party groups (LNP, Labor, Green, and Other). For each day in the temporal model, the vote ...
2
votes
0answers
160 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 ...
2
votes
0answers
163 views

Meaning of Baseline Before Sum to Zero

I am trying to specify a Bayesian hierarchical split-plot model in JAGS. I have been following Doing Bayesian Data Analysis by John K. Kruschke, however the model I am attempting is not included in ...
2
votes
0answers
241 views

Diagonal inflated Bivariate Poisson model

I am trying to fit the Bivariate Poisson distribution to a set of sports results to serve as a comparison model to a new model I am developing/developed with my masters thesis.My model is as follow: <...
2
votes
0answers
314 views

How to specify the Bayesian version of a clustered-robust standard error OLS in BUGS/JAGS or Stan?

I am trying to reproduce a simple OLS model fitted with clustered-robust standard errors within the Bayesian framework (be it with BUGS/JaGS or with Stan). In R, my frequentist model is the following:...
2
votes
0answers
323 views

Deviance n.eff in R becoming 1 at high sample n

I've been doing some basic bayesian t-tests in OpenBUGS, and later JAGS (via a friendly biometrician), and in both cases I ran into a bizarre property of the R-2- packages on the output. Specifically, ...
2
votes
0answers
373 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 ...
2
votes
0answers
98 views

Hierarchical Bayesian model with heterogenous errors

I have an experiment where I repeatedly show subjects two lights, and I ask which light is brighter. I am interested in whether error rates decrease over time, holding all else constant. I also ...
2
votes
0answers
401 views

“Observed node inconsistent ” when binomial success rate exactly one

I observed some curious behavior in JAGS (rjags). There probably is a good reason for it, but I can't figure it out: As part of a more complex model I have these statements: ...
2
votes
0answers
278 views

Estimating parameters and latent variables in a split Poisson distribution using R and JAGS

I am trying to estimate parameters and latent variables in a split Poisson model that describes observable and unobservable counts in time assuming the split probability is $\pi$. An observable event ...
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/...
2
votes
0answers
669 views

Appropriate GLM when response variable is proportion, but not binomial

The response variable I'm dealing with is the proportion of a total area that is suitable habitat for a species of interest. So although the response variable is bounded between 0 and 1, my intuition ...
2
votes
0answers
1k views

Within-subjects model in JAGS/stan

I have a general question regarding a varying intercept / varying slope model in jags/stan: I have data from a psychophysics experiment, with one covariate, one within-subjects factor and several ...
2
votes
0answers
53 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 ...
2
votes
0answers
158 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 ...
2
votes
0answers
400 views

How to define a BUGS/JAGS or WinBUGS model with a likelihood node that includes two integrals?

I would like to implement a BUGS/WINBUGS or JAGS model that specifies the likelihood node by marginalizing over two parameters. Is this feasible in BUGS/WINBUGS or JAGS? This is the posterior \begin{...
2
votes
0answers
84 views

Coda output, joint quantile

I am running a hierarchical model in JAGS. It is a piecewise constant survival regression model. So I have 4 sets of regression coefficients and baseline hazard rates. I would like to plot a mean ...
2
votes
0answers
2k views

JAGS - problem with taking submatrices

I'm trying to use JAGS for clustering mixtures of multivariate normal distributions. In order to model different covariance structures in each cluster I wanted to use one big (C*D)xD matrix (C - ...
1
vote
0answers
113 views

Convergence check in MCMC chains in R

I use Gelman-Rubin statistics, trace plots, autocorrelation plots and effective sample size to check the convergence. However, I got very different results from the above tests. The Gelman-Rubin ...
1
vote
0answers
221 views

Calculate a Bayesian 'posterior predictive p-value' for a multinomial logistic regression

For assessing the fit of a model in a Bayesian framework, 'posterior predictive p-values' (PPPs) are often used. Here, a value close to 0.5 indicates a good fit; a value close to 0 or 1 indicates a ...
1
vote
0answers
127 views

How to implement Exponential Power distribution in JAGS

I would like to fit a simulated data to Exponential Power likelihood using uniform mixture with gamma mixing presented in "Scale Mixtures Distributions In Statistical Modelling" by Choy and Chan: $EP(...
1
vote
0answers
134 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
vote
0answers
449 views

How to calculate WAIC from a JAGS model, and fix p_waic issue?

I am running a logistic regression type model in JAGS, and I noticed that I was getting different DIC scores (more than just a few points difference) between runs of the same model. I have a suspicion ...
1
vote
0answers
33 views
1
vote
0answers
70 views

Assessing the fit of a state-space model in JAGS

I've been fitting a relatively complicated state-space model in JAGS and I want to do some basic model comparisons, including dropping parameters one at a time to assess their influence on the fit. ...
1
vote
0answers
109 views

Bayesian model averaging with pseudopriors

I'm performing Bayesian model averaging (BMA) on 4 models describing the log-death rate. The four model are the Lee-Carter $$\log m_x(t) = \alpha_x + \beta_x\kappa_t+\epsilon_{x,t},$$ the Renshaw-...
1
vote
1answer
31 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 ...
1
vote
0answers
39 views

Measuring covariance among multiple y-variables using a dirlichet model, implemented in JAGS in R

I have data on 3 species abundances as fractional compositions. Within each sample, the sum of all species abundances is 1. Essentially, each observation is a proportional abundance. Here is an ...
1
vote
0answers
336 views

DIC, WAIC in JAGS

I have a Bayesian Hierarchical model using JAGS. In order to find the best model, I have compared the DIC of two models but It's not reliable. So, I decided to calculate WAIC from JAGS. However I have ...
1
vote
0answers
423 views

How to self-define likelihood with dmulti() in JAGS?

I am running a hierarchical Bayesian model and would like to use the "ones trick" to self-define a likelihood function, just to prevent the problems that dmulti() may have with zeros. To be able to ...
1
vote
0answers
123 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}$$ $$\...
1
vote
0answers
62 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
vote
0answers
114 views

Gibbs Sampling / Monte Carlo with Weights

Consider pairs of data and their population weights $(y_i, \omega_i), i = 1, 2, \dots$ alongside some hierarchical structure, $$y_i\leftarrow\theta_{i(j)} \leftarrow \gamma$$ where $i(j)$ is perhaps ...
1
vote
0answers
135 views

Bayesian updating in JAGS - data not reaching posterior distribution

I am trying to model the survival of a bird species as the function of a habitat variable, using JAGS run with the R package R2jags. When I leave the habitat variable out, I get believable estimates ...
1
vote
0answers
698 views

JAGS better than Stan for fitting CPDs in a Bayesian Network?

I have a Bayesian network DAG structure, and a conditional probability distribution (CPD) for each node. I want to fit the parameters of the CPDs with a Bayesian method, since I have some prior ...
1
vote
0answers
769 views

DIC vs PED in JAGS

JAGS allows reporting of DIC and also PED (penalized expected deviance). What are differences between these two statistics? Which is better for what purpose? DIC was the first one, PED was evidently ...
1
vote
0answers
668 views

JAGS code for multilevel model with AR(1) autoregression - does this look okay?

There are a number of threads, blogs etc. discussing autoregressive models in JAGS, and but only a few that supply the code. John Kruschke's code for an autoregressive model with a sinusoidal ...
1
vote
0answers
233 views

Theoretical ground which forbids the use of Frequentist SAR specifications in Bayesian estimations?

Abridged question version Given the constraints I face when mixing frequentist SAR specifications (e.g. regressand autoregressive process, involving binary correlation structure) with Bayesian ...
1
vote
0answers
281 views

Calculate AIC or Anova from an RJags model

I am fitting multivariate linear regressions with RJags (I have to do it with an mcmc because I'm taking all errors into account). I want to know between two polynomials which one fits better my data....
1
vote
0answers
523 views

R, JAGS and missing data

I am currently using JAGS via the program R to run N-mixture models using about 5 years of count data. In 3 of these years, there were 3 counts per site, while in the remaining 2 there were 2 counts ...
1
vote
0answers
124 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 ...
1
vote
0answers
1k views

Specifying a Normal-Log-Normal Mixture (Skew Normal) in WINBUGS/JAGS

I am an actuary working on a Bayesian loss reserve model using incremental average severity data. Exploratory analysis of the response seems to suggest a skew normal distribution of some sort would be ...
1
vote
0answers
644 views

JAGS error re length mismatch in Node

I am trying to specify a logistic regression model in JAGS. I am encountering an error I haven't seen before, and haven't found a solution online. I would appreciate if anyone knew what was happening. ...