dm13450 / dirichletprocess

Build dirichletprocess objects for data analysis
https://dm13450.github.io/dirichletprocess/
58 stars 14 forks source link

Error in update_concentration ? #19

Closed EtienneGof closed 3 years ago

EtienneGof commented 3 years ago

Hello!

Thanks for this package and code that help a lot in understanding the dpmm. I had a question, but in the meantime I found the answer and this issue is no longer legitimate.

The original question was:

In script 'update_concentration.R', line 22: "new_alpha <- rgamma(1, postParams1, postParams2)" The update is based on [1] that says (in sec. 2.2) that the gamma prior is parameterized with 'a' (shape) and 'b' (scale). However, the rgamma function is parameterized with shape and rate (=1/scale). Shouldn't line 22 be: 'new_alpha <- rgamma(1, shape = postParams1, scale = postParams2)' ?

The answer to that question is that there seems to be an error in the original paper, and the parameterization is indeed (shape, rate) (cf here) This issue can be deleted, sorry =/

[1] West, M. (1992). Hyperparameter estimation in Dirichlet process mixture models. ISDS Discussion Paper# 92-A03: Duke University.

dm13450 commented 3 years ago

No worries, thanks for using the package and investigating this!