ctgk / PRML

PRML algorithms implemented in Python
MIT License
11.43k stars 3.25k forks source link

draw() in Bernoulli distribution #35

Closed gdxie1 closed 2 years ago

gdxie1 commented 2 years ago

the line in the draw should change from self.mu.n_ones / (self.mu.n_ones + self.mu.n_zeros) to

_(self.mu.n_ones - 1) / (self.mu.n_ones + self.mu.nzeros -2)

ctgk commented 2 years ago

Should it be?

gdxie1 commented 2 years ago

when you added the prior distribution, you should -1 and -2. Maybe I am wrong. Thank you anyway, it's a good project.

ctgk commented 2 years ago

Could you specify from which equation in PRML you though it should have -1 and -2?

gdxie1 commented 2 years ago

Hi, I checked the book and found that you are right. I mistake the MAP of mu as the p(x=1|D) under Bayes. Sorry for this.

ctgk commented 2 years ago

Oh, I see! Yeah, it is confusing that we need them for estimation of mu and not for p(x=1||D).