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

learn more… | top users | synonyms (1)

0
votes
1answer
26 views

Bayesian errors-in-variables model definition in JAGS and symbolically

I'm fairly new to probability theory and am attempting to understand and implement an errors-in-variables simple linear regression model. I am assuming a model of the form $$ Y=\theta X_a+\epsilon_Y ...
0
votes
0answers
12 views

Multilevel modelling in JAGS: Unable to resolve node

I am building a multilevel model, where the time is on the first level and countries are on the second level, in JAGS (JAGS version 3.4.0). I want to build varying-slope-varying-intercept model, like ...
0
votes
0answers
19 views

Expected value of inverse-Wishart prior in JAGS

I am trying to estimate a covariance matrix in JAGS, using a prior centered around the expected variances. Thus, I want to assign a prior with expected variances that are about equal to the observed ...
3
votes
1answer
40 views

What is causing autocorrelation in MCMC sampler?

When running a Bayesian analysis, one thing to check is the autocorrelation of the MCMC samples. But I don't understand what is causing this autocorrelation. Here, they are saying that High ...
0
votes
0answers
5 views

Syntax error from rjags [migrated]

I'm trying to fit a hierarchical model with rjags for the first time; it looks pretty simple on paper, but I'm getting an "Error parsing model file: syntax error on line 5 near "[" " that I'm totally ...
0
votes
0answers
15 views

Estimating unconditional effects in double hurdle models

I trying to implement a double hurdle model in JAGS and am struggling to understand how to estimate the unconditional effects of each predictor variable on the count process. I have implemented the ...
0
votes
1answer
25 views

RJAGS bayesian approach of mixed effects model

Why my posterior result always shows that the sigma and sigma.c estimates to be around 50? It should not be that large as I know from another approach of analysis and also summary of the data. Is it ...
0
votes
0answers
12 views

JAGS missing data problem

For missing data problem in RJAGS, in this site, there are a lot of posts talking about setting priors to generate data for the missing place. However, instead of filling up the places, I tend to ...
0
votes
1answer
31 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
4 views

Discrepancy measure for bayesian beta model

I fitted a beta model with a vector of Jaccard similarities as response variable and a vector of euclidean distances as predictor variable in JAGS. I coded the model as follows: ...
0
votes
0answers
15 views

Why do I have to define the top-level parameter in JAGS, and how?

According to the user manual of r-jags (section Compilation): Any node that is used on the right hand side of a relation, but is not defined on the left hand side of any relation, is assumed to ...
1
vote
0answers
52 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 ...
0
votes
0answers
33 views

Changepoint mixed model R2jags

Can anyone suggest a way to code a changepoint model in JAGS (I'm using JAGS within R using R2jags) for the variance parameter of a random intercept effect? I am using the data set sleepstudy from ...
1
vote
1answer
86 views

What is the distribution of the ratio of two normals?

I need to use the ratio of two variables as the dependent variable in a regression. Both variables are normally distributed but with positive values. I can either center them or use as it is. If I ...
1
vote
1answer
46 views

reduce size of an MCMC/ rjags object

I have recently started running more complicated Bayesian models in R using the rjags package. As model complexity has increased I have had to run longer chains to reach convergence for some ...
3
votes
0answers
55 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 ...
0
votes
0answers
36 views

Using the 'product space method' to test the evidence for hypotheses of random effects in hierarchial Bayesian models

I am exploring the use of product space methods, coded in JAGS within R, for Bayesian model selection/comparison. I am particularly interested in using this method to test hypotheses about random ...
0
votes
0answers
30 views

Using posterior predictions samples for Bayes factor input

I have two posterior prediction distributions produced using JAGS that I would like to compare using Bayes Factor as an alternative to a t-test. For each posterior, I have run 4 chains, and converted ...
0
votes
1answer
92 views

Sum of multiple probability distributions [duplicate]

Background: I try to estimate the potential energy supply within a geographical area using spatially explicit data. For this purpose I use a Bayesian network and several spatial data layers as ...
0
votes
0answers
52 views

JAGS: Cannot invert matrix: not positive definite

I am trying to model a response Y (count; range: 0-230) against a single predictor X (continuous, rescaled and centered to lie between -0.18, 44.8). The parameters of the relationship between X and Y ...
1
vote
0answers
78 views

Ones trick in BUGS gives node inconsistent with parents error [closed]

Edit: This issue doesn't come up if I use OpenBUGS. But I can't use it for my bigger problem as it seems "very slow" compared to JAGS at least on my machine. I am using JAGS as my BUGS flavor to run ...
0
votes
0answers
55 views

When you have a multilevel / mixed effects model, how do you incorporate the random intercepts when making a prediction?

When you have a multilevel / mixed effects model, how do you incorporate the random intercepts when making a prediction? Here is the context: I'm trying to model a Bayesian regression using an index ...
0
votes
0answers
20 views

regression for left censored data with JAGS

I don't have much knowledge about how to use JAGS to do bayesian regression, I have seen several examples but my data is left censored and I am not sure how to construct the likelihood function, if ...
0
votes
2answers
60 views

Invalid parent values in JAGS

I read through some other forums with the same error but have not yet been able to figure out my case. When I run the model: ...
2
votes
1answer
111 views

Multi-level Bayesian hierarchical regression using rjags

I am trying to to implement a Bayesian hierarchical Model in R. I have a few predictor variables (2 metric and one categorical) and am trying to predict quarterly home sales in the US. Each sales ...
0
votes
0answers
47 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 ...
0
votes
1answer
99 views

error when running JAGS

In an attempt to learn JAGS I am trying to fit a line to data points. The data points have errors in both directions i.e. along the xaxis and yaxis. Here is my model: ...
1
vote
1answer
112 views

My MCMC do not overlap : Mixturemodel with JAGS and R

I fitted a JAGS model and I have those results : My questions are: Why do my chains not overlap, and how can I fix that? I used the following method: My model is a mixture Gaussian model of ...
1
vote
1answer
38 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 ...
0
votes
1answer
41 views

JAGS, RJAGS: simple way to track the moment of a chain instead of the entire chain?

I have a state-space model coded into JAGS. The model predicts the latent state at each observation with ~40,000 observations. In rJAGS I can store the chains of the latent state, '$z$', but having a ...
0
votes
0answers
61 views

How to compare forecast accuracy of ordered probit and the equivalent Bayesian heierarchical model in R?

I have a dataset of a metric predictor variable $X$, and an ordered categorical predicted value $Y$ for several individuals. The dataset are from two groups $G_1$ and $G_2$. I want to estimate $Y$ ...
8
votes
1answer
252 views

How many sides does a die have? Bayesian inference in JAGS

Problem I would like to do some inference on a system analogous to die with an unknown number of sides. The die is rolled several times, after which I would like to infer a probability distribution ...
0
votes
1answer
45 views

Error metric for cross-validation on interval-censored data?

I want to compare crossvalidated model fit (of two Bayesian models, one using a normal distribution and the other a t-distribution) on interval-censored data - data where the exact point is not known, ...
2
votes
0answers
43 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
1answer
130 views

Priors for Truncated Parameters - RJAGS

I would like to estimate the parameters of a specific model. The model specification is as follows: $p_t = k_t + B_t/(1-B_t) + \eta_t$, where $ \eta_t \sim N(0, \sigma^2)$ $R_{t+1} = R_{t} + R_t ...
0
votes
0answers
12 views

RJAGS Prediction Envelope for Distributions

I am using RJAGS to estimate the parameters of my model from data. My model contains diverse range of parameters for known distributions. I get the credibility intervals for my distribution parameters ...
0
votes
1answer
105 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 ...
0
votes
1answer
43 views

Effect of “parameters.to.save” in R2jags/ JAGS

I'm using the package R2jags in R, which uses the parameters.to.save argument to specify parameters. I'm interested in the statistical distinction between a ...
0
votes
0answers
16 views

Visual Predictive Checks in RJAGS

I am running a model in RJAGS that is difficult to express in closed form involving numerous data variables. I appear to get satisfactory convergence and have selected my model using the Deviance ...
6
votes
1answer
158 views

Managing high autocorrelation in MCMC

I'm building a rather complex hierarchical Bayesian model for a meta-analysis using R and JAGS. Simplifying a bit, the two key levels of the model have $$ y_{ij} = \alpha_j + \epsilon_i$$ $$\alpha_j ...
2
votes
1answer
151 views

MCMC Estimation of Multidimensional 2PL IRT Model Using JAGS

I'm trying to prepare for some more advanced work involving MIRT models I'll be doing later this year by fitting a very simple multidimensional 2PL model to some simulated data using MCMC methods in ...
0
votes
0answers
97 views

Bayesian random effects meta-analysis on the risk ratio with r2jags

Following the work of Warn 2002 I am trying to set up the model for a Bayesian meta-analysis on the risk ratio and the odds ratio. I am using R together with R2jags to fit a simple RE MA model. ...
4
votes
0answers
97 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 ...
1
vote
0answers
78 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 ...
0
votes
0answers
127 views

How to constrain higher-order interaction terms in hierarchical bayesian regression models with multiple categorical and metric predictors

Greetings Statistics Wizards! I am building a hierarchical bayesian regression model in which the predicted (y) variable is metric (numerical, continuous) and the predictor variables are both ...
1
vote
2answers
75 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): ...
0
votes
1answer
113 views

JAGS Error when fitting Gamma GLM: Invalid parent values

I am trying to fit a Gamma GLM to my data.Here's my code: ...
2
votes
0answers
66 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 ...
1
vote
1answer
101 views

What are good values for autocorrelation, Gelman, and cross-correlation in rjags?

I don't want to post my whole code since it is long, so I will only post part of it: ...
4
votes
1answer
498 views

Prediction based on bayesian model

I have created a bayesian model that estimates 6 parameters using rjags from R. Now i want to do some predictions based on new data in R. Can anyone help me with an example. ...