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

259 questions
Filter by
Sorted by
Tagged with
44 views

### How to interpret expectation of one specific observation of $u_i$, eg. $E[u_1|X]$?

I'm a bit hung up on how to interpret the expectation of a single observation of the error term... especially in the context of the zero-conditional mean assumption. If the true population model is ...
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 ...
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 ...
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 ...
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 <...
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 ...
55 views

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 ...
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 ...
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 ...
68 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 ...
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 ...
25 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., ...
81 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 ...
35 views

### Residuals for a JAGS logistic regression model

I have the following simple logistic regression model: ...
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. (...
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 ...
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 ...
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. ...
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 ...
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 ...
248 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 ...
127 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; ...
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 ...