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
0 answers

Dimension mismatch in subset expression in R/JAGS

I am new to using rJags. I have a jags model in R (version 4.3.0 (2023-04-21 ucrt)) using rjags (rjags_4-14). I am trying to add a random intercept of "creek" (Clean in the data below) to my model. When using the code below, I get the error: Error…
vermicellion
  • 338
  • 2
  • 14
0
votes
0 answers

Rjags error: node inconsistent with parents works with one dataset but not the other

I have a jags model in R (version 4.3.0 (2023-04-21 ucrt)) using rjags (rjags_4-14). The model runs without error for one dataset (named below: "works"). With a different dataset, which is the "works" dataset with additional observations (named…
vermicellion
  • 338
  • 2
  • 14
0
votes
0 answers

Calculating I2 from a Bayesian Model Network metanalysis

I am conducting a network metanalysis using both Bayesian (using JAGS run throug R with the package R2JAGS) and frequentist model and, as a form of heterogeneity, I would like to calculate I2. However, after computation, I have complete different…
0
votes
1 answer

Power prior in R2jags

In a fixed power prior model, the model is set up as: Suppose that the event follows a Bernoulli distribution with probability p_i, what I want is to raise the Bernoulli likelihood to the power of w in jags: mod1<-function(){ for(i in 1 : N) { …
Schnappiii
  • 23
  • 6
0
votes
0 answers

Hidden state output from jags model in R

Does the "jags" function of R2jags give estimated states output when estimating a state space model? Or is it to be derived manually using estimated mean/medians of parameter values.
0
votes
1 answer

Latent variable estimation with binary and continuous indicators in JAGS

I am using R2jags to estimate latent factor using both binary and continuous variables. I was wondering wether jags command from R2jags can handle both binary and continuous variables at the same time. I tried to find articles explain the types of…
Sarah
  • 15
  • 3
0
votes
0 answers

effectiveSize() output different from jags()

I am fairly new to JAGS and I am using the jags() function from the package R2jags to run some occupancy models. However, the output from jags() in terms of effective sample size is different from what I get from using effectiveSize() from the coda…
0
votes
0 answers

Error loading archived version of R2jags (0.6.1) with JAGS 4.3.0 installed

I need to test a model in an old version of JAGS and R2jags. I have JAGS 4.3.0 installed on my computer and get an error when trying to load in R2jags 0.6.1. I am able to load R2jags 0.6.1 just fine when I have JAGS 4.3.1 installed. Perhaps the…
pakalla
  • 163
  • 4
  • 10
0
votes
1 answer

Index out of range taking subset error with JAGS while performing network metanalysis

I was trying to develop a model to run a network metanalysis with jags and tried to use a previous code I've already used with WinBUGS (and worked properly). However, when I try to use it with JAGS it gives me a coding error, but it still works…
0
votes
1 answer

The 'R2jags::autojags()' Function Doesn't Converge

I'm running the following code: Data_Frame <- structure(list(Predictor_Variable = c(20.5273283761926, 11.4039835403673, 5.31423215288669, 12.5192134582903, 15.8487716107629, 7.16369490255602, 3.91227747895755, 8.90797802712768, 14.1797202872112,…
David Moore
  • 670
  • 3
  • 15
0
votes
1 answer

Question about array multiplication in JAGS

I am working with race-stratified population estimates and I want to integrate race-stratified populations from three different data sources (census, PEP, and ACS). I developed a model to use information from all these three sources and estimate the…
Emily
  • 1
0
votes
0 answers

How to make leave-one-out cross-validation using R2jags or rjags

I'm trying to make leave-one-out cross-validation using R2jags. I do it easily when I use R2WinBUGS instead with the same codes, but jags() give me this error : Compiling model graph Resolving undeclared variables Allocating nodes Deleting…
0
votes
0 answers

Compilation Error in jags.model: Runtime Error: Index out of range while running linear mixed model

I am trying to run linear mixed model in JAGS in R. I am trying to see influence of year as a random factor on speciesTotal. My code…
Harsh
  • 11
  • 1
0
votes
1 answer

JAGS bayesian MCMC but came into this: Error parsing model file: syntax error on line 5 near "="

when I run my jags model, I got this error message : module glm loaded Error in jags.model(model.file, data = data, inits = init.values, n.chains = n.chains, : Error parsing model file: syntax error on line 5 near "=" And here is my…
0
votes
0 answers

Extrapolation of single-year abundance-class data with trend information provided by multi-year full-count data in integrated binomial N-mix model

I'm trying to integrate multiple types of abundance data in an model using jags in r. I'm struggeling with fitting a binomial N-mixture model with count as well as abundance-class using interval censoring. My data set 1 includes count data…
Johanna
  • 1
  • 1