Questions tagged [r2jags]

R2Jags is an R package that interfaces with the JAGS Gibbs sampler.

Information and Downloads:

depends on another package, .

95 questions
0
votes
1 answer

Dimension mismatch when trying to use dmulti with rjags

I am trying to fit the model below using rjags but I get a dimension mismatch error. The model runs well in WinBUGS and I can't figure out how to change the code. Thanks in advance for any help. Data: dataset <- list(n1 = 462, n2 = 537, …
Oswaldo
  • 65
  • 3
0
votes
0 answers

Jags error when using jags.parallel(): "all connections are in use"

I am using the R2Jags package and I want to use the jags.parallel function to speed up computations. I use the following code: jags.data <- list("y", "N") n.chains = 3 n.burnin=5000 n.thin=1 n.iter=10000 mod_ss =…
dreamer
  • 1,192
  • 5
  • 20
  • 42
0
votes
2 answers

How to pass control to previous iteration in for loop in R

I am running a for loop in R (as part of a power analysis for a model I ran with R2jags). At some point I want to know if my MCMC chains have converged, if not I want to skip that iteration of the loop. However, I don't want to skip to the next…
user4836336
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 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
1 2 3 4 5 6
7