Bayesian Core and loose logs
Jean-Michel (aka Jean-Claude!) Marin came for a few days so that we could make late progress on the revision of our book Bayesian Core towards an Use R! version. In one of the R programs in the mixture chapter, we were getting improbable answers, until we found an R mistake in the shape of
> sum(c(1,2,3,log=TRUE)) [1] 7 > sum(c(1,2,3),log=TRUE) [1] 7
which was not detected by the compiler… There are surely plenty of good reasons for this to happen and it did not take long to fix the bug, still… annoying!
July 28, 2011 at 7:10 am
[…] not enjoying the optimal environment of CiRM, we are making good progress on the revision (or the R vision) of Bayesian Core. In the past two days, we went over Chapters 1 (Introduction), 2 […]
July 26, 2011 at 9:41 pm
This feature of R drives me up the walls! I think it will convert almost any type to any other without so much as a warning. Which of those lines is the intended one?
July 26, 2011 at 10:25 pm
Actually none of those was intended! We had a sum(dnorm(x,log=TRUE)) than got written sum(dnorm(x),log=TRUE) by mistake and we were none the wiser after running the code (except that it did not look plausible!)…