1. Learn
  2. /
  3. Courses
  4. /
  5. Bayesian Data Analysis in Python

Connected

Exercise

Posterior click rates

After a successful career episode at the Department for Health, you switch to marketing. Your new company has just run two pilot advertising campaigns: one for sneakers, and one for clothes. Your job is to find out which one was more effective as measured by the click-through rate and should be rolled out to a larger audience.

You decide to run A/B testing, modeling the data using the binomial likelihood. You found out that a typical click-through rate for the previous ads has been around 15% recently, with results varying between 5% and 30%. Based on this, you conclude that \(Beta(10, 50)\) would be a good prior for the click-through rate.

The ads data, the simulate_beta_posterior() function you saw in the video, and numpy (as np) are available in your workspace.

Instructions 1/4

undefined XP
    1
    2
    3
    4
  • Simulate 100000 draws from the prior distribution, assigning the result to prior_draws.
  • Plot the density of prior_draws to make sure it reflects your prior knowledge about the click-through rate.