"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/)
0
votes
0answers
14 views
Implementing Amoroso distribution in WinBUGS or JAGS [migrated]
I want to implement the Amoroso distribution (as specified in http://arxiv.org/pdf/1005.3274.pdf) into either WinBUGS or JAGS code using the zeros trick.
However, I get stuck everytime, trying to ...
1
vote
0answers
51 views
How to model sum of two values in JAGS?
Imagine, that we measured two values and we know, that in reality one measurement directly corresponds to the latent variable "s1", and the other measurement is in fact sum of two values: "s1" and ...
0
votes
0answers
30 views
Lognormal and Logit models in JAGS
I'm trying to run this two-part model in JAGS. I have two components, one logit and one lognormal regressions in there:
...
1
vote
1answer
100 views
Simple cloud computing to run R + JAGS simulations
I want to simulate the frequentist properties of a Bayesian model. So, for example, I might want to fit a Bayesian model 1,000 times to 50 different configurations each of which takes about 10 seconds ...
3
votes
0answers
41 views
A better bayesian way of modelling autoregressive mixtures
I have a JAGS hierarchical model which includes a temporal sub-model for the primary vote share between four party groups (LNP, Labor, Green, and Other). For each day in the temporal model, the vote ...
0
votes
0answers
37 views
What is the difference between these very simple normal and hierarchical normal BUGS models?
Consider these basic JAGS models, each having the same input. The question concerns only the first two, I include the other two for completeness.
Model 1 ("normal")
...
3
votes
1answer
87 views
Difficulties with a Bayesian formulation of a model for human timing data
The Wing-Kristofferson model is a simple model of the behavior of a human trying to drum out a steady beat (that is, trying to mimic a metronome). Let $y_i$ be the $i$th interval between two drum ...
0
votes
0answers
63 views
JAGS error when fitting logistic additive mixed model
I have longitudinal data, where there is a binary outcome variable. There are 1 to 6 repeated observations per subject. One of the predictor variable is numerical. All the other predictor variables ...
0
votes
1answer
55 views
-1
votes
1answer
31 views
CODA gleman.diag, Error in chol.default(W): [closed]
I'd like to use gelman.diag for an MCMC chain I ran in JAGS. It is very large, so I can't provide it.
The chain contains several MVN distributions, and I use a wishart prior on the precision matrix.
...
2
votes
1answer
84 views
Multilevel bayesian with AR1 correlation structure
How do I fit a bayesian multilevel model with with AR(1) correlation structure?
I am trying to teach myself bayesian modelling and I am wondering how you could specify a multilevel model with an ...
0
votes
0answers
71 views
Group differences from a Bayesian Hierarchical Multinomial Model in Jags
I'm unsure about how to go about looking at group differences in frequency data using a Hierarchical Bayesian approach. Normally I would do a Chi-square Test of Independence between groups, but this ...
2
votes
0answers
44 views
Coda output, joint quantile
I am running a hierarchical model in JAGS. It is a piecewise constant survival regression model.
So I have 4 sets of regression coefficients and baseline hazard rates.
I would like to plot a mean ...
6
votes
1answer
274 views
Bayesian variable selection — does it really work?
I thought I might toy with some Bayesian variable selection, following a nice blog post and the linked papers therein. I wrote a program in rjags (where I am quite a rookie) and fetched price data ...
0
votes
0answers
105 views
makeCluster from snow package in R not working [closed]
Im trying to run a parallel MCMC chain in JAGS using snow. I simply need two chains and am trying to create two parallel instances on one computer. I use the standard line
...
1
vote
1answer
102 views
Thinning chains in BUGS/JAGS
Hi I have a quick question about the details of running a model in JAGS and BUGS.
Say I run a model with n.burnin=5000, n.iter=5000 and thin=2. Does this mean that the program will
run 5,000 ...
2
votes
1answer
142 views
Categorical distribution in JAGS
How do I specify for a variable to be uniformly sampled from the discrete values $1,2,\ldots,10$ in JAGS? I guess I want to use the dcat() distribution, but I have yet to find good documentation of ...
0
votes
0answers
76 views
Multilevel calibration curve in jags
The problem
I am trying to fit a calibration curve from known x and y with jags. I would then like to predict new xes, based on the measurement of new ys. For this, I am following Hamada et al. ...
2
votes
0answers
121 views
Combining posterior distributions
I have 5 different posterior distributions (mcmc samples) which all estimate the same parameter beta. The 5 models are all obtained from 5 independent standardized datasets but estimate the same ...
1
vote
1answer
194 views
Modelling a mixed model in JAGS/BUGS
I am currently in the process of implementing a model for soccer result prediction in JAGS. Actually, I have implemented several, but I have reached my most difficult challenge yet: A model described ...
5
votes
2answers
212 views
What level to use when making inferences on the group mean in a hierarchical Bayesian analysis?
(This question is a bit related to a previous question of mine, but that question was about between subject comparison while this question is specifically about making inferences the group mean.)
...
4
votes
1answer
258 views
What's the Bayesian counterpart to Pearson product-moment correlation?
I was wondering what the counterpart to Pearson product-moment correlation would be in a Bayesian framework. Or if there are many alternatives, what would be the most convenient or conventional ...
1
vote
0answers
145 views
JAGS - problem with taking submatrices
I'm trying to use JAGS for clustering mixtures of multivariate normal distributions. In order to model different covariance structures in each cluster I wanted to use one big (C*D)xD matrix (C - ...
1
vote
0answers
49 views
Is it possible to compute integrals in JAGS?
Is it possible to specify a model that uses an integral in the JAGS dialect of BUGS? (I believe this is possible in *BUGS, but I use a Mac, on which it seems JAGS is better supported.)
3
votes
2answers
127 views
Non-conventional form for a full conditional
I have a full-conditional of the form :
$$
p(X|...) \propto \exp(-(aX^2 +bX +c/X)),
$$
All of the other full-conditionals of my model simplify to a simpler form and for a sake of simplicity, I would ...
2
votes
0answers
134 views
What prior distributions could/should be used for the variance in a hierarchical bayesisan model when the mean variance is of interest?
In his widely cited paper Prior distributions for variance parameters in hierarchical models (916 citation so far on Google Scholar) Gelman proposes that good non-informative prior distributions for ...
1
vote
2answers
205 views
2
votes
0answers
96 views
What level to use when comparing subjects in a hierarchical Bayesian analysis?
Say that I have an experiment where I test the reaction time of a number of subjects where each subject makes many reaction time trials. In a Bayesian framework the reaction times ($y$) could be ...
5
votes
2answers
158 views
Hierarchical models for multiple comparisons - multiple outcomes context
I've just been (re-)reading Gelman's Why we (usually) don't have to worry about multiple comparisons. In particular the section "Multiple outcomes and other challenges" mentions using a hierarchical ...
2
votes
2answers
275 views
How can I model a proportion with BUGS/JAGS/STAN?
I am trying to build a model where the response is a proportion (it is actually the share of votes a party gets in constituencies). Its distribution is not normal, so I decided to model it with a beta ...
0
votes
1answer
302 views
Code Problem in Lognormal Bayesian Model in JAGS/WinBUGS
I have a data set with 853 units. Below, a small sample of it:
y
...
2
votes
2answers
355 views
How to use the SD of a normal sampling distribution to specify the gamma prior for the corresponding precision?
The gamma distribution is a commonly used prior distribution for the precision ($1/sd^2$) of a normal distribution in Bayesian hierarchical modeling. I want to use an informed prior for the variance ...
0
votes
0answers
112 views
ANOVA with uncertain values - attempt to redefine node
I'm trying to do one-way ANOVA on uncertain (latent) input value YReal[i] (each input value is not exactly known, but it is given as normal distribution with mean ...
4
votes
2answers
179 views
First iteration in MCMC coda chain is different from initial values
I have my jags output object. In order to understand how MCMC coda chains work, I tried to see if first iteration in each MCMC chain is equal to the initial values supplied. And it is different! The ...
4
votes
1answer
112 views
Crazy divergence in mixed model - chains start well but go crazy later
I'm trying to compute a mixed model using jags (R2jags) and I got very strange divergence. The chains started so well, very well according to the results expected (also see ...
3
votes
2answers
213 views
How to model data in jags/bugs generated by taking the minimum of two random variables?
I have been thinking of modeling human timing data using jags where the data comes from an experiment where participants tap in time with a very slow metronome. The data is then a number of ...
0
votes
1answer
420 views
jags missing data error
I am estimating a probit in jags on a time series cross sectional data set (country years) with 5 covariates, 4 of which are lagged, so the first observation for each country will be missing on those ...
2
votes
2answers
228 views
Parameters without defined priors in Stan
I've just started to learn to use Stan and rstan. Unless I've always been confused about how JAGS/BUGS worked, I thought you always had to define a prior ...
0
votes
0answers
170 views
Generating and analyzing predicted data in JAGS
I am trying to model a logistic regression on data predicted from the results of a previous logistic regression, and am having trouble figuring out how to do it, either in OpenBUGS (BRugs) or JAGS ...
7
votes
2answers
352 views
How can I generate a plot similar to that produced by plot.bugs and plot.jags from an mcmc.list?
R seems to be able to output nice summary plots from the bugs and jags objects generated by the functions R2WinBUGS::bugs and ...
0
votes
0answers
277 views
How to implement credible 95% interval for median odds ratio using JAGS?
As described in Merlo et al (J Epidem Comm Health 2006), the 95% credible interval for MOR is calculated using MCMC. MOR is defined as $\exp(\sqrt{2\sigma^2}\times 0.675)$, where $\sigma$ is the ...
2
votes
0answers
145 views
How to sample from the prior predictive distribution in jags?
Is there an example available of how I can sample from the prior predictive distribution (without data) in jags? I would like to get a better sense for the contribution of the prior in a multilevel ...
4
votes
2answers
619 views
Hierarchical multinomial logit with R/JAGS
I am working on a small project where I have to do a Choice Based Conjoint (CBC) analysis. In order to get the part-worths for the different consumers I need to estimate a hierarchical multinomial ...
2
votes
1answer
282 views
Calculate R-squared with JAGS and R
I have the following model that I am running in JAGS from R:
...
8
votes
1answer
308 views
How to generate predictions with rjags?
I've used rjags to run MCMC on a model, specified in the JAGS language. Is there a good way to extract that model and perform predictions with it (using the posterior distributions of my parameters)? ...
3
votes
1answer
345 views
Tips and tricks for getting good parameter estimates using Bayesian nonlinear regression
I've been playing around with fitting nonlinear models using rjags. Specifically 3 and 4 parameter sigmoid curves, e.g.,
...
2
votes
0answers
740 views
JAGS: unobserved parents and intialization
I have a very simple multinomial logistic regression problem; it's a simplified version of the alligator lake/food/size BUGS example. In my case I have (effectively) lake/food and have just stripped ...
6
votes
1answer
463 views
regularized bayesian logistic regression in JAGS
There are several math-heavy papers that describe the Bayesian Lasso, but I want tested, correct JAGS code that I can use.
Could someone post sample BUGS / JAGS code that implements regularized ...
3
votes
1answer
282 views
Bayesian mixed model regression with a between subjects factor
I'm trying to specify a model in JAGS/rjags with one between subjects factor (a, with two levels - Y, N) interacting with one repeated measures continuous variable x plus subject varying slopes and ...
2
votes
0answers
209 views
ordered probit in JAGS
I am running into an error
Error in node Y1[5]
Observed node inconsistent with unobserved parents at initialization
trying the following bugs model in JAGS ...