+ - 0:00:00
Notes for current slide
Notes for next slide

The Beta-Binomial Model

Dr. Dogucu

1 / 21

Posterior for the Beta-Binomial Model

Let πBeta(α,β) and X|nBin(n,π).

2 / 21

Posterior for the Beta-Binomial Model

Let πBeta(α,β) and X|nBin(n,π).

f(π|x)Γ(α+β)Γ(α)Γ(β)πα1(1π)β1(nx)πx(1π)nx

3 / 21

Posterior for the Beta-Binomial Model

Let πBeta(α,β) and X|nBin(n,π).

f(π|x)Γ(α+β)Γ(α)Γ(β)πα1(1π)β1(nx)πx(1π)nx

f(π|x)π(α+x)1(1π)(β+nx)1

4 / 21

Posterior for the Beta-Binomial Model

Let πBeta(α,β) and X|nBin(n,π).

f(π|x)Γ(α+β)Γ(α)Γ(β)πα1(1π)β1(nx)πx(1π)nx

f(π|x)π(α+x)1(1π)(β+nx)1

π|xBeta(α+x,β+nx)

5 / 21

Posterior for the Beta-Binomial Model

Let πBeta(α,β) and X|nBin(n,π).

f(π|x)Γ(α+β)Γ(α)Γ(β)πα1(1π)β1(nx)πx(1π)nx

f(π|x)π(α+x)1(1π)(β+nx)1

π|xBeta(α+x,β+nx)

f(π|x)=Γ(α+β+n)Γ(α+x)Γ(β+nx)π(α+x)1(1π)(β+nx)1

6 / 21

Conjugate prior

We say that f(π) is a conjugate prior for L(π|x) if the posterior, f(π|x)f(π)L(π|x), is from the same model family as the prior.

Thus, Beta distribution is a conjugate prior for the Binomial likelihood model since the posterior also follows a Beta distribution.

7 / 21

Bike ownership

The transportation office at our school wants to know π the proportion of people who own bikes on campus so that they can build bike racks accordingly. The staff at the office think that the π is more likely to be somewhere 0.05 to 0.25. The plot below shows their prior distribution. Write out a reasonable f(π). Calculate the prior expected value, mode, and variance.

8 / 21

Plotting the prior

plot_beta(5, 35)

9 / 21

Summarizing the prior

summarize_beta(5, 35)
## mean mode var
## 1 0.125 0.1052632 0.002667683
10 / 21

Bike ownership posterior

The transportation office decides to collect some data and samples 50 people on campus and asks them whether they own a bike or not. It turns out that 25 of them do! What is the posterior distribution of π after having observed this data?

11 / 21

Bike ownership posterior

The transportation office decides to collect some data and samples 50 people on campus and asks them whether they own a bike or not. It turns out that 25 of them do! What is the posterior distribution of π after having observed this data?

π|xBeta(α+x,β+nx)

12 / 21

Bike ownership posterior

The transportation office decides to collect some data and samples 50 people on campus and asks them whether they own a bike or not. It turns out that 25 of them do! What is the posterior distribution of π after having observed this data?

π|xBeta(α+x,β+nx)

π|xBeta(5+25,35+5025)

13 / 21

Bike ownership posterior

The transportation office decides to collect some data and samples 50 people on campus and asks them whether they own a bike or not. It turns out that 25 of them do! What is the posterior distribution of π after having observed this data?

π|xBeta(α+x,β+nx)

π|xBeta(5+25,35+5025)

π|xBeta(30,60)

14 / 21

Plotting the posterior

plot_beta(30, 60)

15 / 21

Summarizing the posterior

summarize_beta(30,60)
## mean mode var
## 1 0.3333333 0.3295455 0.002442002
16 / 21

Plot summary

plot_beta(30, 60, mean = TRUE, mode = TRUE)

17 / 21

Bike ownership: balancing act

plot_beta_binomial(alpha = 5, beta = 35,
x = 25, n = 50)

18 / 21

Posterior Descriptives

π|(X=x)Beta(α+x,β+nx)

E(π|(X=x))=α+xα+β+n Mode(π|(X=x))=α+x1α+β+n2 Var(π|(X=x))=(α+x)(β+nx)(α+β+n)2(α+β+n+1)

19 / 21

Bike ownership - descriptives of the posterior

What is the descriptive measures (expected value, mode, and variance) of the posterior distribution for the bike ownership example?

20 / 21

Bike ownership - descriptives of the posterior

What is the descriptive measures (expected value, mode, and variance) of the posterior distribution for the bike ownership example?

summarize_beta_binomial(5, 35, x = 25, n = 50)
## model alpha beta mean mode var
## 1 prior 5 35 0.1250000 0.1052632 0.002667683
## 2 posterior 30 60 0.3333333 0.3295455 0.002442002
21 / 21

Posterior for the Beta-Binomial Model

Let πBeta(α,β) and X|nBin(n,π).

2 / 21
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
Esc Back to slideshow