cpyp
cpyp copied to clipboard
Log-likelihood of Dirichlet process
I think you got it wrong:
for (auto& dish_loc : dish_locs_)
lp += lgamma(dish_loc.second.num_tables());
should be:
for (auto& dish_loc : dish_locs_)
for (auto& bin : dish_loc.second.h[0])
lp += lgamma(bin.first) * bin.second;
According to my derivation:
(where c_t is the count of table t and l_t its label)
Let me know if I am wrong!
Yes, you are certainly right. Not sure where this came from. :)
On Sat, Apr 27, 2013 at 1:59 AM, Victor Chahuneau [email protected]:
I think you got ithttps://github.com/redpony/cpyp/blob/master/cpyp/crp.h#L296wrong:
for (auto& dish_loc : dish_locs_) lp += lgamma(dish_loc.second.num_tables());
should be:
for (auto& dish_loc : dish_locs_) for (auto& bin : dish_loc.second.h[0]) lp += lgamma(bin.first) * bin.second;
According to my derivation:
[image: image]https://f.cloud.github.com/assets/470022/433900/8fd941b8-aeff-11e2-9531-b288650e6e5b.png
(where c_t is the count of table t and l_t its label)
Let me know if I am wrong!
— Reply to this email directly or view it on GitHubhttps://github.com/redpony/cpyp/issues/1 .