Open Access
September 2023 Fast Methods for Posterior Inference of Two-Group Normal-Normal Models
Philip Greengard, Jeremy Hoskins, Charles C. Margossian, Jonah Gabry, Andrew Gelman, Aki Vehtari
Author Affiliations +
Bayesian Anal. 18(3): 889-907 (September 2023). DOI: 10.1214/22-BA1329


We describe a class of algorithms for evaluating posterior moments of certain Bayesian linear regression models with a normal likelihood and a normal prior on the regression coefficients. The proposed methods can be used for hierarchical mixed effects models with partial pooling over one group of predictors, as well as random effects models with partial pooling over two groups of predictors. We demonstrate the performance of the methods on two applications, one involving U.S. opinion polls and one involving the modeling of COVID-19 outbreaks in Israel using survey data. The algorithms involve analytical marginalization of regression coefficients followed by numerical integration of the remaining low-dimensional density. The dominant cost of the algorithms is an eigendecomposition computed once for each value of the outside parameter of integration. Our approach drastically reduces run times compared to state-of-the-art Markov chain Monte Carlo (MCMC) algorithms. The latter, in addition to being computationally expensive, can also be difficult to tune when applied to hierarchical models.

Funding Statement

Philip Greengard is supported by the Alfred P. Sloan Foundation. The authors thank the U.S. Office of Naval Research, Institute for Education Sciences, National Science Foundation, National Institutes of Health, and the Academy of Finland Flagship Programme: Finnish Center for Artificial Intelligence (FCAI) for partial support of this work.


The authors are grateful to Hagai Rossman and Ayya Keshet for useful discussions and their contribution to the COVID-19 model.


Download Citation

Philip Greengard. Jeremy Hoskins. Charles C. Margossian. Jonah Gabry. Andrew Gelman. Aki Vehtari. "Fast Methods for Posterior Inference of Two-Group Normal-Normal Models." Bayesian Anal. 18 (3) 889 - 907, September 2023.


Published: September 2023
First available in Project Euclid: 9 September 2022

arXiv: 2110.03055
Digital Object Identifier: 10.1214/22-BA1329

Keywords: fast algorithms , hierarchical modeling , Linear regression , mixed effects models

Vol.18 • No. 3 • September 2023
Back to Top