# hierarchical Dirichlet Processes

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

If we can put a prior on random partition and use likelihood distribution to model data points, we can use the Bayesian framework to learn the latent dimension, which is the main idea of Dirichlet process mixture model. When it comes to clustering grouped data, we usually assume some information is shared between groups, which means our model should be able to capture this information. One natural proposal about hierarchical clustering problem is each group j is modeled by a Dirichlet process mixture model $G_j$ ~ $DP(\alpha, G_0)$. However, if the $G_0$ is continuous, this proposal generally cannot model shared information between groups. One idea is to make $G_0$ become discrete by limiting the choice of $G_0$. The main idea of this paper is to assume $G_0$ drawn from other Dirichlet process $DP(\lambda, H)$, where H is any base measure. Note that $G_0$ is discrete with probability one due to the fact of Dirichlet process.

## Introduction

It is a common practice to tune the latent dimension K in order to get the best performance of a model. One weakness of this practice is that the corpus is static and unchanged, which means it is generally difficult to do inference given new unseen data points. In that case, we may either re-train the model or use some algebraic/heuristic fold-in technique to do inference. If we can come out some prior on the latent dimension and likelihood distribution on data points, we can learn the latent dimension K on-the-fly from the corpus based on the Bayesian framework. This is a important property when it comes to online data stream mining.

### Hierarchical clustering

A recurring theme in statistics is the need to separate observations into groups, and yet allow the groups to remain liked-to "share statistical strength". In the Bayesian formalism such sharing is achieved naturally via hierarchical modeling; parameters are shared among groups, and the randomness of the parameters induces dependencies among the groups. Estimates based on the posterior distribution exhibit "shrinkage".

## Dirichlet process

$G$ ~ $DP(\alpha,G_0)$

• for each data point $x_i$
• $\theta_i$ ~ $G$
• $x_i$ ~ $\theta_i$

### stick-breaking construction

$G$ ~ $DP(\alpha,G_0)$ is equivalent to the following construction.

For each latent model $k$

• $\theta_k$ ~ $G_0$
• $\pi_k'$ ~ $Beta(1,\alpha)$
• $\pi_k = \pi_k'\prod_{l=1}^{k-1}(1-\pi_k')$

For each data point $x_i$

• $\theta_i$ ~ $G$
• $x_i$ ~ $\theta_i$

### Chinese restaurant process

for each data point $x_i$

• $\theta_i$ ~ $\sum_{n=1}^{i-1}\frac{1}{i-1+\alpha}\delta_{\theta_n} + \frac{\alpha}{i-1+\alpha}G_0$
• $x_i$ ~ $\theta_i$

Another representation based on Chinese restaurant process can be found in below.

The table assignment $t_i$ is followed by

$p(t_i=k)=\frac{m_k}{i-1+\alpha}$

$p(t_i=k_{new})=\frac{\alpha}{i-1+\alpha}$

$\theta_{k_{new}}$ ~ $G_0$

where $m_k=\sum_{n=1}^{i-1}I(t_n=k)$ and $I()$ is the indicator function.

Note that $\sum_{k}m_k=i-1$

### the infinite limit of finite mixture models

$\pi$ ~ $Dir(\frac{\alpha}{K},\dots,\frac{\alpha}{K})$

For each latent model $k$

• $\theta_{k}$ ~ $G_0$

For each data point $x_i$

• $z_i$ ~ $Multi(\pi)$
• $x_i$ ~ $\theta_{z_i}$

Where Dir() is a K-dimension Dirichlet distribution and Multi() is a K-dimension Multinomial distribution.

When K goes into infinite, we can show that such construction become a Dirichlet process.

## Hierarchical Dirichlet process

$G_0$ ~ $DP(\lambda,H)$

For each group j

• $G_j$ ~ $DP(\alpha,G_0)$
• for each data point $x_{ij}$ in group j
• $\theta_{ij}$ ~ $G_j$
• $x_{ij}$ ~ $\theta_{ij}$

### stick-breaking construction

For each latent model $\theta_{k}$

• $\theta_{k}$ ~ $H$
• $\beta_k'$ ~ $Beta(1,\lambda)$
• $\beta_{k}=\beta_k'\prod_{l=1}^{k-1}(1-\beta_k')$

For each group j

• $\pi_k'$ ~ $Beta(\alpha\beta_k,\alpha(1-\sum_{l=1}^{k}\beta_l))$
• $\pi_{k}=\pi_k'\prod_{l=1}^{k-1}(1-\pi_k')$
• for each data point $x_{ij}$ in group j
• $z_{ij}$ ~ $Multi(\pi_j)$
• $x_{ij}$ ~ $\theta_{z_{ij}}$

### Chinese restaurant franchise

For each restaurant/group j

• each table t in restaurant j
• $\theta_{jt}$ ~ $\sum_{k=1}^{K}\frac{m_{.k}}{m_{..}+\lambda}\delta_{\theta_{k}} + \frac{\lambda}{m_{..}+\lambda}H$
• for each data point $x_{ij}$ in restaurant j
• $\varphi_{ij}$ ~ $\sum_{t=1}^{m_{j.}}\frac{n_{jt.}}{i-1+\alpha}\delta_{\theta_{jt}} + \frac{\alpha}{i-1+\alpha}G_0$
• $x_i$ ~ $\varphi_{ij}$

Another representation based on Chinese restaurant process can be found in below.

The table assignment $t_{ij}$ is followed by

$p(t_{ij}=h)=\frac{n_{jt.}}{i-1+\alpha}$

$p(t_{ij}=h_{new})=\frac{\alpha}{i-1+\alpha}$

$\theta_{h_{new}}$ ~ $G_0$

If we integrate out G_0, h_{new} will correspond to the dish label.

The dish assignment $k_{jt}$ is followed by

$p(k_{jt}=k)=\frac{m_{.k}}{m_{..}+\lambda}$

$p(k_{jt}=k_{new})=\frac{\lambda}{m_{..}+\lambda}$

$\theta_{t_{new}}$ ~ $H$

Where:

$m_{..}$ is the total number of table in all restaurants,

$m_{.k}$ is the number of table severing dish k in all restaurants,

$m_{j.}$ is the total number of table in restaurant j ,

$n_{jt.}$ is the total number of customer sitting in table t in restaurant j.

### the infinite limit of finite mixture models

$\beta$ ~ $Dir(\frac{\lambda}{K},\dots,\frac{\lambda}{K})$

For each latent model $k$

• $\theta_{k}$ ~ $H$

For each group j

• $\pi_{j}$ ~ $Dir(\alpha\beta)$
• for each data point $x_{ij}$ in group j
• $z_{ij}$ ~ $Multi(\pi_j)$
• $x_{ij}$ ~ $\theta_{z_{ij}}$

Where Dir() is a K-dimension Dirichlet distribution and Multi() is a K-dimension Multinomial distribution.

When K goes into infinite, we can show that such construction become a Hierarchical Dirichlet process.

## Inference

### Markov chain Monte Carlo method (MCMC)

We can use MCMC sampling framework based on the different representations of Hierarchical Dirichlet Process (HDP) mentioned above to estimate parameters in HDP and do inference for new unseen data points.

## Relationship with Latent Dirichlet allocation

The HDP mixture model is a natural nonparametric generalization of Latent Dirichlet allocation, where the number of topics can be unbounded and learnt from data. Here each group is a document consisting of a bag of words, each cluster is a topic, and each document is a mixture of topics. The HDP is also a core component of the infinite hidden Markov model, which is a nonparametric generalization of the hidden Markov model allowing the number of states to be unbounded and learnt from data.

## Conclusions

The paper described the use of HDP for clustering. HDP is a non-parametric hierarchical model of Dirichlet processes. HDPs can automatically determine the number of mixture components due to the non-parametric nature of it. Furthermore, in HDP, components are shared between the groups and therefore, statistical strength is shared across the groups.