A closed form solution for Bayesian analysis of a simple linear mixed model
Hilde Vinje, Lars Erik Gangsei
TL;DR
The paper derives a closed-form Bayesian solution for a simple balanced linear mixed model by employing a four-parameter generalized beta prior, which yields a beta-gamma-normal posterior for $(\delta, 1/\sigma^2, \boldsymbol{\beta})$. It introduces and utilizes the G4B and BG N distributions to achieve exact posterior inference under conjugacy, and implements an empirical Bayes framework to set hyperparameters. In simulations, the Bayesian approach shows competitive coverage and lower MSE compared to the frequentist lmer, with some wider credible intervals for the random-effects variance. The work provides a computationally efficient analytic alternative to MCMC methods for this class of models and lays groundwork for extending the approach to more general, possibly unbalanced mixed-effects models.
Abstract
Linear mixed-effects models are a central analytical tool for modeling hierarchical and longitudinal data, as they allow simultaneous representation of fixed and random sources of variation. In practice, inference for such models is most often based on likelihood-based approximations, which are computationally efficient, but rely on numerical integration and may be unreliable example wise in small-sample settings. In this study, the somewhat obscure four-parameter generalized beta density is shown to be usable as a conjugate prior distribution for a simple linear mixed model. This leads to a closed-form Bayesian solution for a balanced mixed-model design, representing a methodological development beyond standard approximate or simulation-based Bayesian approaches. Although the derivation is restricted to a balanced setting, the proposed framework suggests a pathway toward analytically tractable Bayesian inference for more complex mixed-model structures. The method is evaluated through comparison with a standard frequentist solution based on likelihood estimation for linear mixed-effects models. Results indicate that the Bayesian approach performs just as well as the frequentist alternative, while yielding slightly reduced mean squared error. The study further discusses the use of empirical Bayes strategies for hyperparameter specification and outlines potential directions for extending the approach beyond the balanced case.
