audrey-b / sims

An R package to simulate data from JAGS or R Code
https://poissonconsulting.github.io/sims/
Other
1 stars 2 forks source link

why having to skip following on appveyor (works on AWS windows) #24

Closed joethorley closed 4 years ago

joethorley commented 5 years ago
  generative_model <- "
rand ~ dnorm(0,1)
for (i in 1:length(year)){
  cc[i] ~ dpois(lambda[i])
  log(lambda[i]) <- alpha + beta1 * year[i]
}
"
  monitor <- c("cc", "rand", "lambda")

  parameters <- nlist(alpha = 3.5576, beta1 = -0.0912)

  constants <- nlist(year = 1:5)

  skip_on_appveyor() # yet works on AWS windows
  set.seed(2)
  expect_equal(sims_simulate(generative_model,
    constants = constants,
    parameters = parameters,
    monitor = monitor, stochastic = NA, latent = NA),
  structure(list(structure(list(cc = c(27, 38, 36, 21, 13), lambda = c(32.0212581683725, 
29.2301292225158, 26.6822886806137, 24.3565303394963, 22.2334964320294
), rand = 0.323078183488302, year = 1:5), class = "nlist")), class = "nlists"))
joethorley commented 5 years ago

not JAGS version and can't test using devtools::check_win_release() as chk and nlist not on CRAN

joethorley commented 5 years ago

This is the result on appveyor

$cc
[1] 33 25 35 34 19

$lambda
[1] 32.02126 29.23013 26.68229 24.35653 22.23350

$rand
[1] 0.3230782

$year
[1] 1 2 3 4 5
joethorley commented 5 years ago

Note implementing it with R code works on all platforms so it is something to do with an interaction between JAGS and the OS and the RNG.

joethorley commented 5 years ago

I should try coming up with an reprex

joethorley commented 4 years ago

switched to GitHub actions