6

After waiting a week for three MC chains to run, the object was not saved, giving the error "Error: is.atomic(x) is not TRUE". I have run this code or variants thereof many times, so it is probably not my syntax, but possibly something about the object size or an internal stan_glmer error? Log is below and thank you for any help (also advice on how to save intermediate chains would be useful!)

stan.T.mod <- stan_glmer(form2, iter=5000, warmup=5000, thin=1, 
  family = binomial(link = "logit"), prior = student_t(location=0, df = 1, scale = 2.5), 
  prior_intercept = student_t(location=0, df = 1, scale=2.5),
  prior_covariance = decov(shape = 10, scale = 1), 
  chains = 3, seed = 0305991, data=Tbinary.dt)

SAMPLING FOR MODEL 'bernoulli' NOW (CHAIN 1).

Chain 1, Iteration: 1 / 5000 [ 0%] (Warmup) Chain 1, Iteration: 500 / 5000 [ 10%] (Warmup) Chain 1, Iteration: 1000 / 5000 [ 20%] (Warmup) Chain 1, Iteration: 1500 / 5000 [ 30%] (Warmup) Chain 1, Iteration: 2000 / 5000 [ 40%] (Warmup) Chain 1, Iteration: 2500 / 5000 [ 50%] (Warmup) Chain 1, Iteration: 3000 / 5000 [ 60%] (Warmup) Chain 1, Iteration: 3500 / 5000 [ 70%] (Warmup) Chain 1, Iteration: 4000 / 5000 [ 80%] (Warmup) Chain 1, Iteration: 4500 / 5000 [ 90%] (Warmup) Chain 1, Iteration: 5000 / 5000 [100%] (Warmup) Elapsed Time: 394305 seconds (Warm-up) 0 seconds (Sampling) 394305 seconds (Total)

SAMPLING FOR MODEL 'bernoulli' NOW (CHAIN 2).

Chain 2, Iteration: 1 / 5000 [ 0%] (Warmup) Chain 2, Iteration: 500 / 5000 [ 10%] (Warmup) Chain 2, Iteration: 1000 / 5000 [ 20%] (Warmup) Chain 2, Iteration: 1500 / 5000 [ 30%] (Warmup) Chain 2, Iteration: 2000 / 5000 [ 40%] (Warmup) Chain 2, Iteration: 2500 / 5000 [ 50%] (Warmup) Chain 2, Iteration: 3000 / 5000 [ 60%] (Warmup) Chain 2, Iteration: 3500 / 5000 [ 70%] (Warmup) Chain 2, Iteration: 4000 / 5000 [ 80%] (Warmup) Chain 2, Iteration: 4500 / 5000 [ 90%] (Warmup) Chain 2, Iteration: 5000 / 5000 [100%] (Warmup) Elapsed Time: 434251 seconds (Warm-up) 0 seconds (Sampling) 434251 seconds (Total)

SAMPLING FOR MODEL 'bernoulli' NOW (CHAIN 3).

Chain 3, Iteration: 1 / 5000 [ 0%] (Warmup) Chain 3, Iteration: 500 / 5000 [ 10%] (Warmup) Chain 3, Iteration: 1000 / 5000 [ 20%] (Warmup) Chain 3, Iteration: 1500 / 5000 [ 30%] (Warmup) Chain 3, Iteration: 2000 / 5000 [ 40%] (Warmup) Chain 3, Iteration: 2500 / 5000 [ 50%] (Warmup) Chain 3, Iteration: 3000 / 5000 [ 60%] (Warmup) Chain 3, Iteration: 3500 / 5000 [ 70%] (Warmup) Chain 3, Iteration: 4000 / 5000 [ 80%] (Warmup) Chain 3, Iteration: 4500 / 5000 [ 90%] (Warmup) Chain 3, Iteration: 5000 / 5000 [100%] (Warmup) Elapsed Time: 345070 seconds (Warm-up) 0 seconds (Sampling) 345070 seconds (Total)

Error: is.atomic(x) is not TRUE

save(stan.T.mod, file=paste0(outpath, "stan.GCMfixedmods")); 

Error in save(stan.T.mod, file = paste0(outpath, "stan.GCMfixedmods")) :
object ‘stan.T.mod’ not found

stan.T.mod Error: object 'stan.T.mod' not found

MrFlick
  • 195,160
  • 17
  • 277
  • 295
  • 7
    I think the problem is that `iter=5000, warmup=5000` results it zero iterations being saved. You really shouldn't need to change the defaults of `iter = 2000` and `warmup` being half of that. – Ben Goodrich May 03 '17 at 13:08
  • OMG, that is so incredibly funny (and stupid)! Thanks - i'm glad there is an easy answer (and another week). – Yetta Jager May 03 '17 at 15:06
  • 2
    Had the same issue in `brms` package which runs Stan internally. I guess different MCMC packages are inconsistent in terms of whether `iter` means all iterations past warmup/burn-in, or the total number of iterations including warmup. – qdread Dec 12 '18 at 14:51

0 Answers0