Questions tagged [jags]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
50 views

Estimate a parameter from subset of the data, other parameters from all data

I use Bayesian random effects models [$y_i \sim bernoulli\_logit(\beta + \alpha_{subj})$ $\alpha_{subj} \sim normal(0, \gamma)$], the $y$ outcome is binary. Part of the subjects have two observations,...
1
vote
0answers
423 views

How to self-define likelihood with dmulti() in JAGS?

I am running a hierarchical Bayesian model and would like to use the "ones trick" to self-define a likelihood function, just to prevent the problems that dmulti() may have with zeros. To be able to ...
1
vote
0answers
122 views

Standard Deviations of Random Effects

I would have a question regarding the estimates of the random effects for a model fitted with JAGS. I want to fit a mixed model of the form: $$y_{ij}=\beta_{0j}+\beta_{1j}x_{ij}+\beta_2+e_{ij}$$ $$\...
2
votes
0answers
160 views

Comparing the Widths of two Posterior Distributions

I have a question regarding the task of my term paper case study, which is about Bayesian multilevel modelling and I would greatly appreciate it, if you could help me out. The exact assignment reads ...
1
vote
1answer
1k views

How do I specify a Bayesian Beta binomial model, with predictor variables, for R2jags?

I want to have a beta-binomial Bayesian model, with R2jags. I understand I need something like this: ...
1
vote
1answer
2k views

rjags mixture model for a combination of normal and gamma distributions

Is it possible in rjags to create a mixture model in which one distribution is normal and includes negative values, while the other distribution has only positive support? Our data are global ...
2
votes
0answers
163 views

Meaning of Baseline Before Sum to Zero

I am trying to specify a Bayesian hierarchical split-plot model in JAGS. I have been following Doing Bayesian Data Analysis by John K. Kruschke, however the model I am attempting is not included in ...
0
votes
1answer
268 views

Cumulative link model in JAGS or BUGS [closed]

I'm trying to implement a cumulative link model in JAGS. My outcome variable (Likert-style questionnaire) has four categories. There is currently no predictor in the model, I will add them once the ...
1
vote
0answers
61 views

Meaning of Intercept Parameter in a Bayesian Longitudinal HLM

I have been working through John Kruschke's excellent book on Bayesian Data Analysis but now have found myself in experimental-design territory not covered in the book: a longitudinal linear mixed-...
0
votes
1answer
357 views

Winbugs beta distribution

I have fitted a likelihood function with a dbeta function in WinBUGs as follows ...
1
vote
0answers
114 views

Gibbs Sampling / Monte Carlo with Weights

Consider pairs of data and their population weights $(y_i, \omega_i), i = 1, 2, \dots$ alongside some hierarchical structure, $$y_i\leftarrow\theta_{i(j)} \leftarrow \gamma$$ where $i(j)$ is perhaps ...
0
votes
1answer
63 views

Reference for modeling with WinBugs

Does anyone have any good reference for beginners in WinBUGS about modeling? I already have some familiarity with R, but I had never used R2WinBUGS before. I'm interested in making beta, beta ...
1
vote
1answer
315 views

JAGS: error when trying to compare models with different prior distributions

Using this data in R: misprints <- list(N=6, x = c(3, 4, 2, 1, 2, 3)) I wrote a very simple model with a gamma prior and a Poisson likelihood that looks like ...
0
votes
1answer
456 views

Having integration in Bayesian model: what package to use?

I have a bit experience on Bayesian analysis and am a JAGS user. Recently I have to run a more complicated model that contains integration (I use adaptIntegrate from cubature package in the original ...
1
vote
0answers
135 views

Bayesian updating in JAGS - data not reaching posterior distribution

I am trying to model the survival of a bird species as the function of a habitat variable, using JAGS run with the R package R2jags. When I leave the habitat variable out, I get believable estimates ...
2
votes
1answer
70 views

Calculating the minimum value of a higest density interval from a posterior paramter estimate

I have been working through Doing Bayesian Data Analysis by John K. Kruschke. In this book he has created a function for calculating the minimum and maximum values of the Highest Density Interval (HDI)...
0
votes
1answer
134 views

Parameters not in the credible interval interpretation in Bayesian model

I create a spline model in a Bayesian framework and all the parameters that are estimating the spline (the random effects of the spline) are lying between a Credible interval of negative something to ...
0
votes
1answer
204 views

Bayesian approach systematically overestimates sigma (SD) [closed]

I am quite stunned: I did some test on generated data and found out that model estimates from JAGS of the standard deviation of input data are systematically overestimated by certain and fixed ...
3
votes
1answer
111 views

Estimating coin bias from multiple adversary observations

I have a set of biased coins $N$, where each coin has a different bias $\theta_i$ (probability of heads for $i$th coin is $\theta_i$). This bias is unknown and needs to be estimated. There are $K$ ...
3
votes
1answer
99 views

Recovering noise-free variables in binary trials

I have a collection of $N$ different objects. An expert "looks" at the object $O_i$ and produces a prediction: binary label $y_i\in\{0,1\}$. The predicted binary label $y_i$ is observed (data) and is ...
1
vote
0answers
696 views

JAGS better than Stan for fitting CPDs in a Bayesian Network?

I have a Bayesian network DAG structure, and a conditional probability distribution (CPD) for each node. I want to fit the parameters of the CPDs with a Bayesian method, since I have some prior ...
1
vote
0answers
769 views

DIC vs PED in JAGS

JAGS allows reporting of DIC and also PED (penalized expected deviance). What are differences between these two statistics? Which is better for what purpose? DIC was the first one, PED was evidently ...
1
vote
0answers
665 views

JAGS code for multilevel model with AR(1) autoregression - does this look okay?

There are a number of threads, blogs etc. discussing autoregressive models in JAGS, and but only a few that supply the code. John Kruschke's code for an autoregressive model with a sinusoidal ...
4
votes
2answers
534 views

Is there a software that can draw a Bayesian model from JAGS?

I have a Bayesian model and I want to draw it like in the book Doing Bayesian Data Analysis page 225. I wonder if there is a software that exists that can do that. I've done this by hand but I'm not ...
2
votes
0answers
241 views

Diagonal inflated Bivariate Poisson model

I am trying to fit the Bivariate Poisson distribution to a set of sports results to serve as a comparison model to a new model I am developing/developed with my masters thesis.My model is as follow: <...
0
votes
1answer
576 views

rjags does not seem to use initial values specified

I'm running the following normal / poisson simulation, and fitting the model with rjags. I'm having trouble getting rjags to actually use the initial values I specify. In this simulation, I am ...
1
vote
0answers
233 views

Theoretical ground which forbids the use of Frequentist SAR specifications in Bayesian estimations?

Abridged question version Given the constraints I face when mixing frequentist SAR specifications (e.g. regressand autoregressive process, involving binary correlation structure) with Bayesian ...
2
votes
1answer
678 views

error in JAGS beta-regression model R - value out of range in 'gammafn'

I am running a simple beta regression model in JAGS, following the example given here. Here is my JAGS model code as an R object: ...
2
votes
1answer
875 views

How to add an interaction term in JAGS?

I'm trying to add an interaction term to a JAGS model. I found this where it shows some interaction terms. But I don't understand what's the guide lines to create an interaction term, which is ...
0
votes
1answer
196 views

Accounting for interval censoring JAGS model of binary mortality data

I have data on tree mortality, based on two observations of a tree in time. All trees are alive at the beginning of the interval. The length of the re-measurement interval, ...
1
vote
1answer
673 views

coding a JAGS error model for a dependent variable that has increasing variance as a function of the magnitude of the dependent variable

I am running a model in JAGS. I have a situation where y is a linear function of x, but the error in ...
2
votes
2answers
2k views

Calculating prediction variance from JAGS model of a bernoulli outcome in R

I have a model of a bernoulli random process I fit using JAGS via the rjags package in R. Here are some example data, as well as code to fit the given models in ...
6
votes
1answer
552 views

Does JAGS have an R front end like brms for Stan? [closed]

Does JAGS have an R front end like brms / rstanarm for Stan? Is anyone working on one for JAGS?
3
votes
1answer
1k views

Jags Implementation of Multivariate Response Probit Model

I am trying to implement the latent variable interpretation of a probit model with vector response (described on wiki here), but am receiving an error. In this model, we have a matrix $X$, $n \times ...
1
vote
1answer
560 views

generate uncertainty for a prediction using JAGS via rjags in R [closed]

Say I have a relationship between two variables, that I have successfully fit using JAGS via the rjags package for R. Below is the code to generate the data, and ...
2
votes
1answer
955 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 ...
7
votes
1answer
6k 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
1answer
568 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
1answer
214 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
59 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: ...
2
votes
0answers
312 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 following:...
1
vote
1answer
699 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
151 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
141 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
1answer
1k 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 ...
2
votes
2answers
6k 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: ...
3
votes
1answer
5k 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 ...
1
vote
0answers
281 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 data....
0
votes
1answer
736 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
562 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 two ...