posterior / distributions

Low-level primitives for collapsed Gibbs sampling in python and C++
BSD 3-Clause "New" or "Revised" License
16 stars 8 forks source link

Math bug in dbg.models.niw.Group.merge() #11

Closed fritzo closed 7 years ago

fritzo commented 7 years ago
def merge(self, shared, source):
    self.count += source.count
    self.sum_x += source.sum_x
    self.sum_xxT += source.sum_xxT  # FIXME This ignores the difference in .sum_x parts.

For a possibly correct implementation in 1d, see the nich implementation.

fritzo commented 7 years ago

Ah, I see this is not a bug: niw uses non-central moments, whereas nich uses central moments.