Bayesian Logistic Regression

logistic-regressiondata-augmentationauxiliary-variablescale-mixturemcmcgibbs-samplerbayesianvariable-selection

Definition

Bayesian logistic regression models a binary response yi{0,1}y_i \in \{0,1\} via P(yi=1)=(1+exiβ)1P(y_i=1) = (1+e^{-x_i\beta})^{-1}, placing a prior π(β)\pi(\beta) over coefficients. Because the logistic likelihood is not conjugate to any standard prior for β\beta, posterior inference requires Markov Chain Monte Carlo (MCMC). The key algorithmic insight of Holmes-Held (2006) is that the logistic error distribution admits an exact scale mixture of normals representation via the Kolmogorov-Smirnov (KS) distribution, enabling a fully automatic Gibbs sampler with no Metropolis-Hastings (MH) accept/reject steps.

Key Ideas

How It Works

State-Space Form

yi=1[zi>0],zi=xiβ+εi,εiλiN(0,λi),λi=(2ψi)2,ψiKSy_i = \mathbf{1}[z_i > 0], \quad z_i = x_i\beta + \varepsilon_i, \quad \varepsilon_i \mid \lambda_i \sim N(0, \lambda_i), \quad \lambda_i = (2\psi_i)^2, \quad \psi_i \sim \text{KS}

so εi\varepsilon_i marginally follows Logistic(0,1)\text{Logistic}(0,1).

Scheme A Algorithm (one iteration)

  1. Draw βz,λN(B,V)\beta \mid z, \lambda \sim N(B, V) with V=(v1I+xWx)1V = (v^{-1}I + x'Wx)^{-1}, B=VxWzB = Vx'Wz.
  2. For each ii: draw ziβ,yiz_i \mid \beta, y_i from truncated logistic (by inversion).
  3. For each ii: set ri=zixiβr_i = z_i - x_i\beta; draw λiri\lambda_i \mid r_i using rejection sampler with GIG(0.5,1,ri2)(0.5, 1, r_i^2) proposal (A4 in Holmes-Held appendix). Acceptance α(λ)=exp(0.5λ)πKS(λ)\alpha(\lambda) = \exp(0.5\lambda)\pi_{\text{KS}}(\lambda) using alternating-series squeezing for the KS density.

Rejection Sampler for λi\lambda_i (A4)

Proposal λGIG(0.5,1,r2)\lambda \sim \text{GIG}(0.5, 1, r^2) drawn via r/IG(1,r)r/\text{IG}(1,r) inversion; accept with α(λ)=exp(0.5λ)πKS(λ)\alpha(\lambda) = \exp(0.5\lambda)\pi_{\text{KS}}(\lambda) where the KS density is evaluated through monotone alternating series with breakpoint 4/34/3. Acceptance rate 0.25\approx 0.25 for r20r^2 \to 0, rising to 1\approx 1 for r2>10r^2 > 10.

Overdispersion: Beta-Binomial Hierarchical Logit (Kahn-Raftery 1996)

Grouped binary data (successes out of nin_i trials per unit) often show extra-binomial variation — most visibly an excess of units with a zero rate — that plain logistic regression cannot accommodate. Kahn-Raftery (1996) generalize the logit to a beta-binomial hierarchical model: yiBin(ni,pi)y_i\sim\text{Bin}(n_i,p_i) with piBetap_i\sim\text{Beta} whose parameters depend on covariates, so each unit has its own latent rate around a covariate-driven mean. The posterior mean of pip_i is approximately a shrinkage estimator — a weighted average of the logistic-regression ensemble estimate and the unit's observed rate, weighting the ensemble more when nin_i is small (little own-information) — i.e. empirical-Bayes borrowing strength (see James-Stein / hierarchical shrinkage). Fully Bayesian inference over the hyperparameters is obtained by Laplace approximation with locally uniform priors (Raftery's approximate-Bayes-factor machinery for GLMs), which also yields a natural test for overdispersion. This is the pre-MCMC route to the same overdispersed-binary modeling that count-data regression handles for counts.

Why It Matters

Open Questions

Related