Ben, can you help me figure out which seeds are causing these issues?On Wed, Oct 17, 2012 at 11:52 AM, Ben Goodrich <goodri...@gmail.com> wrote:
> On Wednesday, October 17, 2012 11:34:25 AM UTC-4, Daniel Lee wrote:
>>
>> Can you provide the model, data, and seed that causes the chain to go
>> off the rails? If there is a bug, perhaps we can hunt it down.
>
>
> https://groups.google.com/d/msg/stan-users/OjMSj1pITAQ/Tv8Pgy_88BoJ
> https://groups.google.com/d/msg/stan-dev/6hRAFUT1Pdk/Ye5OngvwQ74J
>
> Ben
I see the problem by running rstan, I've pulled the seeds using
get_seed(chain[[3]]), but I'm not seeing the problem from the command
line.
--
Daniel
--
library(rstan)
example(stan_demo)
library(parallel)
models <- mclapply(1:83, mc.cores = 8, FUN = function(m) mean(unlist(get_logposterior(stan_demo(m, chains = 1, refresh = -1, seed = 12345), inc_warmup = TRUE)))) # better to use clang++ herenames(models) <- model_namesWarning (non-fatal rejection): Error in function stan::prob::binomial_log(N4stan5agrad3varE): Probability parameter is -nan:0, but must be finite!Warning (non-fatal rejection): Error in function stan::prob::normal_log(N4stan5agrad3varE): Random variable is nan:0, but must not be nan!goodrich@CYBERPOWERPC:/opt/stan/src/models/bugs_examples/vol1/oxford$ R --quiet -e "mean(read.csv('samples.csv', comment.char='#')\$lp__)"> mean(read.csv('samples.csv', comment.char='#')$lp__)[1] -4528.314
goodrich@CYBERPOWERPC:/opt/stan/src/models/bugs_examples/vol1/salm$ R --quiet -e "mean(read.csv('samples.csv', comment.char='#')\$lp__)"> mean(read.csv('samples.csv', comment.char='#')$lp__)[1] 1288.49
goodrich@CYBERPOWERPC:/opt/stan/src/models/bugs_examples/vol1/salm$ R --quiet -e "mean(read.csv('samples.csv', comment.char='#')\$lp__)"> mean(read.csv('samples.csv', comment.char='#')$lp__)[1] 1289.317
> which(sapply(models, is.na)) rats_vec irt2_multilevel irt2 irt_multilevel irt 35 76 77 78 79 logistic 80 If you have a rstan rolled from master, you can do this in Rlibrary(rstan)
example(stan_demo)
library(parallel)models <- mclapply(1:83, mc.cores = 8, FUN = function(m) mean(unlist(get_logposterior(stan_demo(m, chains = 1, refresh = -1, seed = 12345), inc_warmup = TRUE)))) # better to use clang++ herenames(models) <- model_names
So, those three are suspicious.
> salm <- stan_demo("salm", seed = 12345)
TRANSLATING MODEL 'salm' FROM Stan CODE TO C++ CODE NOW.COMPILING THE C++ CODE FOR MODEL 'salm' NOW.
[snip warnings]1 warning generated.
SAMPLING FOR MODEL 'salm' NOW (CHAIN 1).Iteration: 1 / 2000 [ 0%] (Adapting)Iteration: 200 / 2000 [ 10%] (Adapting)Iteration: 400 / 2000 [ 20%] (Adapting)Iteration: 600 / 2000 [ 30%] (Adapting)Iteration: 800 / 2000 [ 40%] (Adapting)Iteration: 1000 / 2000 [ 50%] (Adapting)Iteration: 1200 / 2000 [ 60%] (Sampling)Iteration: 1400 / 2000 [ 70%] (Sampling)Iteration: 1600 / 2000 [ 80%] (Sampling)Iteration: 1800 / 2000 [ 90%] (Sampling)Iteration: 2000 / 2000 [100%] (Sampling)
SAMPLING FOR MODEL 'salm' NOW (CHAIN 2).Iteration: 1 / 2000 [ 0%] (Adapting)Iteration: 200 / 2000 [ 10%] (Adapting)Iteration: 400 / 2000 [ 20%] (Adapting)Iteration: 600 / 2000 [ 30%] (Adapting)Iteration: 800 / 2000 [ 40%] (Adapting)Iteration: 1000 / 2000 [ 50%] (Adapting)Iteration: 1200 / 2000 [ 60%] (Sampling)Iteration: 1400 / 2000 [ 70%] (Sampling)Iteration: 1600 / 2000 [ 80%] (Sampling)Iteration: 1800 / 2000 [ 90%] (Sampling)Iteration: 2000 / 2000 [100%] (Sampling)
SAMPLING FOR MODEL 'salm' NOW (CHAIN 3).Iteration: 1 / 2000 [ 0%] (Adapting)Iteration: 200 / 2000 [ 10%] (Adapting)Iteration: 400 / 2000 [ 20%] (Adapting)Iteration: 600 / 2000 [ 30%] (Adapting)Iteration: 800 / 2000 [ 40%] (Adapting)Iteration: 1000 / 2000 [ 50%] (Adapting)Iteration: 1200 / 2000 [ 60%] (Sampling)Iteration: 1400 / 2000 [ 70%] (Sampling)Iteration: 1600 / 2000 [ 80%] (Sampling)Iteration: 1800 / 2000 [ 90%] (Sampling)Iteration: 2000 / 2000 [100%] (Sampling)
SAMPLING FOR MODEL 'salm' NOW (CHAIN 4).Error in sampler$call_sampler(args_list[[i]]) : No acceptably small step size could be found. Perhaps the posterior is not continuous?error occurred during calling the sampler; sampling not done