Probabilistic-Programming-and-Bayesian-Methods-for-Hackers icon indicating copy to clipboard operation
Probabilistic-Programming-and-Bayesian-Methods-for-Hackers copied to clipboard

Chapter 1 | Mandatory coin-flip mislabeled prior | TFP version

Open arastuie opened this issue 6 years ago • 1 comments

Hi there,

The first line of the code for the Mandatory coin-flip example creates a random variable as follows: rv_coin_flip_prior = tfp.distributions.Bernoulli(probs=0.5, dtype=tf.int32)

I think the variable name implies that it is the prior of the coin flip, however we know that in this example both the prior and the posterior come from a Beta distribution, not a Bernoulli.

I just think as the first example of a Bayesian approach it can be a bit misleading. Maybe a name like rv_coin_flip_data would be more suitable.

arastuie avatar Feb 19 '19 16:02 arastuie

@Makan-Ar I think you are right. Each coin-flip is drawn from a Bernoulli distribution. However, the consecutive draws by which we would like to check the fairness of the coin follow a Beta distribution. Hence this should also be the prior with innovations (and a the log-likelihood) from the Bernoulli distribution.

@CamDavidsonPilon What do you think?

Pindar777 avatar Mar 02 '19 18:03 Pindar777