The BGLIMM Procedure

Gamerman Algorithm

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

ModifyingAbove bold y With tilde Subscript i Baseline left-parenthesis bold-italic beta right-parenthesis equals eta Subscript i Baseline plus left-parenthesis bold y Subscript i Baseline minus bold-italic mu Subscript i Baseline right-parenthesis g prime left-parenthesis bold-italic mu Subscript i Baseline right-parenthesis

and define the corresponding weights as

bold upper W Subscript i Superscript negative 1 Baseline left-parenthesis bold-italic beta right-parenthesis equals b double-prime left-parenthesis bold-italic theta Subscript i Baseline right-parenthesis left-bracket g prime left-parenthesis bold-italic mu Subscript i Baseline right-parenthesis right-bracket squared

The Gamerman algorithm is summarized as follows:

  1. Start with bold-italic beta Superscript left-parenthesis 0 right-parenthesis and t equals 1.

  2. Sample bold-italic beta Superscript asterisk from the proposal density bold upper N left-parenthesis bold m Superscript left-parenthesis t right-parenthesis Baseline comma bold upper C Superscript left-parenthesis t right-parenthesis Baseline right-parenthesis, where

    StartLayout 1st Row 1st Column bold m Superscript left-parenthesis t right-parenthesis 2nd Column equals 3rd Column StartSet bold upper Omega Subscript bold-italic beta Superscript negative 1 Baseline plus bold upper X prime bold upper W left-parenthesis bold-italic beta Superscript left-parenthesis t minus 1 right-parenthesis Baseline right-parenthesis bold upper X EndSet Superscript negative 1 Baseline StartSet bold upper Omega Subscript bold-italic beta Superscript negative 1 Baseline bold-italic beta overbar plus bold upper X prime bold upper W left-parenthesis bold-italic beta Superscript left-parenthesis t minus 1 right-parenthesis Baseline right-parenthesis ModifyingAbove bold y With tilde left-parenthesis bold-italic beta Superscript left-parenthesis t minus 1 right-parenthesis Baseline right-parenthesis EndSet 2nd Row 1st Column bold upper C Superscript left-parenthesis t right-parenthesis 2nd Column equals 3rd Column StartSet bold upper Omega Subscript bold-italic beta Superscript negative 1 Baseline plus bold upper X prime bold upper W left-parenthesis bold-italic beta Superscript left-parenthesis t minus 1 right-parenthesis Baseline right-parenthesis bold upper X EndSet Superscript negative 1 EndLayout
  3. Accept bold-italic beta Superscript asterisk with probability

    alpha left-parenthesis bold-italic beta Subscript left-parenthesis t minus 1 right-parenthesis Baseline comma bold-italic beta Superscript asterisk Baseline right-parenthesis equals min left-bracket 1 comma StartFraction p left-parenthesis bold-italic beta Superscript asterisk Baseline vertical-bar bold y right-parenthesis q left-parenthesis bold-italic beta Superscript asterisk Baseline comma bold-italic beta Superscript left-parenthesis t minus 1 right-parenthesis Baseline right-parenthesis Over p left-parenthesis bold-italic beta Superscript left-parenthesis t minus 1 right-parenthesis Baseline vertical-bar bold y right-parenthesis q left-parenthesis bold-italic beta Superscript left-parenthesis t minus 1 right-parenthesis Baseline comma bold-italic beta Superscript asterisk Baseline right-parenthesis EndFraction right-bracket

    where p left-parenthesis bold-italic beta vertical-bar bold y right-parenthesis is the posterior density and q left-parenthesis bold-italic beta Superscript asterisk Baseline comma bold-italic beta Superscript left-parenthesis t minus 1 right-parenthesis Baseline right-parenthesis and q left-parenthesis bold-italic beta Superscript left-parenthesis t minus 1 right-parenthesis Baseline comma bold-italic beta Superscript asterisk Baseline right-parenthesis are the transitional probabilities that are based on the proposal density bold upper N left-parenthesis bold m Superscript left-parenthesis period right-parenthesis Baseline comma bold upper C Superscript left-parenthesis period right-parenthesis Baseline right-parenthesis. More specifically, q left-parenthesis bold-italic beta Superscript asterisk Baseline comma bold-italic beta Superscript left-parenthesis t minus 1 right-parenthesis Baseline right-parenthesis is an bold upper N left-parenthesis bold m Superscript asterisk Baseline comma bold upper C Superscript asterisk Baseline right-parenthesis density that is evaluated at bold-italic beta Superscript left-parenthesis t minus 1 right-parenthesis, whereas bold m Superscript asterisk and bold upper C Superscript asterisk have the same expression as bold m Superscript left-parenthesis t right-parenthesis and bold upper C Superscript left-parenthesis t right-parenthesis but depend on bold-italic beta Superscript asterisk instead of bold-italic beta Superscript left-parenthesis t minus 1 right-parenthesis. If bold-italic beta Superscript asterisk is not accepted, the chain stays with bold-italic beta Superscript left-parenthesis t minus 1 right-parenthesis.

  4. Set t equals t plus 1 and return to step 1.

PROC BGLIMM uses this algorithm to draw samples for both the fixed-effects parameters bold-italic beta and the random-effects parameters bold-italic gamma: the GLMM simplifies to a GLM when bold-italic gamma is conditioned on; similarly, for the ith cluster, the model for bold-italic gamma Subscript i is simplified to a GLM when bold-italic beta are treated as known and conditioned on.

For the random-effects bold-italic gamma Subscript i block, the same Metropolis-Hastings sampling with the least squares proposal can apply. The conditional posterior is

p left-parenthesis bold-italic gamma Subscript i Baseline vertical-bar bold y comma bold-italic beta comma bold upper G right-parenthesis proportional-to exp left-brace StartFraction bold y Subscript i Baseline bold-italic theta Subscript i Baseline minus b left-parenthesis bold-italic theta Subscript i Baseline right-parenthesis Over phi Subscript i Baseline EndFraction minus one-half bold-italic gamma prime Subscript i Baseline bold upper G Superscript negative 1 Baseline bold-italic gamma Subscript i Baseline right-brace

The transformed response is now ModifyingAbove bold y With tilde Subscript i Baseline left-parenthesis bold-italic gamma Subscript i Superscript left-parenthesis t minus 1 right-parenthesis Baseline right-parenthesis, and the proposal density is bold upper N left-parenthesis bold m Subscript i Superscript left-parenthesis t right-parenthesis Baseline comma bold upper C Subscript i Superscript left-parenthesis t right-parenthesis Baseline right-parenthesis, where

StartLayout 1st Row 1st Column bold m Subscript i Superscript left-parenthesis t right-parenthesis 2nd Column equals 3rd Column StartSet bold upper G Superscript negative 1 Baseline plus bold upper Z prime bold upper W left-parenthesis bold-italic gamma Subscript i Superscript left-parenthesis t minus 1 right-parenthesis Baseline right-parenthesis bold upper Z EndSet Superscript negative 1 Baseline bold upper Z prime bold upper W left-parenthesis bold-italic gamma Subscript i Superscript left-parenthesis t minus 1 right-parenthesis Baseline right-parenthesis StartSet ModifyingAbove bold y With tilde left-parenthesis bold-italic gamma Subscript i Superscript left-parenthesis t minus 1 right-parenthesis Baseline right-parenthesis minus bold upper X Subscript i Baseline bold-italic beta EndSet 2nd Row 1st Column bold upper C Superscript left-parenthesis t right-parenthesis 2nd Column equals 3rd Column StartSet bold upper G Superscript negative 1 Baseline plus bold upper Z prime bold upper W left-parenthesis bold-italic gamma Subscript i Superscript left-parenthesis t minus 1 right-parenthesis Baseline right-parenthesis bold upper X Subscript i Baseline EndSet Superscript negative 1 EndLayout
Last updated: December 09, 2022