rmcelreath / rethinking

Statistical Rethinking course and book package
2.1k stars 596 forks source link

Adapt_Delta issue #138

Open OliJimbo opened 6 years ago

OliJimbo commented 6 years ago

Hi there!

I think I have noticed a potential bug in the rethinking package surrounding the setting of the adapt_delta control. I noticed it in my own simulated data and have verified it by running some from the book (specifically 5.41):

``

R code 5.42

m5.13 <- map2stan( alist( h1 ~ dnorm(mu,sigma), mu <- a + bhh0 + bttreatment + bf*fungus, a ~ dnorm(0,100), c(bh,bt,bf) ~ dnorm(0,10), sigma ~ dunif(0,10) ), data=d, control=(list(adapt_delta=0.95)) ) `` This shoots out a warning about a single divergent transition with the following warning:

Warning messages: 1: There were 1 divergent transitions after warmup. Increasing adapt_delta above 0.8 may help. See http://mc-stan.org/misc/warnings.html#divergent-transitions-after-warmup 2: Examine the pairs() plot to diagnose sampling problems

It seems as though control isn't being sent over to Stan. I am running this on MacOS 10.13.4 in RStudio and R version: R version 3.4.0 (2017-04-21) You Stupid Darkness

I'm not sure this is urgent, but thought I'd leave it here just in case!

Best wishes, Oli

rmcelreath commented 6 years ago

Thanks. I know I fixed this issue in the Experimental branch. I should patch it in master as well, obviously.

Much appreciated.