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

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

Setting up a hierarchical model using R2jags [closed]

I'm working on a project for an introductory Bayesian analysis course and I'm also fairly new to using R regularly. We are supposed to build a hierarchical model using a data set we found or put ...
0
votes
0answers
19 views

How to extract prior values from previous analysis? [closed]

I am doing a simple bayesian calculation in R. The idea is to estimate pooled alpha for each group ( A,B and C). The first step is to estimate value of A with non-informative prior, while the ...
0
votes
0answers
24 views

Basics of JAGS metropolis hastings model with negative binomial

I'm having an insane time finding any documentation on JAGS models. As popular as it is, I imagine there has to be something out there. Still, I've searched for over an hour and cannot find even a ...
0
votes
0answers
9 views

How to model 'the transformation of sample variance follows a chisquared distribution' in JAGS?

Suppose $Y_i\sim\mathcal{N}(\mu,\sigma^2),i=1,2,\dots,n$, and we have observed $\bar{Y}$ and sample standard deviation $S$. We know that $$ \bar{Y} \sim \mathcal{N}(\mu,\sigma^2/n) $$ We can use <...
0
votes
0answers
52 views

JAGS code for Poisson or negative binomial hurdle (zero-altered) model with autoregressive residual

I am using Bayesian zero-altered Poisson and negative binomial models analyzing time-series data with JAGS. Because the ACF of the Pearson residuals showed autocorrelation, I decided to apply ...
0
votes
1answer
221 views

JAGS mixture models with exogenous regressors

This is my first post,I hope this is the right forum for such a question and I formulate it correctly. I am working with a time series data set where the response y seems to follow a mixture of two ...
0
votes
1answer
52 views

“Adaptation incomplete” in rjags. How bad is it?

I'm new to jags and Bayesian inference, but I've run a fairly complex model in jags via rjags. However, I get the warning "adaptation incomplete". As far as I understand it, this means that the ...
41
votes
4answers
7k views

OpenBugs vs. JAGS

I am about to try out a BUGS style environment for estimating Bayesian models. Are there any important advantages to consider in choosing between OpenBugs or JAGS? Is one likely to replace the other ...
0
votes
1answer
171 views

Difference of two distributions in JAGS: How to construct likelihood?

I'd like to get the parameters of these "unobserved variables": X1 <- rgamma(100,shape=5, rate=0.5) X2 <- rexp(100,rate=0.1) from this "observed variable" ...
8
votes
2answers
1k views

Modelling a mixed model in JAGS/BUGS [closed]

I am currently in the process of implementing a model for soccer result prediction in JAGS. Actually, I have implemented several, but I have reached my most difficult challenge yet: A model described ...
0
votes
0answers
29 views

Use zeros trick for modeled parameters

Can the zeros trick be applied for specifying a new distribution for modeled parameters such as a varying intercept model? I am trying to estimate a hierarchial model (like the following) where I have ...
0
votes
0answers
24 views

Weibull Distribution with priors on shape and scale diverges

I have a variable that is Weibull Distributed Duration ~ dweib(Shape,Scale) The Shape and Scale parameters are distributed to log-normal and Weibull ...
2
votes
1answer
279 views

Estimating von Mises Parameters for Angular Data

I want to model some angular data. Any input on how to incorporate the von Mises distribution and suggestions on appropriate priors in RJAGS for von Mises mean and concentration would be greatly ...
0
votes
0answers
66 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
1answer
10 views

how posterior function is calculated in JAGS

I have a theoretical question. I understand the JAGS samples from the posterior function of a model. But I don't understand (nor I can find in the documentation) how it calculates the posterior in the ...
0
votes
0answers
24 views

JAGS: How can I constrain a parameter value to [0, 1] to avoid the “Node inconsistent with parents” error?

Suppose that among $P$ (population size) individuals in a certain social group, a police officer decides to search $S$ (sample size) of them; $H$ (number of "hits") are found to commit a crime (e.g., ...
1
vote
1answer
1k views

Naive SE vs Time Series SE: which statistics should I report after Bayesian estimation?

I am new to Bayesian estimation. When I do some estimations with JAGS, I find there are statistics called Naive SE and Time Series SE. What exactly do they mean? Is it necessary that I report one or ...
0
votes
0answers
80 views

JAGS: Posterior Predictive Check for a Logistic Regression Model

I want to perform a posterior predictive check on some simple logistic regression models that I fitted in JAGS. I found a function in the R package jagsUI called pp.check (see doc here: (pp.check ...
0
votes
0answers
35 views

Residuals for a JAGS logistic regression model

I have the following simple logistic regression model: ...
0
votes
0answers
78 views

JAGS: impose bounds on a multinomial distribution?

In JAGS, I am working with data that have missing observations of a count. I know two things about each missing observation: (1) All missing counts were observed by the CDC but numbered from 0 to 9. (...
0
votes
0answers
26 views

Can Deviance Information Criterion be used for model comparison when the response variable has Poisson distribution?

I just constructed a Bayesian Hierarchical Model for my response variable Y that follows Poisson distribution with the parameter $\lambda$. In my model, I have modelled $log(\lambda)$ as a linear ...
2
votes
1answer
2k views

How to implement credible 95% interval for median odds ratio using JAGS?

As described in Merlo et al (J Epidem Comm Health 2006), the 95% credible interval for MOR is calculated using MCMC. MOR is defined as $\exp(\sqrt{2\sigma^2}\times 0.675)$, where $\sigma$ is the level-...
1
vote
0answers
115 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 ...
0
votes
0answers
6 views
16
votes
2answers
5k views

What prior distributions could/should be used for the variance in a hierarchical bayesisan model when the mean variance is of interest?

In his widely cited paper Prior distributions for variance parameters in hierarchical models (916 citation so far on Google Scholar) Gelman proposes that good non-informative prior distributions for ...
0
votes
1answer
216 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. ...
0
votes
0answers
94 views

R2jags: Truncated Multivariable Normal Distribution in JAGS model (three variables)

I’m trying to specify the joint distribution of 3 parameters in JAGS using a truncated multivariate normal (one of the 3 parameters is truncated at zero, the others are untruncated). I’ve ...
0
votes
0answers
49 views

Posterior predictive check for capture-recapture data using jagsUI wrapper

The R package jagsUI is a wrapper for JAGS that has some awesome functions, including a posterior predictive check. As discussed here, you simulate the new data for the parameters based on the ...
3
votes
1answer
2k views

dmulti in jags when sum(p[i]) < 1

I have a problem with dmulti. Principially, this would be my model: ...
2
votes
0answers
326 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:...
1
vote
0answers
247 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 ...
0
votes
0answers
126 views

Jags: Survival analysis using CJS and multiple covariates

I want to investigate three fixed group effects as covariates in a Cormack-Jolly-Seber style survival analysis using Jags in R. I have successfully developed a separate model for each covariate; ...
8
votes
1answer
2k views

How does dinterval() for interval censored data work in JAGS?

I am trying to understand how dinterval() works in JAGS for censored data. I am modeling coarse data where I only have upper and lower bounds for each data point (not the true value). Here is a ...
3
votes
1answer
45 views

Books on Bayesian inferential analysis of GARCH models

Do you know books about Bayesian inferential analysis of GARCH models with the analysis of these models in R and JAGS? Here is a list of the books I already have: [Ardia] - Financial Risk Management ...
1
vote
1answer
62 views

What prior distribution of parameters in the Bayesian estimation of a GARCH model?

In the case of the Bayesian estimation of GARCH(1, 1) model with Student–t or a Skewed distributions for innovations, is it more correct to assume a uniform distribution for the parameters or to ...
3
votes
1answer
190 views

Hierarchical Version of Bayesian Change Detection Model in JAGS

I am trying to create a hierarchical changepoint detection model in JAGS, estimating group difference in changepoint based on individual changepoints in scores for an outcome variable (fictional in ...
1
vote
0answers
136 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(...
0
votes
1answer
47 views

Predicting survival time from log-hazard

I have estimated a Weibull regression model in BUGS/JAGS which gives me the log-hazard as a function of intercept (baseline hazard) and covariate effects. The intercept is estimated as -9.826 and one ...
5
votes
1answer
497 views

Combining Posterior Distributions of Separate Models

I am running Bayesian models to estimate the number of fruits on a plant, given the presence/absence of herbivores. I get a posterior distribution on each mean. I then run a separate model to estimate ...
8
votes
1answer
5k views

Specify a Zero-inflated (Hurdle) Gamma Model in JAGS/BUGS

I'm trying to use a zero-inflated gamma model (or a gamma 'hurdle' model). The model is a mixture of logistic regression and generalized linear modeling. I can do this analysis in two steps: 1) do a ...
2
votes
1answer
135 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 ...
0
votes
1answer
237 views

Trouble specifying a hierarchical dirichlet model in JAGS

I have a sampling design where samples (cores) are taken within plots. Those plots are then nested within sites. There are multiple sites. I would like to get a hierarchical site-level estimate of ...
1
vote
0answers
139 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
485 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
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
3answers
257 views

Estimating the contribution of covariates in a boral latent variable model

I'm attempting to use latent variable modelling, as described by Hui (2016) and using the boral package in R, to explore relationships between plant species composition and environmental variables ...
10
votes
3answers
3k views

Weighted generalized regression in BUGS, JAGS

In R we can "prior weight" a glm regression via the weights parameter. For example: ...
2
votes
0answers
61 views

Dirichlet regression using jags [closed]

I am trying to fit a simple Dirichlet regression using rjags with a parametrization in terms of the mean and the precision. The model is written as follows: model { # (0) priors for (i in 1:(...
5
votes
1answer
96 views

How to compare AIC values from two Bayesian posteriors

I have a simple question about model comparison: Let's say you fit two models using MCMC: Model A and model B, where model B is model A minus one parameter. You want to assess whether dropping the ...