This article answers Exercise 4.14 from the highly recommended Bayes Rules! book.
In Chapter 4 of the book, recall that the Bechdel test is satisfied by a movie whose conditions are as follows:
- the movie has at least two women in it,
- these two women talk to each other, and
- the two women also talk about something other than a man.
Furthermore, Figure 1 summarizes the three rules mentioned before.
Suppose that we review a sample of n recent movies and record Y, the number of movies that pass the Bechdel test. Considering Y as the number of “successes” in a fixed number of independence trials, Y can be specified as a Binomial model with π as its parameter. Moreover, π can also be described as Beta distribution with prior hyperparameters α and β:
Y∣π∼Bin(n,π)π∼Beta(α,β).Thus, the posterior of Beta-Binomial model of π is given by
π∣(Y=y)∼Beta(α+y,β+n−y).The Question:
In the Beta-Binomial setting, show that we can write the posterior mode of π as the weighted average of the prior mode and observed sample success rate: Mode(π∣Y=y)=α+β−2α+β+n−2⋅Mode(π)+nα+β+n−2⋅yn
Answer:
Recall that mode of the prior is
and mode of the posterior is
Mode(π∣Y=y)=α+y−1α+β+n−2.Next, we show that Equation (4) can be written as Equation (2) as follows:
Mode(π∣Y=y)=α+y−1α+β+n−2=α−1α+β+n−2+yα+β+n−2=α−1α+β+n−2⋅α+β−2α+β−2+yα+β+n−2⋅nn=α+β−2α+β+n−2⋅α−1α+β−2+nα+β+n−2⋅ynRearrange the terms=α+β−2α+β+n−2⋅Mode(π)+nα+β+n−2⋅yn.Utilize Equation (3)At last, we have shown that Equation (2) is indeed true.