carlin:gelfand:91 present a nonconjugate Bayesian analysis of the following data set from ratkowsky:83:
The data are length and age measurements for 27 captured dugongs (sea cows). carlin:gelfand:91 model this data using a nonlinear growth curve with no inflection point and an asymptote as
tends to infinity:
Standard noninformative priors are adopted for
,
and
, and a uniform prior on (0,1) is assumed for
. However, this specification leads to a non conjugate full conditional distribution for
which is also non log-concave. This problem may be handled within BUGS by discretizing
, and specifying equal prior probabilities for each discrete value. The BUGS code is shown below, and the graph is given in Figure 1.
model dugongs;
const
N = 27, # number of observations
M = 128; # number of bins for gamma
var
x[N],Y[N],mu[N],alpha,beta,gamma,tau,sigma,p[M],iGamma,U1,U2,U3;
data x, Y in "dugongs.dat";
inits in "dugongs.in";
{
for (i in 1:N) {
mu[i] <- alpha - beta*pow(gamma,x[i]);
Y[i] ~ dnorm(mu[i],tau)
}
alpha ~ dnorm(0.0,1.0E-4);
beta ~ dnorm(0.0,1.0E-4);
tau ~ dgamma(1.0E-3,1.0E-3); sigma <- 1.0/sqrt(tau);
iGamma ~ dcat(p[]); # discretize gamma
gamma <- iGamma/M; # normalize discretized gamma to range (0,1)
for (j in 1:M) { p[j] <- 1/M } # equal prior for all values of iGamma
# Transform alpha, beta and gamma to scale used by Carlin and Gelfand
U1 <- log(alpha);
U2 <- log(beta);
U3 <- logit(gamma);
}
Figure 1:
Graphical model for dugongs example.
Analysis
After a 500 iteration burn-in, 1000 iterations took 1 minutes 41 seconds (using 128 bins for discretizing
). The results are shown below, together with those of Carlin and Gelfand, and Ratkowsky. Results are also given for 1000 iteration BUGS runs using 64, 32, 16, and 8 bins for
, to illustrate the change in precision incurred by using a coarser categorization. Note that the speed of running this model in BUGS is approximately proportional to the number of bins, with the 8 bin model taking as little as 9 seconds for 1000 iterations.
We note that the BUGS estimates and 95% intervals for log
, log
and
are virtually unaffected by the number of bins chosen for
. However, the 95% interval estimate for logit
itself is too precise for the 16 and 8 bin models because the bin width is too coarse and nealry all the sampled values for
fall within the same interval. The models with 32 or more bins give more realistic interval estimates.