"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

0
votes
0answers
7 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, ...
0
votes
0answers
15 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, ...
0
votes
0answers
26 views

Using BUGS/JAGS for Gibbs sampling for inference in a (discrete) Bayesian Network for estimating conditional probability tables

My goal is to use BUGS (more accurately, JAGS) to perform Gibbs sampling as a process for parameter estimation in Bayesian networks that only have discrete random variables. I am using the following ...
0
votes
1answer
38 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
21 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 ...
4
votes
1answer
50 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
44 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 ...
3
votes
0answers
48 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
37 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
39 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
29 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
28 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
52 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
47 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
73 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
28 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
0answers
33 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: ...
3
votes
1answer
111 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
161 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
183 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
56 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
58 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
106 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 ...
0
votes
0answers
29 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 ...
1
vote
0answers
74 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
156 views

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

I have a problem with dmulti. Principially, this would be my model: ...
3
votes
1answer
217 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
37 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
68 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
58 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: ...
0
votes
2answers
160 views

Comparing a model with two rate parameters to a model with one. Conjugate priors?

I have a model which includes two exponential rate parameters. I would like to test whether a model with two individual rates describes some data better than a model for which both rates are the same. ...
1
vote
1answer
109 views

Discrete predictors in a mixed effects model in JAGS

I'm fitting a random effects hierarchical model in JAGS and have a question regarding discrete predictors in the contexts of mixed effects models. In my data there is a group variable, which is the ...
2
votes
2answers
196 views

Bounds on correlation to ensure covariance matrix is positive definite

UPDATED: I am constructing a correlation matrix for an MA(1) process, which would look something like... $$ C = \left( \begin{array}{cccccccccccccccccc} 1 & \rho & 0 & 0 & 0 & 0 ...
0
votes
1answer
68 views

Is multinomial the same as multiple binomial?

I wonder, if I write - in JAGS, WinBUGS, or in a paper: x[] ~ dmulti(p[], N) is it the same as if I write: ...
3
votes
1answer
107 views

How can regression trees be fit in WinBUGS/OpenBUGS/JAGS?

There is an R package called BayesTree which can fit regression trees in Bayesian environment. However, this way only simple regression is possible. I would like to use regression trees as a part of a ...
1
vote
1answer
63 views

Combining Posterior Distributions of Separate Models

I am running Bayesian models to estimate the number of fruits on a plant, given the presence/absence of herbivores. I get a posterior distribution on each mean. I then run a separate model to estimate ...
0
votes
1answer
60 views

Jags: How to create vector with probabilities that are based on one of its outcomes?

I am very new to Jags. I just started using it for my stats class. I have done other types of programming, but I am having trouble understanding how to use Jags properly. Right now, I have a vector ...
4
votes
2answers
179 views

R - how to get standard error for a breakpoint/parameter in a piecewise regression

I'm new to asking questions here, so I hope this is a reasonable place for this. I am trying to fit a piece-wise regression. I expect my response (y) to increase from x0 to somewhere along x, then to ...
1
vote
1answer
209 views

JAGS Multinomial mixture model with missing data

I am trying to fit a multinomial mixture model to data from a stream depletion survey. The data were collected by selecting a stream site that is a standard length (usually 150-200m depending on ...
0
votes
0answers
115 views

Constrained Random Walk Prior BUGS/JAGS

I'm currently trying to implement a model along the lines of Owen (2009) and Knorr-Held (2000) in JAGS. In particular, I am struggling to model the constrained random walk priors. We have that ...
1
vote
0answers
80 views

Point Estimate of normally distributed threshold parameter with unknown mean and variance

I'm new to Bayesian analysis an applied what I learned in John Kruschke's book to simplified versions of a model I previously fitted with non-Bayesian methods. For those simplified versions, even ...
2
votes
0answers
97 views

Estimating parameters and latent variables in a split Poisson distribution using R and JAGS

I am trying to estimate parameters and latent variables in a split Poisson model that describes observable and unobservable counts in time assuming the split probability is $\pi$. An observable event ...
1
vote
0answers
75 views

JAGS prior-based prediction

I'm trying to use rjags to predict what the curve-maximums will be for different groups of incomplete data (one metric x and one metric y). Here is an example of the indata: ...
7
votes
1answer
203 views

Combining data from different sources

I want to combine data from different sources. Let's say I want to estimate a chemical property (e.g. a partitioning coefficient): I have some empirical data, varying due to measurement error around ...
1
vote
0answers
305 views

Specifying a Normal-Log-Normal Mixture (Skew Normal) in WINBUGS/JAGS

I am an actuary working on a Bayesian loss reserve model using incremental average severity data. Exploratory analysis of the response seems to suggest a skew normal distribution of some sort would be ...
2
votes
0answers
330 views

Dummy coding from a Bayesian point of view

If we want to use categorical variables in regression context, we are allowed to use dummy codings such as these schemes. Is this also required in a Bayesian (MCMC) context, such as with ...
5
votes
2answers
402 views

Fitting a simple JAGS model with RSTAN

I'm trying to fit a simple exponential model for left censored data using RSTAN to replicate something I did in JAGS. The JAGS model is: ...
3
votes
2answers
312 views

Setting a proper prior distribution on sigma for Bayesian Regression

I'd like to know how to set a proper prior distribution on sigma when using JAGS in a Bayesian regression. Here is what I have: ...
1
vote
0answers
111 views

JAGS error re length mismatch in Node

I am trying to specify a logistic regression model in JAGS. I am encountering an error I haven't seen before, and haven't found a solution online. I would appreciate if anyone knew what was happening. ...
2
votes
0answers
212 views

Appropriate GLM when response variable is proportion, but not binomial

The response variable I'm dealing with is the proportion of a total area that is suitable habitat for a species of interest. So although the response variable is bounded between 0 and 1, my intuition ...