Alexandre Courtiol
2017-May-09 14:40 UTC
[Rd] Bug simulate.lm() --> needs credential to report it
Dear R developers, I did not get any reply concerning my email from last week concerning the bug I found in stats::simulate.lm(). The bug shows up when called upon a GLM with family gaussian(). I am confident it is a genuine bug related to a mix-up between weights and prior weights that only impacts the gaussian family (other families have their own simulate functions defined elsewhere). I cannot add the bug in Bugzilla as I have no credential. Could someone please help me to get credentials so that I can add the bug in bugzilla? Thanks a lot, Simple demonstration for the bug: set.seed(1L) y <- 10 + rnorm(n = 100) mean(y) ## 10.10889 var(y) ## 0.8067621 mod_glm <- glm(y ~ 1, family = gaussian(link = "log")) new.y <- simulate(mod_glm)[, 1] mean(new.y) ## 10.10553 var(new.y) ## 0.007243695 ##### WRONG ##### mod_glm$weights <- mod_glm$prior.weights ## ugly hack showing where the issue is new.y <- simulate(mod_glm)[, 1] mean(new.y) ## 10.13554 var(new.y) ## 0.8629975 ##### OK ##### -- Alexandre Courtiol http://sites.google.com/site/alexandrecourtiol/home *"Science is the belief in the ignorance of experts"*, R. Feynman [[alternative HTML version deleted]]