The Gamerman algorithm (Gamerman 1997), which is named after the inventor Dani Gamerman, is a special case of the Metropolis algorithm in which the proposal distribution is derived from one iteration of the iterative weighted least squares (IWLS) algorithm. As the name suggests, a weighted least squares algorithm runs inside an iteration loop. For each iteration, a set of weights for the observations is used in the least squares fit. The weights are constructed by applying a weight function to the current residuals. The proposal distribution uses the current iteration’s parameter values to form the proposal distribution from which to generate a proposed random value (Gamerman 1997).
The Gamerman algorithm is suitable for both GLM and GLMM models.
The maximum likelihood (ML) estimator in a GLM and the asymptotic variance are obtained by iterative application of weighted least squares (IWLS) to transformed observations. Following McCullagh and Nelder (1989), define the transformed response as
and define the corresponding weights as
The Gamerman algorithm is summarized as follows:
PROC BGLIMM uses this algorithm to draw samples for both the fixed-effects parameters and the random-effects parameters
: the GLMM simplifies to a GLM when
is conditioned on; similarly, for the ith cluster, the model for
is simplified to a GLM when
are treated as known and conditioned on.
For the random-effects block, the same Metropolis-Hastings sampling with the least squares proposal can apply. The conditional posterior is
The transformed response is now , and the proposal density is
, where