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

Exercise

A or B, and how sure are we?

You have just discovered that clothes ads are likely to have a higher click ratio than sneakers ads. But what is the exact probability that this is the case? To find out, you will have to calculate the posterior difference between clothes and sneakers click rates. Then, you will calculate a credible interval for the difference to measure the uncertainty in the estimate. Finally, you will calculate the percentage of cases where this difference is positive, which corresponds to clothes click rate being higher. Let's get on with it!

arviz, seaborn, and matplotlib.pyplot have been imported for you as az, sns, and plt, respectively. Also, clothes_posterior and sneakers_posterior which you have calculated in the previous exercise are available in your workspace.

Instructions 1/3

undefined XP
    1
    2
    3
  • Calculate the posterior difference in click rates between clothes and sneakers ads and assign it to diff.