Path: blob/master/notebooks/misc/dp_mixgauss_forward_truncat.ipynb
1192 views
Dirichlet Processes: A simulated guide
(transformed from https://ericmjl.github.io/dl-workshop/04-gaussian-clustering/02-dirichlet-processes.html )
The stick-breaking definition of Dirichlet process (DP)
Visualizing the stick-breaking construction of a DP:
As is visible above, when concentration parameter = 3, most of the probability mass is concentrated across rouighly the first 5-8 states.
We explore the effect of the concentration parameter on DP by plotting samples from DPs with differerent values of the concentration paramter.
As the concentration parameter increases, the random probability measure sampled from DP becomes less concentrated, which means:
The probability mass allocated to the components that have significant probability mass decreases;
More components have "significant" amounts of probability mass allocated.
Under the stick-breaking construction, we can evaluate the likelihood of the simulated DP sample under the beta distribution. The first step is to reverse the stick-breaking construction and obtain the beta-distributed variables from the DP sample.
Given the likelihood function, we can obtain the maximum likelihood estimate (MLE) of the concentration parameter of the DP. If we define the loss function of the concentration parameter to be the negative of its likelihood, to maximize the likelihood is equivalent to minimize the loss function.
With Jax, it is straightforward to take the gradient descent approach in search for the MLE, where we can use 'grad' function to compute the gradient automatically.