SlideShare a Scribd company logo
Running Stan in
Production: Bayesian
Revenue Estimation
2018-08-29 StanCon
Markus Ojala
PhD, Chief Data Scientist
Smartly.io
@MarkusOjala
Implemented in early 2017:
https://www.smartly.io/blog/tutorial-how-we-productized-bay
esian-revenue-estimation-with-stan
Referred by Andrew Gelman in early 2018:
http://andrewgelman.com/2018/01/21/smartly-io-productize
d-bayesian-revenue-estimation-stan/
“It’s BDA come to life!“
“This sort of thing is exactly what we were hoping to see.”
Blog posts
1 billion spend
Managed yearly
We Make Online Advertising
Easy, Effective, And
Enjoyable
Facebook &
Instagram Partner
Use Case: Campaign Budget Allocation
Multi-Armed
Bandit
The number of pulls for a given lever should match
its actual probability of being the optimal lever
Sample from the posterior for the mean of each lever
Bayesian Bandits / Thompson sampling
Modeling results per spend
Separate revenue model into two parts
ROAS = revenue / cost
= revenue / conversions * conversions / cost
= revenue / conversions * 1 / CPA
ROAS = return on ad spend
CPA = cost per action
Existing model
● Lot of data
● Varies fast
● Big differences
New model
● Little data
● Varies slowly
● Small real differences
● Lot of random variation
● Use hierarchical model: Account -> Campaign -> Ad set
● Revenue follows usually a long-tailed distribution, use log-normal
● We observe only hourly aggregates: approximate by using
Fenton-Wilkinson log-normal approximation
Modeling the revenue per purchase
Stan!
Start with
simple model
Posterior predictive checks with +100 real data
Fix step-by-step, allow no exceptions
Simplified end-model
● Easy way to write Bayesian models and do inference
● But hard to get stable in production: limit the scope of the model
● Reparametrize, use reasonable informative priors and custom initialization
○ Solves most of the convergence issues
● Sampling does not scale: we use ADVI / variational inference approximation
○ Validate that you get same results with sampling and ADVI
○ Random initialization issues were solved by fixing ADVI parameters
● About 1000 daily runs and $1M scheduled with Celery, PyStan, monitoring
Learnings in productizing Stan
Results 1
Common case:
ad sets don’t
really differ
Results 2
Campaigns
differ, ad sets
not
Results 3
Lot of data
Ad sets differ
Thank you.
Markus.Ojala@smartly.io
Are you an expert in Bayesian
modelling? Join us!
https://www.smartly.io/careers
We observe only aggregates
Goal: estimate log-normal parameters for ad sets
Challenge: observation i is aggregate of multiple events ni
Solution: Estimate by another log-normal
Multilevel
Model
Account
Campaign
Ad set

More Related Content

What's hot

(10-15-14) Lehigh Marketing 111 Lecture Materials
(10-15-14) Lehigh Marketing 111 Lecture Materials(10-15-14) Lehigh Marketing 111 Lecture Materials
(10-15-14) Lehigh Marketing 111 Lecture Materials
Brent Chudoba
 
In-app offers monetization from basics to advanced technics based on Crazy Pa...
In-app offers monetization from basics to advanced technics based on Crazy Pa...In-app offers monetization from basics to advanced technics based on Crazy Pa...
In-app offers monetization from basics to advanced technics based on Crazy Pa...
GameCamp
 
Testing Makes Perfect: A Case Study in Onsite Optimizations
Testing Makes Perfect: A Case Study in Onsite OptimizationsTesting Makes Perfect: A Case Study in Onsite Optimizations
Testing Makes Perfect: A Case Study in Onsite Optimizations
Ve Interactive, US
 
8 Seconds Plugmedia
8 Seconds Plugmedia8 Seconds Plugmedia
8 Seconds Plugmedia
Quantifed Self Meetup Brussels
 
LTV Predictions: How do real-life companies use them & what can you learn fro...
LTV Predictions: How do real-life companies use them & what can you learn fro...LTV Predictions: How do real-life companies use them & what can you learn fro...
LTV Predictions: How do real-life companies use them & what can you learn fro...
AppAgent / Strategic & Creative Mobile Marketing Agency
 
Maximize Customer Value (Optimove @ Market King Meetup - August 26, 2014)
Maximize Customer Value (Optimove @ Market King Meetup - August 26, 2014)Maximize Customer Value (Optimove @ Market King Meetup - August 26, 2014)
Maximize Customer Value (Optimove @ Market King Meetup - August 26, 2014)
Amit Bivas
 
Michael Twomey, Silverpop - 'Building ROI'
Michael Twomey, Silverpop - 'Building ROI'Michael Twomey, Silverpop - 'Building ROI'
Michael Twomey, Silverpop - 'Building ROI'
iStrategy
 
Getting from 0-$100K/m in SaaS
Getting from 0-$100K/m in SaaSGetting from 0-$100K/m in SaaS
Getting from 0-$100K/m in SaaS
Prasanna Krishnamoorthy
 
Ppc bbq 29.4.15
Ppc bbq 29.4.15Ppc bbq 29.4.15
Ppc bbq 29.4.15
Karel Parizek
 
15.02.2018
15.02.201815.02.2018
15.02.2018
TanishqArora4
 
Goals and Goal Funnels | Presented by Justin Spencer of Analytics Pros
Goals and Goal Funnels | Presented by Justin Spencer of Analytics ProsGoals and Goal Funnels | Presented by Justin Spencer of Analytics Pros
Goals and Goal Funnels | Presented by Justin Spencer of Analytics Pros
Caleb Whitmore
 
5 Pillars of PPC
5 Pillars of PPC5 Pillars of PPC
5 Pillars of PPC
Anton Shulke
 
Tom Lewis – CFO, IPA
Tom Lewis – CFO, IPATom Lewis – CFO, IPA
Tom Lewis – CFO, IPA
Global Business Intelligence
 
DMFA Package of the Year: amfAR
DMFA Package of the Year: amfARDMFA Package of the Year: amfAR
DMFA Package of the Year: amfAR
Sanky Inc.
 
The Private Life of Mail at Advertising Week Europe - A critique by Les Binet...
The Private Life of Mail at Advertising Week Europe - A critique by Les Binet...The Private Life of Mail at Advertising Week Europe - A critique by Les Binet...
The Private Life of Mail at Advertising Week Europe - A critique by Les Binet...
Royal Mail MarketReach
 
Presentation OMExpo - mobile and acquisition email
Presentation OMExpo - mobile and acquisition emailPresentation OMExpo - mobile and acquisition email
Presentation OMExpo - mobile and acquisition email
Powerspace
 
Testing Strategies
Testing StrategiesTesting Strategies
Testing Strategies
HP2009
 
Leveraging Content to Generate Leads: 3 simple tactics one company used to ac...
Leveraging Content to Generate Leads: 3 simple tactics one company used to ac...Leveraging Content to Generate Leads: 3 simple tactics one company used to ac...
Leveraging Content to Generate Leads: 3 simple tactics one company used to ac...
MarketingExperiments
 
Measure what Matters - Outcomes
Measure what Matters - OutcomesMeasure what Matters - Outcomes
Measure what Matters - Outcomes
pauleycreative
 
Going Beyond Loyalty Programs to Retain Your Customers – Optimove - GrowComme...
Going Beyond Loyalty Programs to Retain Your Customers – Optimove - GrowComme...Going Beyond Loyalty Programs to Retain Your Customers – Optimove - GrowComme...
Going Beyond Loyalty Programs to Retain Your Customers – Optimove - GrowComme...
GrowCommerce
 

What's hot (20)

(10-15-14) Lehigh Marketing 111 Lecture Materials
(10-15-14) Lehigh Marketing 111 Lecture Materials(10-15-14) Lehigh Marketing 111 Lecture Materials
(10-15-14) Lehigh Marketing 111 Lecture Materials
 
In-app offers monetization from basics to advanced technics based on Crazy Pa...
In-app offers monetization from basics to advanced technics based on Crazy Pa...In-app offers monetization from basics to advanced technics based on Crazy Pa...
In-app offers monetization from basics to advanced technics based on Crazy Pa...
 
Testing Makes Perfect: A Case Study in Onsite Optimizations
Testing Makes Perfect: A Case Study in Onsite OptimizationsTesting Makes Perfect: A Case Study in Onsite Optimizations
Testing Makes Perfect: A Case Study in Onsite Optimizations
 
8 Seconds Plugmedia
8 Seconds Plugmedia8 Seconds Plugmedia
8 Seconds Plugmedia
 
LTV Predictions: How do real-life companies use them & what can you learn fro...
LTV Predictions: How do real-life companies use them & what can you learn fro...LTV Predictions: How do real-life companies use them & what can you learn fro...
LTV Predictions: How do real-life companies use them & what can you learn fro...
 
Maximize Customer Value (Optimove @ Market King Meetup - August 26, 2014)
Maximize Customer Value (Optimove @ Market King Meetup - August 26, 2014)Maximize Customer Value (Optimove @ Market King Meetup - August 26, 2014)
Maximize Customer Value (Optimove @ Market King Meetup - August 26, 2014)
 
Michael Twomey, Silverpop - 'Building ROI'
Michael Twomey, Silverpop - 'Building ROI'Michael Twomey, Silverpop - 'Building ROI'
Michael Twomey, Silverpop - 'Building ROI'
 
Getting from 0-$100K/m in SaaS
Getting from 0-$100K/m in SaaSGetting from 0-$100K/m in SaaS
Getting from 0-$100K/m in SaaS
 
Ppc bbq 29.4.15
Ppc bbq 29.4.15Ppc bbq 29.4.15
Ppc bbq 29.4.15
 
15.02.2018
15.02.201815.02.2018
15.02.2018
 
Goals and Goal Funnels | Presented by Justin Spencer of Analytics Pros
Goals and Goal Funnels | Presented by Justin Spencer of Analytics ProsGoals and Goal Funnels | Presented by Justin Spencer of Analytics Pros
Goals and Goal Funnels | Presented by Justin Spencer of Analytics Pros
 
5 Pillars of PPC
5 Pillars of PPC5 Pillars of PPC
5 Pillars of PPC
 
Tom Lewis – CFO, IPA
Tom Lewis – CFO, IPATom Lewis – CFO, IPA
Tom Lewis – CFO, IPA
 
DMFA Package of the Year: amfAR
DMFA Package of the Year: amfARDMFA Package of the Year: amfAR
DMFA Package of the Year: amfAR
 
The Private Life of Mail at Advertising Week Europe - A critique by Les Binet...
The Private Life of Mail at Advertising Week Europe - A critique by Les Binet...The Private Life of Mail at Advertising Week Europe - A critique by Les Binet...
The Private Life of Mail at Advertising Week Europe - A critique by Les Binet...
 
Presentation OMExpo - mobile and acquisition email
Presentation OMExpo - mobile and acquisition emailPresentation OMExpo - mobile and acquisition email
Presentation OMExpo - mobile and acquisition email
 
Testing Strategies
Testing StrategiesTesting Strategies
Testing Strategies
 
Leveraging Content to Generate Leads: 3 simple tactics one company used to ac...
Leveraging Content to Generate Leads: 3 simple tactics one company used to ac...Leveraging Content to Generate Leads: 3 simple tactics one company used to ac...
Leveraging Content to Generate Leads: 3 simple tactics one company used to ac...
 
Measure what Matters - Outcomes
Measure what Matters - OutcomesMeasure what Matters - Outcomes
Measure what Matters - Outcomes
 
Going Beyond Loyalty Programs to Retain Your Customers – Optimove - GrowComme...
Going Beyond Loyalty Programs to Retain Your Customers – Optimove - GrowComme...Going Beyond Loyalty Programs to Retain Your Customers – Optimove - GrowComme...
Going Beyond Loyalty Programs to Retain Your Customers – Optimove - GrowComme...
 

Similar to Running Stan in Production: Bayesian Revenue Estimation

Adventures in Business Analytics – Optimization and the Organization Garry, s...
Adventures in Business Analytics – Optimization and the Organization Garry, s...Adventures in Business Analytics – Optimization and the Organization Garry, s...
Adventures in Business Analytics – Optimization and the Organization Garry, s...
Tin Ho
 
Introduction to cohort Analysis - MeasureCamp Paris
Introduction to cohort Analysis - MeasureCamp ParisIntroduction to cohort Analysis - MeasureCamp Paris
Introduction to cohort Analysis - MeasureCamp Paris
Universem
 
Sample v2
Sample v2Sample v2
Sample v2
Eshank Bahuguna
 
The Analytics Lifecycle
The Analytics LifecycleThe Analytics Lifecycle
The Analytics Lifecycle
Simon Harrison ACMA CGMA
 
Lean advertising 101 - Paid Acquisition for Startups
Lean advertising 101 - Paid Acquisition for StartupsLean advertising 101 - Paid Acquisition for Startups
Lean advertising 101 - Paid Acquisition for Startups
Clément Delangue
 
The Google Analytics API and Analytics Canvas
The Google Analytics API and Analytics CanvasThe Google Analytics API and Analytics Canvas
The Google Analytics API and Analytics Canvas
nModal Solutions Inc.
 
Step by Step Guide to Revenue Growth
Step by Step Guide to Revenue GrowthStep by Step Guide to Revenue Growth
Step by Step Guide to Revenue Growth
saastr
 
Rapid Economic Justifcation for Machine Learning in IoT
Rapid Economic Justifcation for Machine Learning in IoTRapid Economic Justifcation for Machine Learning in IoT
Rapid Economic Justifcation for Machine Learning in IoT
Value Amplify Consulting
 
Let’s make web analytics more customer centric!
Let’s make web analytics more customer centric!Let’s make web analytics more customer centric!
Let’s make web analytics more customer centric!
Optimics s.r.o.
 
Lessons learned from 3k SaaS Companies - Patrick Campbell, CEO, Price Intelli...
Lessons learned from 3k SaaS Companies - Patrick Campbell, CEO, Price Intelli...Lessons learned from 3k SaaS Companies - Patrick Campbell, CEO, Price Intelli...
Lessons learned from 3k SaaS Companies - Patrick Campbell, CEO, Price Intelli...
SaaStock
 
Better Living Through Analytics - Strategies for Data Decisions
Better Living Through Analytics - Strategies for Data DecisionsBetter Living Through Analytics - Strategies for Data Decisions
Better Living Through Analytics - Strategies for Data Decisions
Product School
 
Intro to Data Analytics with Oscar's Director of Product
 Intro to Data Analytics with Oscar's Director of Product Intro to Data Analytics with Oscar's Director of Product
Intro to Data Analytics with Oscar's Director of Product
Product School
 
[Webinar] Innovate Faster by Adopting The Modern Growth Stack
[Webinar] Innovate Faster by Adopting The Modern Growth Stack[Webinar] Innovate Faster by Adopting The Modern Growth Stack
[Webinar] Innovate Faster by Adopting The Modern Growth Stack
Optimizely
 
Content marketing analytics: how to make your data work harder for your business
Content marketing analytics: how to make your data work harder for your businessContent marketing analytics: how to make your data work harder for your business
Content marketing analytics: how to make your data work harder for your business
Daniel Smulevich
 
Class 03: Introduction to Google Analytics
Class 03: Introduction to Google AnalyticsClass 03: Introduction to Google Analytics
Class 03: Introduction to Google Analytics
Jon Chang
 
Social Media ROI: Formulas & Conversion Optimization Tips
Social Media ROI: Formulas & Conversion Optimization TipsSocial Media ROI: Formulas & Conversion Optimization Tips
Social Media ROI: Formulas & Conversion Optimization Tips
Angie Schottmuller
 
TradeSmart Case Studies
TradeSmart Case StudiesTradeSmart Case Studies
How to Use Data for Product Decisions by YouTube Product Manager
How to Use Data for Product Decisions by YouTube Product ManagerHow to Use Data for Product Decisions by YouTube Product Manager
How to Use Data for Product Decisions by YouTube Product Manager
Product School
 
GAUC 2020 - presentatie Hans en Reinier
GAUC 2020 - presentatie Hans en ReinierGAUC 2020 - presentatie Hans en Reinier
GAUC 2020 - presentatie Hans en Reinier
Online Dialogue
 
Spike - pitch deck
Spike - pitch deckSpike - pitch deck
Spike - pitch deck
Tarek Sheikh AL-Shbab
 

Similar to Running Stan in Production: Bayesian Revenue Estimation (20)

Adventures in Business Analytics – Optimization and the Organization Garry, s...
Adventures in Business Analytics – Optimization and the Organization Garry, s...Adventures in Business Analytics – Optimization and the Organization Garry, s...
Adventures in Business Analytics – Optimization and the Organization Garry, s...
 
Introduction to cohort Analysis - MeasureCamp Paris
Introduction to cohort Analysis - MeasureCamp ParisIntroduction to cohort Analysis - MeasureCamp Paris
Introduction to cohort Analysis - MeasureCamp Paris
 
Sample v2
Sample v2Sample v2
Sample v2
 
The Analytics Lifecycle
The Analytics LifecycleThe Analytics Lifecycle
The Analytics Lifecycle
 
Lean advertising 101 - Paid Acquisition for Startups
Lean advertising 101 - Paid Acquisition for StartupsLean advertising 101 - Paid Acquisition for Startups
Lean advertising 101 - Paid Acquisition for Startups
 
The Google Analytics API and Analytics Canvas
The Google Analytics API and Analytics CanvasThe Google Analytics API and Analytics Canvas
The Google Analytics API and Analytics Canvas
 
Step by Step Guide to Revenue Growth
Step by Step Guide to Revenue GrowthStep by Step Guide to Revenue Growth
Step by Step Guide to Revenue Growth
 
Rapid Economic Justifcation for Machine Learning in IoT
Rapid Economic Justifcation for Machine Learning in IoTRapid Economic Justifcation for Machine Learning in IoT
Rapid Economic Justifcation for Machine Learning in IoT
 
Let’s make web analytics more customer centric!
Let’s make web analytics more customer centric!Let’s make web analytics more customer centric!
Let’s make web analytics more customer centric!
 
Lessons learned from 3k SaaS Companies - Patrick Campbell, CEO, Price Intelli...
Lessons learned from 3k SaaS Companies - Patrick Campbell, CEO, Price Intelli...Lessons learned from 3k SaaS Companies - Patrick Campbell, CEO, Price Intelli...
Lessons learned from 3k SaaS Companies - Patrick Campbell, CEO, Price Intelli...
 
Better Living Through Analytics - Strategies for Data Decisions
Better Living Through Analytics - Strategies for Data DecisionsBetter Living Through Analytics - Strategies for Data Decisions
Better Living Through Analytics - Strategies for Data Decisions
 
Intro to Data Analytics with Oscar's Director of Product
 Intro to Data Analytics with Oscar's Director of Product Intro to Data Analytics with Oscar's Director of Product
Intro to Data Analytics with Oscar's Director of Product
 
[Webinar] Innovate Faster by Adopting The Modern Growth Stack
[Webinar] Innovate Faster by Adopting The Modern Growth Stack[Webinar] Innovate Faster by Adopting The Modern Growth Stack
[Webinar] Innovate Faster by Adopting The Modern Growth Stack
 
Content marketing analytics: how to make your data work harder for your business
Content marketing analytics: how to make your data work harder for your businessContent marketing analytics: how to make your data work harder for your business
Content marketing analytics: how to make your data work harder for your business
 
Class 03: Introduction to Google Analytics
Class 03: Introduction to Google AnalyticsClass 03: Introduction to Google Analytics
Class 03: Introduction to Google Analytics
 
Social Media ROI: Formulas & Conversion Optimization Tips
Social Media ROI: Formulas & Conversion Optimization TipsSocial Media ROI: Formulas & Conversion Optimization Tips
Social Media ROI: Formulas & Conversion Optimization Tips
 
TradeSmart Case Studies
TradeSmart Case StudiesTradeSmart Case Studies
TradeSmart Case Studies
 
How to Use Data for Product Decisions by YouTube Product Manager
How to Use Data for Product Decisions by YouTube Product ManagerHow to Use Data for Product Decisions by YouTube Product Manager
How to Use Data for Product Decisions by YouTube Product Manager
 
GAUC 2020 - presentatie Hans en Reinier
GAUC 2020 - presentatie Hans en ReinierGAUC 2020 - presentatie Hans en Reinier
GAUC 2020 - presentatie Hans en Reinier
 
Spike - pitch deck
Spike - pitch deckSpike - pitch deck
Spike - pitch deck
 

Recently uploaded

The Ipsos - AI - Monitor 2024 Report.pdf
The  Ipsos - AI - Monitor 2024 Report.pdfThe  Ipsos - AI - Monitor 2024 Report.pdf
The Ipsos - AI - Monitor 2024 Report.pdf
Social Samosa
 
writing report business partner b1+ .pdf
writing report business partner b1+ .pdfwriting report business partner b1+ .pdf
writing report business partner b1+ .pdf
VyNguyen709676
 
Experts live - Improving user adoption with AI
Experts live - Improving user adoption with AIExperts live - Improving user adoption with AI
Experts live - Improving user adoption with AI
jitskeb
 
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
nuttdpt
 
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
nuttdpt
 
University of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma TranscriptUniversity of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma Transcript
soxrziqu
 
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
slg6lamcq
 
Population Growth in Bataan: The effects of population growth around rural pl...
Population Growth in Bataan: The effects of population growth around rural pl...Population Growth in Bataan: The effects of population growth around rural pl...
Population Growth in Bataan: The effects of population growth around rural pl...
Bill641377
 
原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理
原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理
原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理
a9qfiubqu
 
一比一原版英属哥伦比亚大学毕业证(UBC毕业证书)学历如何办理
一比一原版英属哥伦比亚大学毕业证(UBC毕业证书)学历如何办理一比一原版英属哥伦比亚大学毕业证(UBC毕业证书)学历如何办理
一比一原版英属哥伦比亚大学毕业证(UBC毕业证书)学历如何办理
z6osjkqvd
 
Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......
Sachin Paul
 
"Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens"
"Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens""Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens"
"Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens"
sameer shah
 
Monthly Management report for the Month of May 2024
Monthly Management report for the Month of May 2024Monthly Management report for the Month of May 2024
Monthly Management report for the Month of May 2024
facilitymanager11
 
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
bopyb
 
UofT毕业证如何办理
UofT毕业证如何办理UofT毕业证如何办理
UofT毕业证如何办理
exukyp
 
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
sameer shah
 
Intelligence supported media monitoring in veterinary medicine
Intelligence supported media monitoring in veterinary medicineIntelligence supported media monitoring in veterinary medicine
Intelligence supported media monitoring in veterinary medicine
AndrzejJarynowski
 
End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024
Lars Albertsson
 
Challenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more importantChallenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more important
Sm321
 
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
apvysm8
 

Recently uploaded (20)

The Ipsos - AI - Monitor 2024 Report.pdf
The  Ipsos - AI - Monitor 2024 Report.pdfThe  Ipsos - AI - Monitor 2024 Report.pdf
The Ipsos - AI - Monitor 2024 Report.pdf
 
writing report business partner b1+ .pdf
writing report business partner b1+ .pdfwriting report business partner b1+ .pdf
writing report business partner b1+ .pdf
 
Experts live - Improving user adoption with AI
Experts live - Improving user adoption with AIExperts live - Improving user adoption with AI
Experts live - Improving user adoption with AI
 
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
 
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
 
University of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma TranscriptUniversity of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma Transcript
 
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
 
Population Growth in Bataan: The effects of population growth around rural pl...
Population Growth in Bataan: The effects of population growth around rural pl...Population Growth in Bataan: The effects of population growth around rural pl...
Population Growth in Bataan: The effects of population growth around rural pl...
 
原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理
原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理
原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理
 
一比一原版英属哥伦比亚大学毕业证(UBC毕业证书)学历如何办理
一比一原版英属哥伦比亚大学毕业证(UBC毕业证书)学历如何办理一比一原版英属哥伦比亚大学毕业证(UBC毕业证书)学历如何办理
一比一原版英属哥伦比亚大学毕业证(UBC毕业证书)学历如何办理
 
Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......
 
"Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens"
"Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens""Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens"
"Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens"
 
Monthly Management report for the Month of May 2024
Monthly Management report for the Month of May 2024Monthly Management report for the Month of May 2024
Monthly Management report for the Month of May 2024
 
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
 
UofT毕业证如何办理
UofT毕业证如何办理UofT毕业证如何办理
UofT毕业证如何办理
 
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
 
Intelligence supported media monitoring in veterinary medicine
Intelligence supported media monitoring in veterinary medicineIntelligence supported media monitoring in veterinary medicine
Intelligence supported media monitoring in veterinary medicine
 
End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024
 
Challenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more importantChallenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more important
 
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
 

Running Stan in Production: Bayesian Revenue Estimation

  • 1. Running Stan in Production: Bayesian Revenue Estimation 2018-08-29 StanCon Markus Ojala PhD, Chief Data Scientist Smartly.io @MarkusOjala
  • 2. Implemented in early 2017: https://www.smartly.io/blog/tutorial-how-we-productized-bay esian-revenue-estimation-with-stan Referred by Andrew Gelman in early 2018: http://andrewgelman.com/2018/01/21/smartly-io-productize d-bayesian-revenue-estimation-stan/ “It’s BDA come to life!“ “This sort of thing is exactly what we were hoping to see.” Blog posts
  • 3. 1 billion spend Managed yearly We Make Online Advertising Easy, Effective, And Enjoyable Facebook & Instagram Partner
  • 4.
  • 5. Use Case: Campaign Budget Allocation
  • 7. The number of pulls for a given lever should match its actual probability of being the optimal lever Sample from the posterior for the mean of each lever Bayesian Bandits / Thompson sampling
  • 9. Separate revenue model into two parts ROAS = revenue / cost = revenue / conversions * conversions / cost = revenue / conversions * 1 / CPA ROAS = return on ad spend CPA = cost per action Existing model ● Lot of data ● Varies fast ● Big differences New model ● Little data ● Varies slowly ● Small real differences ● Lot of random variation
  • 10. ● Use hierarchical model: Account -> Campaign -> Ad set ● Revenue follows usually a long-tailed distribution, use log-normal ● We observe only hourly aggregates: approximate by using Fenton-Wilkinson log-normal approximation Modeling the revenue per purchase
  • 11. Stan!
  • 13. Posterior predictive checks with +100 real data
  • 14. Fix step-by-step, allow no exceptions
  • 16. ● Easy way to write Bayesian models and do inference ● But hard to get stable in production: limit the scope of the model ● Reparametrize, use reasonable informative priors and custom initialization ○ Solves most of the convergence issues ● Sampling does not scale: we use ADVI / variational inference approximation ○ Validate that you get same results with sampling and ADVI ○ Random initialization issues were solved by fixing ADVI parameters ● About 1000 daily runs and $1M scheduled with Celery, PyStan, monitoring Learnings in productizing Stan
  • 17. Results 1 Common case: ad sets don’t really differ
  • 19. Results 3 Lot of data Ad sets differ
  • 20. Thank you. Markus.Ojala@smartly.io Are you an expert in Bayesian modelling? Join us! https://www.smartly.io/careers
  • 21. We observe only aggregates Goal: estimate log-normal parameters for ad sets Challenge: observation i is aggregate of multiple events ni Solution: Estimate by another log-normal