Bayesian hierarchical modelling is a statistical model written in multiple levels (hierarchical form) that estimates the posterior distribution of model parameters using the Bayesian method. The sub-models combine to form the hierarchical model, and Bayes' theorem is used to integrate them with the observed data and account for all the uncertainty that is present. This integration enables calculation of updated posterior over the (hyper)parameters, effectively updating prior beliefs in light of the observed data. Frequentist statistics may yield conclusions seemingly incompatible with those offered by Bayesian statistics due to the Bayesian treatment of the parameters as random variables and its use of subjective information in establishing assumptions on these parameters. As the approaches answer different questions the formal results are not technically contradictory but the two approaches disagree over which answer is relevant to particular applications. Bayesians argue that relevant information regarding decision-making and updating beliefs cannot be ignored and that hierarchical modeling has the potential to overrule classical methods in applications where respondents give multiple observational data. Moreover, the model has proven to be robust, with the posterior distribution less sensitive to the more flexible hierarchical priors. Hierarchical modeling, as its name implies, retains nested data structure, and is used when information is available at several different levels of observational units. For example, in epidemiological modeling to describe infection trajectories for multiple countries, observational units are countries, and each country has its own time-based profile of daily infected cases. In decline curve analysis to describe oil or gas production decline curve for multiple wells, observational units are oil or gas wells in a reservoir region, and each well has each own time-based profile of oil or gas production rates (usually, barrels per month). Hierarchical modeling is used to devise computation based strategies for multiparameter problems.
Philosophy Statistical methods and models commonly involve multiple parameters that can be regarded as related or connected in such a way that the problem implies a dependence of the joint probability model for these parameters. Individual degrees of belief, expressed in the form of probabilities, come with uncertainty. Amidst this is the change of the degrees of belief over time. As was stated by Professor José M. Bernardo and Professor Adrian F. Smith, "The actuality of the learning process consists in the evolution of individual and subjective beliefs about the reality." These subjective probabilities are more directly involved in the mind rather than the physical probabilities. Hence, it is with this need of updating beliefs that Bayesians have formulated an alternative statistical model which takes into account the prior occurrence of a particular event.
Bayes' theorem The assumed occurrence of a real-world event will typically modify preferences between certain options. This is done by modifying the degrees of belief attached, by an individual, to the events defining the options. Suppose in a study of the effectiveness of cardiac treatments, with the patients in hospital j having survival probability θj, the survival probability will be updated with the occurrence of y, the event in which a controversial serum is created which, as believed by some, increases survival in cardiac patients. In order to make updated probability statements about θj, given the occurrence of event y, we must begin with a model providing a joint probability distribution for θj and y. This can be written as a product of the two distributions that are often referred to as the prior distribution P(θ) and the sampling distribution P(y∣θ) respectively:
P(θ,y)=P(θ)P(y∣θ) Using the basic property of conditional probability, the posterior distribution will yield:
P(θ∣y)=P(θ,y)P(y)=P(y∣θ)P(θ)P(y) This equation, showing the relationship between the conditional probability and the individual events, is known as Bayes' theorem. This simple expression encapsulates the technical core of Bayesian inference which aims to deconstruct the probability, P(θ∣y), relative to solvable subsets of its supportive evidence.
Exchangeability The usual starting point of a statistical analysis is the assumption that the n values y1,y2,…,yn are exchangeable. If no information – other than data y – is available to distinguish any of the θj's from any others, and no ordering or grouping of the parameters can be made, one must assume symmetry of prior distribution parameters. This symmetry is represented probabilistically by exchangeability. Generally, it is useful and appropriate to model data from an exchangeable distribution as independently and identically distributed, given some unknown parameter vector θ, with distribution P(θ).
Finite exchangeability For a fixed number n, the set y1,y2,…,yn is exchangeable if the joint probability P(y1,y2,…,yn) is invariant under permutations of the indices. That is, for every permutation π or (π1,π2,…,πn) of (1, 2, …, n), P(y1,y2,…,yn)=P(yπ1,yπ2,…,yπn). The following is an exchangeable, but not independent and identical (iid), example: Consider an urn with a red ball and a blue ball inside, with probability 12 of drawing either. Balls are drawn without replacement, i.e. after one ball is drawn from the n balls, there will be n−1 remaining balls left for the next draw.
Let Yi={1,if the ith ball is red,0,otherwise. The probability of selecting a red ball in the first draw and a blue ball in the second draw is equal to the probability of selecting a blue ball on the first draw and a red on the second, both of which are 1/2:
P(y1=1,y2=0)=P(y1=0,y2=1)=12. This makes y1 and y2 exchangeable. But the probability of selecting a red ball on the second draw given that the red ball has already been selected in the first is 0. This is not equal to the probability that the red ball is selected in the second draw, which is 1/2:
P(y2=1∣y1=1)=0≠P(y2=1)=12. Thus, y1 and y2 are not independent. If x1,…,xn are independent and identically distributed, then they are exchangeable, but the converse is not necessarily true.
Infinite exchangeability Infinite exchangeability is the property that every finite subset of an infinite sequence y1, y2,… is exchangeable. For any n, the sequence y1,y2,…,yn is exchangeable.
Hierarchical models
… excerpt ends here. Continue reading the full article.

![Bayesian hierarchical modeling: Bayesian research cycle using Bayesian nonlinear mixed effects model: (a) standard research cycle and (b) Bayesian-specific workflow.[16]](https://thumb.wikimedia.org/wikipedia/commons/thumb/1/12/Bayesian_research_cycle.png/1280px-Bayesian_research_cycle.png?utm_source=en.wikipedia.org&utm_campaign=parser&utm_content=thumbnail)