Questions tagged [runjags]

runjags: Interface Utilities, Model Templates, Parallel Computing Methods and Additional Distributions for MCMC Models in JAGS

User-friendly interface utilities for MCMC models via Just Another Gibbs Sampler (JAGS), facilitating the use of parallel (or distributed) processors for multiple chains, automated control of convergence and sample length diagnostics, and evaluation of the performance of a model using drop-k validation or against simulated data. Template model specifications can be generated using a standard lme4-style formula interface to assist users less familiar with the BUGS syntax. A JAGS extension module provides additional distributions including the Pareto family of distributions, the DuMouchel prior and the half-Cauchy prior.

51 questions
5
votes
2 answers

extending burn-in period after JAGS model has been run in runjags for R

The runjags package for R is fantastic. The parallel capabilities and the ability to use the extend.jags function make my life so much better. However, sometimes, after I run a model, I realize the burn-in phase should be have been longer. How can I…
colin
  • 2,606
  • 4
  • 27
  • 57
4
votes
3 answers

JAGS - hierarchical model comparison not jumping between models even with pseudopriors

I'm using the hierarchical modelling framework described by Kruschke to set up a comparison between two models in JAGS. The idea in this framework is to run and compare multiple versions of a model, by specifying each version as one level of a…
Tim
  • 69
  • 6
4
votes
1 answer

Unable to extract DIC

I am using runjags and am trying to get the DIC for my model. I know that if I print the runjags object it will return the model summary which would include the DIC, but my model a lot of variables, so calculating the summary statistics is taking…
rackhamup
  • 598
  • 1
  • 5
  • 16
4
votes
1 answer

Is there a way to dump JAGS node values for debug purposes?

I got the following error from JAGS: Error in node Y[107] Invalid parent values From this mere information it is very difficult to find out what is happening there. It is caused by this part of code: pi[j,1] <- 1 - M[site[j]] * phi[j] * (1 - (1 -…
Tomas
  • 57,621
  • 49
  • 238
  • 373
3
votes
2 answers

running multiple parallel processes in parallel R

I run Bayesian statistical models with each chain on a separate processing node using the runjags package in R. I want to fit multiple models at onceby nesting run.jags calls in a parallel loop using the foreach package. However, this often results…
colin
  • 2,606
  • 4
  • 27
  • 57
3
votes
1 answer

JAGS error - Possible directed cycle involving some or all of the following nodes

The full dataset contains ~11,000 rows. I have been running the code with K=400 whilst checking that the code runs. All of the rows relate to a specific cell on a map and contain information extracted from Sentinel-2 images and a digital elevation…
Bong112
  • 161
  • 10
3
votes
1 answer

Multiplying a vector of parameters by a matrix of independent variables in JAGS

I am fitting a multivariate model in JAGS using the dirlichet distribution. I have a matrix y of 3 species proportional abundances. #generate 3 columns of species proprotional abundance data y <- matrix(ncol = 3, nrow = 100) y[,] <-…
colin
  • 2,606
  • 4
  • 27
  • 57
3
votes
1 answer

Fitting a multivariate dirlichet model in JAGS for R

I am trying to fit a a multivariate model to species composition data using JAGS, implemented in R. I have data on 3 species relative abundances (bounded between [0,1]), two of which are correlated. Here is code to generate similar data. #generate…
colin
  • 2,606
  • 4
  • 27
  • 57
3
votes
1 answer

runjags object is too big

I am trying to run JAGS using a new package runjags, because R2jags has a bug (the full model code is in the question https://stats.stackexchange.com/q/62006/5509): require("runjags") out <- run.jags("Poisson.OD.t.test.txt", params, win.data, nc,…
Tomas
  • 57,621
  • 49
  • 238
  • 373
2
votes
2 answers

DIC and PED when running JAGS parallely

I am running JAGS in parallel, i.e. each chain in separate process/thread. I am calling run.jags(..., method = "rjparallel", params = c(..., "dic", "ped")). I get the following error: jags The DIC, PED, pD, full.pD and pOpt cannot be assessed when…
Tomas
  • 57,621
  • 49
  • 238
  • 373
2
votes
1 answer

error passing model JAGS

I am currently busy with a multiple regression analysis with JAGS toolbox. I'm using runjags, however I still get an error: Error parsing model file: syntax error on line 3 near "," This how my model looks like: modelString2 = " model { for ( i…
Sarah.d
  • 123
  • 1
  • 2
  • 12
2
votes
1 answer

How to Save a Coda Object in R

I'm unsure of how to save a coda (mcmc.list) object in R. Others have asked similar questions, but I found that the answers given were not particularly clear. Ideally I'd like to save the coda object as an R.data file or a text file (e.g., csv), so…
David Johnson
  • 439
  • 1
  • 3
  • 13
2
votes
1 answer

Setting options of runjags plots

I am trying to run JAGS using the runjags package and produce customized plots - change colors of the chains (the full model code is in the question https://stats.stackexchange.com/q/62006/5509): require("runjags") out2 <-…
Tomas
  • 57,621
  • 49
  • 238
  • 373
1
vote
2 answers

How to coerce NESTED list into double without losing the structure (R)

there seem to many answered questions about how to convert a list into a double, but nothing that seems to keep the structure of the list valid. I have a nested list like that (R output): my_list [[1]] [1] 1 3 4 8 11 13 17 [[2]] [1] 1 2 3…
IndiPsi
  • 37
  • 5
1
vote
0 answers

"This R function is purely indicative and should never be called": Why am I getting this error?

I am returning to some old code. I am sure it worked in the past. Since I last used it, I've upgraded dplyr to version 1.0.0. Unfortunately, devtools::install_version("dplyr", version='0.8.5") gives me an error whilst compliling, so I can't…
Limey
  • 10,234
  • 2
  • 12
  • 32
1
2 3 4