Bayesian hierarchical model 2026-11-05
A Bayesian hierarchical model is a statistical model used in Bayesian statistics, in which parameters at one level have a prior distribution controlled by parameters at another level. Those shared hyperparameters can themselves receive a hyperprior. For grouped observations , group parameters and shared parameters , one common conditional-independence structure isThe hierarchy specifies how information can be shared; the data are not assumed to become independent merely because they are listed in different groups.[ref]
Stan User's Guide by Stan Development Team. Regression Models, Hierarchical regression and Hierarchical priors
A normal distribution example makes partial pooling explicit. Let and . Conditional on known , completing the square gives the posterior meanFor , , , and , this is4, halfway between the group mean and the shared mean. More precise group data increase . In a full hierarchy with uncertain hyperparameters, their posterior distribution must also be integrated over; simply fixing fitted values omits that uncertainty.
A measurement application appears in Blaza Toman's2017 calibration study. Shared uncertain calibration inputs induce correlations among results; the Bayesian hierarchical model represents this structure within the model rather than treating all replicates as independent.[ref]
Rigorous evaluation of chemical measurement uncertainty: Liquid chromatographic analysis methods using detector response factor calibration by Blaza Toman and others. Introduction and §3.2: Bayesian observation model and shared calibration inputs
Hyperprior 2026-11-05
A hyperprior is a prior distribution assigned to a hyperparameter that controls another prior distribution. In a hierarchical Bayesian model, this makes uncertainty about the prior's parameters part of the joint probability model, rather than replacing those parameters by fixed numbers.[ref]
Stan User's Guide by Stan Development Team. Version2.37, Regression Models, Hierarchical priors
For data , a model parameter and a hyperparameter , a common factorization isHere supplies the likelihood function, is the conditional prior distribution, and is the hyperprior. After observing , Bayesian inference gives a joint posterior distribution. The marginal posterior of averages over the updated hyperparameter distribution:For discrete hyperparameters, the integral is replaced by a sum.
An exact example makes the averaging visible. Let be a success probability and choose a two-point hyperprior,Both conditional beta distributions have expectation , but they concentrate differently around it. Now observe two successes that are independent conditional on , each with a Bernoulli distribution. Their conditional probability is . Integrating against the two possible priors givesThus the data also update the hyperparameter:The conditional posterior distributions of are respectively and . Their posterior mixture has meanThis is an original illustrative probability model, rather than data or a numerical example from the guide.
Fixing at its prior mean would instead produce after the same observations, with posterior mean . Averaging the hyperparameter first has changed the model; it does not reproduce averaging the conditional posteriors with their updated probabilities. A hyperprior therefore adds a specified layer of uncertainty, while its own choice remains part of the assumptions of the hierarchical Bayesian model.