Section 4.6: Beyond MCMC
It is slightly misleading to say that the Stan software “implements generic graphical models”, since unlike BUGS, its modelling language and underlying methodology are not actually based around graphical models. However it can fit very general models, including graphical ones, just like BUGS can. (Also: Stan has now been officially released, and we like it a lot!)
Section 5.2.5: Proportions
The exponents of theta and (1 – theta) in the density given for the Beta(0.5, 0.5) Jeffreys prior (at the foot of page 84) should be -1/2, not 1/2.
Section 8.8.2: Variable selection priors
The following snippet of code on page 174 for variable selection using MCMC and “spike and slab” priors is misleading.
beta[j] <- b[pick[j]] # effect of jth covariate b[1] ~ dnorm(0, tau) # "spike": tau is large, b[1] <- 0 b[2] ~ dnorm(0, eps) # "slab": precision eps is small pick[j] <- I[j] + 1 I[j] ~ dbern(p[j])
This suggests that the effect of every covariate which is included in the model should be equal. This is usually only reasonable if there is one potential covariate! Also the appropriate looping statements have been omitted. A more helpful snippet would be
for (j in 1:numcovs) { # loop over covariates beta[j] <- b[j, pick[j]] # effect of jth covariate pick[j] <- I[j] + 1 I[j] ~ dbern(p[j]) # e.g. p[j]=0.5 if ignorant whether covariate j should be included b[j,1] ~ dnorm(0, tau) # "spike": tau is large, or b[j,1] <- 0 b[j,2] ~ dnorm(0, eps) # "slab": precision eps is small }
See Chapter 8 Exercises – Variable selection, and its solutions, for a full example of MCMC-based variable selection.
Section 11.1.1, p254:
The hazard h(t) is defined as f(t)/S(t), where f(t) is the probability density and S(t) = 1 – F(t) is the survivor function at time t. The given definition f(t)/F(t) misleadingly suggests that the denominator is the probability distribution function.
Figure 11.6, p282:
Caption should just be “monkey eye measurements” rather than “monkey eye tracking measurements”.
Section A.6.2: Implicit indexing
The code
y <- sum(i, 1:4, k)
on page 334 should read:
y <- sum(x[i, 1:4, k])
Section C.5, page 352: Geometric
The mean should be 1/theta (not theta) and the variance should be (1 – theta)/theta^2 (not theta).
x=0 shouldn’t be a supported value. Note also in OpenBUGS (3.2.2) there is a bug in the procedure used to generate random numbers from this distribution. It appears to generate the number of failures x-1 before the first success, rather than the number of trials x including the first success. The description in the book, and the OpenBUGS procedure to compute the probability density in a geometric model, are both based on x.