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

1
vote
0answers
26 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
39 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
15 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
0answers
10 views

RJAGS model will not compile [migrated]

I'm trying to get my model to compile in RJAGS, but I keep receiving a runtime error that doesn't seem to describe the problem as seen below: ...
0
votes
0answers
12 views

Writing code for Generalised nonlinear mixed effect model in WinBUGS/JAGS [migrated]

For my research purpose, I need to do Generalised nonlinear mixed effect model to analyse some repeated measure count data. I have some tree mortality data from 1950 which were measure in different ...
0
votes
2answers
46 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
38 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
26 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
57 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
79 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
32 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
35 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
43 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
244 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
35 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
26 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
121 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
10 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
79 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
34 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
14 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 ...
5
votes
1answer
104 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
108 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
70 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
77 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
59 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
97 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
55 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
63 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
88 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
60 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
30 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 ...
0
votes
0answers
131 views

WinBUGS/JAGS code for calculating Bayesian p-value from negative binomial model

I have a working negative binomial model written in BUGS code, but am not sure about the appropriate Bayesian p-value code to test goodness of fit. Specifically, I would like to calculate Pearson's ...
0
votes
0answers
39 views

JAGS dmstate markov specification

Does any one have experience in running multi state models in jags? I am trying to run a msm on my dataframe with activity being 1/0 time from diag being times observation of the activity and patient ...
1
vote
1answer
74 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
279 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
440 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
282 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 ...
1
vote
1answer
65 views

Jags - estimates are same as true values of y?

Lets say I have the following state space model: $y_t = \beta_t x_t + \epsilon_t$ $\beta_{t+1} = \mu_t + \beta_t \eta_t$ $\mu_{t+1} = \mu_t + \omega_t$ All my true values for $y$ are known, but I ...
0
votes
1answer
112 views

Can Jags be used to fit classical inference state space models?

Can Jags be used to fit classical inference state space models (that is without using a Bayesian approach by specifying a prior)? To be fully clear: can I estimate a state space model such as the ...
2
votes
1answer
164 views

Translating a bayesian model from MCMCpack (hregress) to JAGS

I am trying to convert a hierarchical model that currently works with the R package MCMCpack, into a JAGS version. I have experience working with regular models in JAGS, but not with hierarchical ...
1
vote
1answer
56 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
44 views

generating a sequence of indicators based on variable boundaries in JAGS

Suppose I have a vector of indices 1:N, and data y[1], ..., y[N]. I have three variable center points in ...
2
votes
0answers
124 views

code works in jags but not winbugs [closed]

I have band-recovery data from several areas, and am trying to get survival rates for adult and juvenile for each area. Brownie model is used. The model is: ...
1
vote
1answer
511 views

RJAGS Multinomial-Dirichlet – Observed node inconsistent with unobserved parents at initialization

I am trying to model a simple 2x2 contingency table with a multinomial-Dirichlet model. A snippet of my data z[i,1:4] look like this: ...
1
vote
1answer
266 views

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

I have a problem with dmulti. Principially, this would be my model: ...
3
votes
1answer
354 views

JAGS, cannot evaluate upper index of counter

I asked this question at the JAGS sourceforge help forum but didn't get response there. I have the following JAGS model: ...
1
vote
1answer
45 views

Interpretation of absurdly large (but probably correct) Bayes Factors?

I estimated a Bayes factor to compare a hypothetical model against a null-model (which obviously by visual comparison of the posterior predictive with the data) fails to capture a certain aspect in ...
1
vote
0answers
103 views

R, JAGS and missing data

I am currently using JAGS via the program R to run N-mixture models using about 5 years of count data. In 3 of these years, there were 3 counts per site, while in the remaining 2 there were 2 counts ...
1
vote
0answers
73 views

“Observed node inconsistent ” when binomial success rate exactly one

I observed some curious behavior in JAGS (rjags). There probably is a good reason for it, but I can't figure it out: As part of a more complex model I have these statements: ...