"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
21 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
10 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
22 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
8 views

Save priors in rjags [migrated]

I'm running a bayesian model in rjags, and I would like to be able to output a plot of the trace of the MCMC, the posterior distribution for my parameters (which I can already obtain from coda), and a ...
0
votes
0answers
1 view

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
12 views

How to model a mixture of finite components from different parametric families with JAGS? [migrated]

Imagine a underlying process that draws a number from a normal distribution with probability $\alpha$ and from a uniform distribution with probability $1 - \alpha$. The observed sequence of numbers ...
0
votes
0answers
13 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 ...
0
votes
0answers
47 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
23 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
81 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
44 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
54 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
27 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
27 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
47 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
64 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
52 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
18 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
58 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
93 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
38 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
92 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
101 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
37 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
39 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
52 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
251 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
42 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
36 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
128 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
11 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
100 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
42 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
139 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
137 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
93 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
95 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
75 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
121 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
67 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
0answers
80 views

JAGS equivalent to R's I() (Inhibit Interpretation of Objects) function?

I'm wondering if anyone has come across the JAGS/BUGS equivalent to R's I() function. I am interested in using this in a polynomial logistic regression, i.e.: mod1 <- glm(Employment ~ Density + ...
0
votes
1answer
108 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 ...
0
votes
0answers
48 views

Alpha Parameter Specification Dirichlet Prior

I have a straightforward Dirichlet-Multinomial model with code that is running in RJAGS. The data are a collection of 200 2 x 2 contingency tables. The multinomial counts are those of a 2 x 2 ...
1
vote
1answer
96 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
441 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. ...
0
votes
1answer
695 views

JAGS Error: Invalid Parent Values on last observation

I am using R2jags to fit a model in R using JAGS. Here is my code: ...
2
votes
1answer
352 views

Bayesian meta analysis: implementation in BUGS/JAGS/STAN

I would like to conduct a meta analysis in order to collate the information from a number of studies. The parameter of interest is a probability $\theta$. In each of the studies, the observed data ...