jags.parallel

strange jags.parallel error / avoiding lazy evaluation in function call

ⅰ亾dé卋堺 提交于 2019-12-18 08:57:40
问题 I have a function call (to jags.parallel ) that works when given a numerical argument like n.iter = 100 but fails when the argument uses a variable value, n.iter = n.iter . This looks like it might be a bug in jags.parallel A minimal reproducible example of the error: library(R2jags) model.file <- system.file(package="R2jags", "model", "schools.txt") J <- 8.0 y <- c(28.4,7.9,-2.8,6.8,-0.6,0.6,18.0,12.2) sd <- c(14.9,10.2,16.3,11.0,9.4,11.4,10.4,17.6) jags.data <- list("y","sd","J") jags

Using jags.parallel from within a function (R language Error in get(name, envir = envir) : object 'y' not found)

最后都变了- 提交于 2019-12-13 12:32:26
问题 Using jags.parallel from the command line or a script works fine. I can run this modified example from http://www.inside-r.org/packages/cran/R2jags/docs/jags just fine # An example model file is given in: model.file <- system.file(package="R2jags", "model", "schools.txt") #=================# # initialization # #=================# # data J <- 8.0 y <- c(28.4,7.9,-2.8,6.8,-0.6,0.6,18.0,12.2) sd <- c(14.9,10.2,16.3,11.0,9.4,11.4,10.4,17.6) jags.data <- list("y","sd","J") jags.params <- c("mu",

jags.parallel: setting less clusters than chains: “Error in res[[ch]] : subscript out of bounds”

帅比萌擦擦* 提交于 2019-12-12 13:20:20
问题 I have only 2 core CPU so logically I want to set only two parallel threads/clusters for jags.parallel . unfortunatelly, when I try it and the number of chains is 3 or 4, jags fails with an error: Error in res[[ch]] : subscript out of bounds Is lower number of threads (than chains) not allowed? I have not encountered such statement in the documentation. Anyway, it doesn't make sense to run 4 chains in 4 threads/clusters, when your CPU only has 2 cores! Threads will fight for CPU, caches won't

jags.parallel - Error in get(name, envir = envir) : invalid first argument

故事扮演 提交于 2019-11-29 10:57:15
When using jags.parallel , I get the following error: > out <- jags.parallel(win.data, inits, params, "Poisson.OD.t.test.txt", + nc, ni, nb, nt); Error in get(name, envir = envir) : invalid first argument The same call using jags function runs OK. I have only found one thread on this topic , but there is only one speculative suggestion that does not apply nor work here. Reproducible code, taken from Introduction to WinBUGS for ecologists, see chapter 14.1 (slightly modified): set.seed(123) ### 14.1.2. Data generation n.site <- 10 x <- gl(n = 2, k = n.site, labels = c("grassland", "arable"))

jags.parallel - Error in get(name, envir = envir) : invalid first argument

假装没事ソ 提交于 2019-11-28 04:08:15
问题 When using jags.parallel , I get the following error: > out <- jags.parallel(win.data, inits, params, "Poisson.OD.t.test.txt", + nc, ni, nb, nt); Error in get(name, envir = envir) : invalid first argument The same call using jags function runs OK. I have only found one thread on this topic, but there is only one speculative suggestion that does not apply nor work here. Reproducible code, taken from Introduction to WinBUGS for ecologists, see chapter 14.1 (slightly modified): set.seed(123) ###