I want to implement Chinese Restaurant Process representation of Dirichlet Process for random partitions. The problem setup is as follows:
I have some data (customers) which I have to randomly group (assign table). According to CRP,
- First customer C1 will always choose first empty table i.e. T1
- Second customer C2 will choose T1 with probability
$P(T1) = c / (n - 1 + α)$
and C2 will choose T2 with probability
$P(T2) = α / (n - 1 + α)$
where $c$ is number of customer sitting at existing table and $n$ is total number of customers.
My 3 questions are:
1. Choosing New Table
- How to decide that C2 will choose which table? Should C2 choose table with greater probability from $P(T1)$ and $P(T2)$?
2. Same Probability value for Existing & New Table
For instance, C2 have chosen T2, whereas at this stage $P(T1)$ and $P(T2)$ are same as:
$P(T1) = 1/(2 + α)$ and
$P(T2) = 1/(2 + α)$ Now
- How to decide C3 will choose which table?
3. Choosing from more than 1 Existing Tables
For another instance, if there have been assigned $3$ tables yet and $4th$ table will be new table, as we have a single new table probability value and several existing tables probability values, then
- How to decide that next customer choose which table from existing $3$ tables?