next up previous contents
Next: Seeds: random effects logistic Up: BUGS 0.5 Examples Volume Previous: Rats: Normal hierarchical models

Pump: conjugate gamma-Poisson hierarchical model

george:makov:smith:93 discuss Bayesian analysis of hierarchical models where the conjugate prior is adopted at the first level, but for any given prior distribution of the hyperparameters, the joint posterior is not of closed form. The example they consider relates to 10 power plant pumps. The number of failures tex2html_wrap_inline2719 is assumed to follow a Poisson distribution

eqnarray148

where tex2html_wrap_inline2721 is the failure rate for pump i and tex2html_wrap_inline2725 is the length of operation time of the pump (in 1000s of hours). The data is shown below.

tabular153

A conjugate gamma prior distribution is adopted for the failure rates:

eqnarray157

george:makov:smith:93 assume the following prior specification for the hyperparameters tex2html_wrap_inline2731 and tex2html_wrap_inline2733

eqnarray162

They show that this gives a posterior for tex2html_wrap_inline2733 which is a gamma distribution, but leads to a non-standard posterior for tex2html_wrap_inline2731 . Consequently, they use the Gibbs sampler to simulate the required posterior densities.

Figure 2 shows the graph corresponding to the above model, and the associated BUGS analysis is given below.

  figure168
Figure 2:   Graphical model for pump example.

Model specification for pump example

model pump;
const
   N = 10;  # number of pumps
var
   theta[N],     # failure rate of each pump
   x[N],         # number of failures per pump
   t[N],         # length of operation time
   alpha,beta,   # parameters of gamma prior
   lambda[N];    # theta[]*t[]

data t, x in "pump.dat";
inits in "pump.in";

{
   for (i in 1:N){
            theta[i]   ~ dgamma(alpha,beta);
            lambda[i] <- theta[i]*t[i];
            x[i]       ~ dpois(lambda[i]);
   }

   alpha ~ dexp(1.0);   
   beta  ~ dgamma(0.1,1.0);   

}

Analysis A BUGS run of 1000 iterations took 2 seconds after a 500 iteration burn-in. Posterior mean estimates for selected parameters are listed below, together with the corresponding estimates obtained by george:makov:smith:93 (denoted GM&S estimate).

tabular182



Andrew E Long
Tue Jun 8 09:17:20 EDT 1999