Questions tagged [jags]

a cross-platform Gibbs sampler similar to BUGS for analysis of Bayesian hierarchical models using Markov Chain Monte Carlo simulation.

A cross-platform Gibbs sampler similar to BUGS for analysis of Bayesian hierarchical models using Markov Chain Monte Carlo simulation.

Available at http://mcmc-jags.sourceforge.net.

472 questions
0
votes
1 answer

Attach() -> object not found error (R2Jags)

I am using the R2Jags package. I first obtain the model as follows: jags.data = list("Y"=y, "N"=N, Y1=y[1], C=x1) # The parameters that we are monitoring (must monitor at least 1) jags.params=c("sd.q","sd.r","Y", "X1",…
dreamer
  • 1,192
  • 5
  • 20
  • 42
0
votes
1 answer

How to specify to rjags to run hierarchical model with multiple conditions

I'm trying to run a Bayesian regression model using rjags, and my data have 4 relevant conditions. The model runs fine when collapsing across conditions, however I don't understand where/how to specify that I want this model to run separately for…
kgh22
  • 1
0
votes
1 answer

Homebrew, Anaconda and other girls and boys

ers! There are several posts discussing how to react on: brew doctor i.e., to some warnings. See, for example: Homebrew unbrewed files Brew doctor - “warning: unbrewed header files were found in /usr/local/include”? Best Practices for dealing with…
striatum
  • 1,428
  • 3
  • 14
  • 31
0
votes
2 answers

Can I tell JAGS to re-start automatically after failure with initial values?

My model failed with the following error: Compiling rjags model... Error: The following error occured when compiling and adapting the model using rjags: Error in rjags::jags.model(model, data = dataenv, inits = inits, n.chains =…
Tomas
  • 57,621
  • 49
  • 238
  • 373
0
votes
1 answer

Ordered Probit in Jags Using scaled inverse wishart

I am trying to use the following code (adapted from the code given in Gelman and Hill's Book) to estimate a varying coefficient/intercept ordered probit model in Jags. However, it is giving me a "Observed node inconsistent with unobserved parents at…
0
votes
1 answer

Combine corresponding elements of lists into either vector or list

I am going to be using %dopar% and foreach, and I need to combine the outputs. The function that will be called in parallel has as it's output a list which has a constant length for each call. However, the lengths of the elements of this list are…
rbatt
  • 4,677
  • 4
  • 23
  • 41
0
votes
0 answers

For loop reverse order JAGS

I am trying to figure out how to avoid to enter this for loop without using an if statement (not present in JAGS). In other words, I need this loop not to run in reverse order, i.e. when Je[i] - 1 is less than 2. for (j in 2:(Je[i]-1)){ Z[i,j]…
0
votes
1 answer

JAGS: unit-specific time trends

Using JAGS I am trying to estimate a model including a unit-specific time trend. However, the problem is that I don't know how to model this and so far I have been unable to find a solution. As an example, consider we have the following…
horseoftheyear
  • 917
  • 11
  • 23
0
votes
2 answers

Will JAGS evaluate all parent nodes of dcat, or only the one needed?

Say we have the following statement: for (i in 1:N) { pi[i,1] <- .... pi[i,2] <- .... pi[i,3] <- .... ... pi[i,100] <- ... Y[i] ~ dcat(p[i,]) } Let's say that Y[1] = 5. Will jags evaluate all the pi[1,1:100] nodes, or the…
Tomas
  • 57,621
  • 49
  • 238
  • 373
0
votes
1 answer

Is there a changelog for JAGS?

Is there a history of changes for JAGS? I've been looking around the JAGS homepage and sourceforge and found nothing.
Tomas
  • 57,621
  • 49
  • 238
  • 373
0
votes
1 answer

Too low psrf values in runjags summary?

Runjags is reporting very low psrf = 1.0047 for a chain that apparently has convergence problems: > print(o, vars = "q_date2") JAGS model summary statistics from 3000 samples (chains = 3; adapt+burnin = 1000): Lower95 Median Upper95 …
Tomas
  • 57,621
  • 49
  • 238
  • 373
0
votes
1 answer

Inserting estimates from R to jags

For my research I need to estimate variance, and insert these estimates into the scale matrix (called R in my JAGS-code) of my wishart distribution in JAGS. I use R2JAGS (on a mac) and I would like to know how I could do this with R/JAGS code? I…
Jolanda Kossakowski
  • 451
  • 2
  • 6
  • 14
0
votes
1 answer

How can I extract data from mcmc RJAGS

I'm running the following model where I got a measurement for each polling week. Which produce more than 100 alpha vectors for each party. May question is, how could I stockpile them in a way I could draw a line graph? model{ ## measurement …
user45367
  • 151
  • 1
  • 3
  • 14
0
votes
1 answer

Bayesian ANCOVA in R via jags

I'm trying to implement a Bayesian ANCOVA that takes account of heteroscedasticity in R using JAGS. However, despite going through several tutorials of Bayesian simple regression and ANOVA, I can't understand how to prepare the file for JAGS. Here…
Agus camacho
  • 868
  • 2
  • 9
  • 24
0
votes
1 answer

Poisson regression with multiple covariates using JAGS:How to simplify model

I have a claim count dataset with y as claim counts,16 covariates namely x1 to x16(consists of 0 and 1) which I arranged in a design matrix called X and E as exposure (also called offset). I'm trying to fit Poisson regression to this dataset using…
FadzliFuzi
  • 71
  • 1
  • 6
1 2 3
31
32