Introduction to Hierarchical Model
 8 minsData Mining Center, Renmin University of China
Introduction to Bayesian Framework
Priori, Likelihood and Posteriori
 Bayes Formula
 Prior $\theta$ $\sim$ Prior Distribution $p(\theta)$ Determined from past information or subjective assessment.
 Observations $y\mid \theta$ $\sim$ Likelihood $p(y \mid \theta)$ Given the parameter $\theta$, the observed data $y$’s distribution.
 Posterior $\theta \mid y$ $\sim$ Posterior Distribution $p(\theta \mid y)$ Updatad distribution of $\theta$ based on its prior and observed data.
Types of Prior
What exactly is prior when we talk about it?
 Past experience
 Historical Research
 Subjective Beliefs
We can define three types of priors according to the information they contain
 Informative Priors Prior distributions giving numerical information that is crucial to estimation of the model.
 Noninformative Priors Uniform or nearly so, and basically allow the information from the likelihood to be interpreted probabilistically.
 Weakly Informative Priors Not supplying any controversial information but are strong enough to pull the data away from inappropriate inferences that are consistent with the likelihood.
Common Types of Priors
What kinds of prior do we usally use?
 Experts’ Prior Prior distributions obtained via consulting experts.
 Conjugate Priors The prior distribution and the posterior distribution are from the same distribution family. For example, if $\theta \sim $beta distribution then $\theta\mid y \sim beta$ distribution
 Noninformative Priors Uniform Prior or Jeffrey Prior
Conjugate Prior
 The prior distribution and the posterior distribution are from the same distribution family.
 Example :
 Hence we can derive the posterior Therefore,
 $\theta$’s prior and posterior are both Beta distribution.
Why we use Conjugate Prior?
 They simplify the computation! We can easily derive the posterior distribution if we use conjugate prior.
 Common Conjugate Families
Noninformative Prior
 Uniform
 Example 1:
 Example 2: Is that correct?
 Prior is not a distribution! Its density cannot be integrated to 1. We call this prior is improper.
 Improper prior can sometimes lead to proper posterior.
 As long as it can lead to proper posterior, the prior can be useful.
 Example 3:
 Hence we can derive the posterior Therefore,
 It’s a proper posterior!
Jeffrey Prior
 Do we have any other choice for noninformative prior?
 Yes! That is Jeffrey Prior.
 where $J(\theta)$ is the {\em Fisher Information} for $\theta$
 Jeffrey’s Invariance Principal: No matter how I parametrize $\theta$, the prior density $p(\theta)$ is equivalent.
 We can prove that
Bayesian Hierarchical Model
How to set the Hyperparameters?
figure missing
 The table displays the values of $\frac{y_{i}}{n_{i}}$ : $i = 1,2,3,…,70$ \centering{(number of rats with tumor) / (total number of rats)}
 Tumor Incidence of rats in historical control groups and current group of rats, from Tarone (1982).
Model Initialization
 Suppose $\theta$ is the probability that the rat had tumor.
 Suppose
 Since BetaBinomial is conjugate, so we can derive the posterior of $\theta$ easily
Toy Example
 How to set the $\alpha$ and $\beta$?
 We call the parameters in prior distribution hyperparameter.
How to set the priors?
Fixed Prior Distribution
Informative Prior
 We knew that $\theta \sim$ Beta Distribution with known mean and variance.
 $\theta$ vary due to differences in rats and experimental conditions.
 Find the corresponding $\alpha$, $\beta$.
 $\theta \sim$ Beta$(\alpha,\beta)$ as its prior distribution.
Approximate estimate using Historical Data
 Use Historical Data’s Mean and Variance to estimate $\alpha$ and $\beta$.

$\theta\mid y_1, y_2,\ldots,y_{71} \sim \text{Beta}(\hat{\alpha} + \sum_{i = 1}^{71} y_i ,\hat{\beta} + \sum_{i = 1}^{71}n_{i}  \sum_{i = 1}^{71} y_i)$
 Bayes Estimate
 Is that Correct?
 NO!
 Overestimate the precision of the posterior. (Data Used Twice)
Set the Hyperparameters without Data
Do we have to use data to set the hyperparameters?
 In most cases in reality, we are not sure what how to set the priors scientifically.
 However, the hyperparameters of the prior may not be that important.
 If lacking information, use noninformative prior such as $Uniform(0,1) = Beta(1,1)$
 In this case, for $i = 1,2,…,70,71$
Can we regard hyperparameters in prior as random variables?
Set one more level of Hierarchical Model
Regard $\alpha$ \& $\beta$ as Random Variables
 If we want to model the uncertainty of $\alpha$ and $\beta$,
 We can assign a prior distributions for $\alpha$ and $\beta$ respectively.
 Just add one more level of Hierarchical Model.
 For example, for $i = 1,2,…,70,71$
 The level of this model increased from 2 to 3.
 This is Hierarchical Model.
Latent Dirichlet Allocation
 A classic example of Hierarchical Model
 Analyze the model of Text Data
Model Initialization
From Beta Distribution to Dirichlet
 BetaBinomial is a conjugate distribution.
 for $x \in (0,1)$
 DirichletMultinomial is a conjugate distribution
 $x_1,x_2,…,x_{n1} \in (0,1) , x_1+x_2+…+x_{n1} < 1 , x_n = 1  (x_1 + … + x_{n1})$
Notation and Assumption
 A Vocabulary indexed by ${1,2,…,V}$
 A word is the basic unit of discrete data and is represented by a Vvector s.t.
 For example If the ith word matches the 3rd word in vocabulary
 A document is a sequence of N words denoted by ${\bf w} = (w_1,w_2,…,w_N)$
 A corpus is a collection of M documents denoted by ${\bf D} = { {\bf w_1},{\bf w_2},…,{\bf w_M} }$
 There are k topics in total.
 Bagofwords Assumption (Exchangeable)
Where is the “Latent” in LDA?
figure missing

So $\alpha$ and $\beta$ are the Hyperparameters in this model. #(k + kV)
 where
Posteriorl Inference
Intractable Posterior
 We want to find the posterior distribution of $\theta$ and $z$
 However, the posterior distribution is intractable. (Denominator Part)
 How to get the posterior?
Reference
 D. Blei, A. Ng, and M. Jordan. (2003) Latent Dirichlet Allocation, Journal of Machine Learning Research 3:9931022.
 K. Nigam, A.McCallum, S. Thrun, and T. Mitchell (2000) Text classification from labeled and unlabeled documents using EM.,Machine Learning 39(2/3):103134
 A. Gelman, J.B. Carlin, H.S. Stern, D.B. Dunson, A. Vehtari, and D.B. Rubin (2013),Bayesian Data Analysis,CRC Press 39(2/3):101103