In 2 previous posts, you learned what Bayesian modeling and Stan are and how to install them. Now you are ready to try it on some very Bayesian problems - as many people love - such as hierarchical Bayesian model.
Definition of hierarchical Bayesian models
Prior to tackling with a practical example, let's overview what and how hierarchical Bayesian model is. A famous book on Bayesian modeling with MCMC, written by Toshiro Tango and Taeko Becque and published in Japan, describes as below*1.
In a fixed-effects model of frequentist, each result is assumed to have a common average .
On the other hand, in a random-effects model, each result is assumed to have a distinct average and it is distributed around a global average .
Bayesian hierarchical models assume prior probability for parameters of a probability distribution of in a random-effects model, such as
It is said that such models have a hierarchical structure with two levels, that is,
- 1st level: a probability distribution is assumed for
- 2nd level: one more probability distribution is assumed for parameters of the 1st level
This is a textbook definition of hierarchical models, but I think it can be understood more intuitively; in hierarchical Bayesian models, often the models have to handle some excessive fluctuations as nonlinear effects more than expected in usual frequentist's models. Priors used in such models can be seen as an "absorber" that can absorb various kinds of fluctuations distributed around true parameters.
*1:Its original text is of course in Japanese, so this is just my own interpretation