Get startedGet started for free

Decision analysis: profit

Good job translating the posterior click rates into cost distributions! In the meantime, a new company policy has been released. From now on, the goal of the marketing department is not to minimize the costs of campaigns, which was quite ineffective, but rather to maximize the profit. Can you adjust your findings accordingly, knowing that the expected revenue per click from a mobile ad is $3.4, and the one from a desktop ad is $3? To calculate the profit, you need to calculate the revenue from all clicks, then subtract the corresponding cost from it.

Everything you have calculated in the previous exercise is available in your workspace: the ads_cost dictionary as well as the number of click distributions: clothes_num_clicks and sneakers_num_clicks.

This exercise is part of the course

Bayesian Data Analysis in Python

View Course

Exercise instructions

  • Create a dictionary ads_profit with four keys: clothes_mobile, sneakers_mobile, clothes_desktop, and sneakers_sneakers, each holding the profit distribution from corresponding clicks.
  • Draw a forest plot of ads_proft using the credible interval of 99%.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Calculate profit distributions for each product and platform
ads_profit = {
    "clothes_mobile": ____,
    "sneakers_mobile": ____,
    "clothes_desktop": ____,
    "sneakers_desktop": ____,
}

# Draw a forest plot of ads_profit
____
plt.show()
Edit and Run Code