Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log-likelihood of Dirichlet process #1

Open
vchahun opened this issue Apr 27, 2013 · 1 comment
Open

Log-likelihood of Dirichlet process #1

vchahun opened this issue Apr 27, 2013 · 1 comment

Comments

@vchahun
Copy link

vchahun commented Apr 27, 2013

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:

image

(where c_t is the count of table t and l_t its label)

Let me know if I am wrong!

@redpony
Copy link
Owner

redpony commented Apr 27, 2013

Yes, you are certainly right. Not sure where this came from. :)

On Sat, Apr 27, 2013 at 1:59 AM, Victor Chahuneau
notifications@github.comwrote:

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//issues/1
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants