ComenzarEmpieza gratis

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.

Este ejercicio forma parte del curso

Bayesian Data Analysis in Python

Ver curso

Ejercicio interactivo práctico

Prueba este ejercicio completando el código de muestra.

# Calculate posterior difference and plot it
diff = ____
sns.kdeplot(diff, shade=True, label="diff")
plt.show()
Editar y ejecutar código