rjags is a R interface to the JAGS MCMC library for Bayesian graphical models.

learn more… | top users | synonyms

7
votes
1answer
85 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 ...
2
votes
1answer
92 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
5 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
0answers
9 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 ...
0
votes
0answers
41 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. ...
1
vote
2answers
30 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
14 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 ...
3
votes
1answer
113 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
169 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: ...
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
60 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
110 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
45 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
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
1answer
185 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: ...
3
votes
1answer
222 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
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: ...
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: ...
1
vote
0answers
311 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 ...
0
votes
1answer
496 views

JAGS array indexing [closed]

I have a relatively simple multivariate response problem that seems to causing me problems with array indexing. I've scraped/rewworked the model program down to the bare essentials and hopefully ...
2
votes
0answers
657 views

Help with JAGS model using matrix multiplication and Dirichlet prior

I want to set up a simple JAGS model using matrix multiplication, but I am not sure how to set up the matrices. My overall equation is $c=yx$ where $c$ is a 2x1 matrix defined in R of observed data ...
5
votes
2answers
496 views

How to conditionally run element of JAGS script based on user supplied variable?

Background: I often find that when working with JAGS that I end up with a lot of JAGS scripts as I explore different models. After a while I might settle on a set of models that I'm going to report, ...
1
vote
1answer
154 views

JAGS burn-in phase takes ZERO time? [duplicate]

My breath was taken away by this. I tried to run my JAGS model with different number burn-in samples but it still takes the same amout of time!! ...
2
votes
2answers
206 views

How to analyze this data using rjags, or any other way?

There are three groups that received different treatments and then learn a task which they are scored on over the course of 60 sessions. 1) How to choose a function to fit? -The best choice in this ...
3
votes
1answer
727 views

Define Priors for Dirichlet Distribution parameters in JAGS

I'm defining a Multinomial-Dirichlet model in JAGS and want to assign some hyperpriors to the parameters of the Dirichlet distribution. In the WinBugs manual I read that "the parameters of Dirichlet ...
2
votes
1answer
191 views

Autoregressive prior distributions

I have a set of 50 (P) time series' and each one is on a slightly different but should be influenced by the same effects of time. To get the time effects I have ...
3
votes
1answer
1k views

How to specify the Wishart distribution scale matrix

I'm running the below Bayesian mixing model in R using the rjags package, but I am having difficultly in specifying the scale matrix for the Wishart distribution. Essentially, I want Sigma.inv to be a ...
0
votes
2answers
308 views

Specifying Dirichlet prior in rjags

I am running the below mixing model using the rjags package in R, but I keep getting the error message ...
5
votes
2answers
368 views

Should coin flips be modeled as Bernoulli or binomial draws in RJags?

What is the best way to model coin flips as a hierarchical model? Do you say coin draws are a series of draws from Bernoulli trials or as one draw from a binomial distribution? That is something like ...
0
votes
1answer
66 views

Simulated single value based on multiple chains in RJAGS

I am using RJAGS to simulate the posterior distribution of event that a certain candidate will win the presidential election. I need to find the actual percentage that one of the candidates will have. ...
6
votes
6answers
705 views

R2jags does not remove the burn in part sometimes?

I found out that the function jags() in the R2jags package sometimes does not remove the burn in part even with the option ...
1
vote
0answers
170 views

How to define CDF of bivariate normal distribution in rjags?

I am trying to define my own likelihood in rjags. I want to define the CDF of bivariate normal distribution under rjags. Does anyone know how to define the CDf of bivariate normal in rjags?
2
votes
0answers
946 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
2answers
929 views

Compilation error in JAGS

With this data: ...
0
votes
2answers
2k 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 ...
0
votes
0answers
406 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 ...
2
votes
0answers
259 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 ...
10
votes
1answer
1k 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)? ...
2
votes
1answer
2k 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
1k 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
1answer
960 views

How to combine step(x) and dbern(p) in JAGS/WinBUGS?

The problem involves trying to characterize the probability: P.f = Pd*Pr{t1 < t2} using jags or WinBUGS. The issue is the last term where both t1 and t2 are ...
1
vote
1answer
264 views

Data and model blocks in JAGS

I am trying to model a function of observed data in JAGS. For example x[i,t]/phi ~ dpois(mu) where x is observed and phi is a parameter in the model. I can't ...
3
votes
1answer
3k views

Ordered logit in JAGS

I am trying to code a simple model with JAGS: ...
2
votes
2answers
634 views

How to run JAGS as fast as possible on Mac?

I am running lots of simulations in JAGS 3.1.0 , which I have compiled from source. I am using a mid-2009 Macbook Pro 13 2.53GHz. Is there any step by step tutorial (from scratch) to compile ATLAS or ...
6
votes
1answer
600 views

How does dinterval() for interval censored data work in JAGS?

I am trying to understand how dinterval() works in JAGS for censored data. I am modeling coarse data where I only have upper and lower bounds for each data point (not the true value). Here is a ...
10
votes
1answer
415 views

MCMC converging to a single value?

I'm trying to fit a hierarchical model using jags, and the rjags package. My outcome variable is y, which is a sequence of bernoulli trials. I have 38 human subjects which are performing under two ...