Giter VIP home page Giter VIP logo

nitinjosephrepo / marketing-mix-modeling-mmm-using-robyn Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 273 KB

A New GeneratUsing Robyn aims to reduce human bias in the modeling process, esp. by automating modelers decisions like adstocking, saturation, trend & seasonality as well as model validation. Moreover, the budget allocator & calibration enable actionability and causality of the results

R 100.00%
adstocking marketing-mix-modeling facebook-prophet marketing-science mmm nevergrad

marketing-mix-modeling-mmm-using-robyn's Introduction

Marketing Mix Modeling (MMM) using Robyn

What is Robyn?

A New Generation of Marketing Mix Modeling. Robyn aims to reduce human bias in the modeling process, esp. by automating modelers decisions like adstocking, saturation, trend & seasonality as well as model validation. Moreover, the budget allocator & calibration enable actionability and causality of the results

What is MMM?

Marketing Modeling Mix (MMM) have been around for more than 60 years, but with dawn of digital marketing that relied on tags, cookies, pixels and mobiles IDs to craft well architected bigger, better, more targeted campaigns they fell out of use. Until now.

There are two main reason for their comeback

  1. A new wave of consumer privacy requirements and increased regulatory pressure have ushered in an enhanced focus on privacy and data protection. With these market changes, advertisers are becoming more concerned with platform-lock-in risks, the uncertainty surrounding matching algorithms’ accuracy without cookies and IDs, and the difficulty brands may have in collecting and building first-party data pools. Given this new environment, brands and marketers need to rethink their measurement strategies and audience-building methods
  2. Inability to attribute the impact of offline channels (TV, Radio, Newspapers) to conversion or sales

Thus Marketing mix modeling (MMM) is a privacy-friendly, highly resilient, data-driven statistical analysis that quantifies the incremental sales impact and ROI of marketing and non-marketing activities. MMM is an econometric model that aims to quantify the incremental impact of marketing and non-marketing activities on a pre-defined KPI (like sales or website visits).

This is a holistic model used to understand how to allocate a marketing budget across marketing channels, products and regions and can help forecast the impact of future events or campaigns

A Quick Look at the Data we are modelling.

Time series data with weekly interval by impression, clicks and Spends for each channel.

Target Variable is Revenue

Our Marketing Variables are

  1. Tv Spend
  2. Radio Spend
  3. Print Spend
  4. Facebook Spend
  5. Facebook Impressions
  6. Paid Search Clicks
  7. Organic Search Clicks
  8. Competitor Sales
  9. Online Events (Email Marketing, coupons etc)
  10. Newsletter Clicks

data

Quick Start

1. Downloading the latest R version

It is necessary to have the R 4.0.0 version (or higher) installed in order to be able to run this code. Install R Studio from here

2. Installing the package

To install or update Robyn to the latest stable version of the package, run:

       install.packages("Robyn")

then install Reticulate Package

       install.packages("reticulate")
       library(reticulate)

Create a virtual environment and then install nevergrad library using pip

       virtualenv_create("r-reticulate")
       py_install("nevergrad", pip = TRUE)
       use_virtualenv("r-reticulate", required = TRUE)

Run

       robyn3.8.1_run.R

Run the Model.

Robyn uses Evoluationary Algorithm to identify the best models, and thus requires a minimum of 5 trials with 2000 iterations each.

1.Analyse and Interpret Robyn output

Selcting from one among a dozen Robyn generated MMM model is a little bit of an art and relies on business knowledge.

Lets look at how well Facebook Prophet has done

Screenshot 2022-12-14 at 4 18 42 PM

Not bad! The blue dotted line shows that model is doing a good job of understanding the underlying patterns of our data.

2. Attributing Revenue to Channels.

Screenshot 2022-12-14 at 4 57 38 PM

  • Its intresting to note that 41.1% of revenue can be attributed to our competitors marketing efforts, most likely an overall lift experienced from awareness generated by competitor marketing campaigns
  • 8.28% Sales can be attributed to TV.

3. Total Share By Channel

Screenshot 2022-12-14 at 8 41 56 PM

4. Geometric Adstock

If you want to know what Adstock is this is a good primer https://towardsdatascience.com/market-mix-modeling-mmm-101-3d094df976f9

Screenshot 2022-12-14 at 8 55 49 PM

Budget Allocation & optimization

Once we have optimal model results plots and have chosen a model we run budget allocator, results will be plotted and saved under the same folder where the model plots had been saved. The result would look like the following:

optimizer_new

Look at the Initial vs Optimized budget allocation. What model is telling us is that we can expect 28.1% increase in revenue just be re allocating the budget. Recommendation is to increase the budget for TV, Search and Print and reduce the budget for Radio and Facebook.

marketing-mix-modeling-mmm-using-robyn's People

Contributors

nitinjosephrepo avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.