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
9 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
48 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
40 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 ...
0
votes
0answers
28 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
21 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 ...
0
votes
0answers
59 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
8 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., ...
0
votes
0answers
62 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
32 views

Residuals for a JAGS logistic regression model

I have the following simple logistic regression model: ...
0
votes
0answers
77 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
24 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 ...
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 ...
0
votes
0answers
6 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
0answers
89 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
44 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 ...
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 ...
0
votes
0answers
112 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; ...
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
60 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 ...
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(...
0
votes
0answers
67 views

Excellent fit, zero convergence hierarchical dirichlet model in JAGS

I am fitting a hierarchical dirichlet model to some data in JAGS. My samples (referred to as cores in the code) are observations of the relative abundance of 3 ...
0
votes
1answer
46 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 ...
2
votes
1answer
132 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 ...
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 ...
0
votes
1answer
230 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
451 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
2
votes
0answers
60 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
94 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 ...
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. ...
3
votes
1answer
187 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 ...
0
votes
1answer
165 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" ...
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
1answer
43 views

How to define the Lee-Carter model and its constrains in Bayesian setting

I'm running the Bayesian version of Lee-Carter model on jags, using rjags R package. Given a matrix of data $M$ such that $M_{x,t}=\log m_x(t)$ where $m_x(t)$ is ...
2
votes
1answer
356 views

Convergence issue dirichlet model JAGS, implemented in R

I have data on the relative abundances of 3 species, stored in the matrix r.spp.y. Species 1 has a negative relationship with the variable ...
1
vote
3answers
246 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 ...
0
votes
2answers
53 views

How do I deal with imperfect detection of a covariate in Bayesian Binomial Regression?

First time question, I've had a search around but couldn't find anything, but apologies if this repeats someone else's question. I am running a binomial regression with JAGS, attempting to model the ...
0
votes
1answer
217 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 ...
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
1answer
77 views

Bayesian autoregressive model with second peak at 1 in posterior distirbution of AR parameter

I am trying to run a Bayesian hierarchical AR1 model for a set of fairly short time series. In some of the series I get a second peak around 1 in the posterior distribution of the AR1 parameter. ...
3
votes
1answer
396 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: ...
1
vote
1answer
522 views

Mixture of Normal and Exponential distributions with unkown weights and parameters using JAGS

I am trying to model a process that generates random normal variables and random exponential variables, with unknown weights between the two distributions, and unknown parameters of the distributions. ...
0
votes
1answer
95 views

JAGS RUNTIME ERROR : Expected parameters with fixed values in function rep

I am trying to write jags code for the following scenario Toss a coin with unknown probability of heads (p) If heads, then draw a random integer from 1 to 12 If tails, then draw a random integer from ...
1
vote
1answer
281 views

Fitting regression spline [closed]

I am reading the paper by Willemsen et al (2015), "A multivariate Bayesian model for embryonic growth", Statistics in Medicine, 34:8, 1351–1365 I have a model like $$y_{ij} = \gamma_{i2} + f((t_{ij} ...
1
vote
1answer
403 views

Estimating uniform distribution with RJAGS - beginners question [closed]

I am trying to estimate the parameters of a uniform distribution, which, by a visual inspection, is between -5 and 25. I am getting the following error: ...
0
votes
1answer
55 views

Correct way to multiply Bayesian interacting terms with Cred Intervals

So I've built a (long computational time) jags mixed model that includes an interaction term in the fixed effects. After the fact I want to multiply two of the posterior means for the regression ...