From deterministic to probabilistic SEM bid optimization

The goal of every search engine marketing (SEM) advertiser is to maximize their returns at the lowest possible cost. Campaign performance is primarily tuned by adjusting the maximum cost per click (CPC) bid for each ad. However, finding the “perfect” CPC bid can be a moving target since the auction is constantly in flux. The “sleeper” problem Imagine an extreme (but likely) scenario where ad spend is significantly over the allocated budget for the month....

October 1, 2020 · Christopher Yee

Firearm Sales: How are Americans coping with 2020?

The US has a peculiar relationship with guns where we frequently observe nontrivial spikes in firearm sales. These are triggered (pun intended) by various political, economic, and social events at the time. With 2020 being an especially chaotic year, I wanted to explore how that phenomenon is reflected in American gun purchases thus far. Load modules import pandas as pd import matplotlib.pyplot as plt import seaborn as sns Retrieve data I was unable to find confirmed and accurate gun purchase data that is free on the web....

September 14, 2020 · Christopher Yee

Build a loan amortization schedule with Python

With mortgage rates at a historical low there are inklings the US housing market is heating up again. Buying a home is a huge decision and in a perfect world everyone weighs their options and makes a (relatively) rational choice. One approach is to lay out all the mortgage offers and compare how much more we’re paying over the life of the loan. In this article I want to achieve a few things:...

August 16, 2020 · Christopher Yee

Star Wars: exploring Lucas vs Disney era ticket sales

With the end of the latest Star Wars trilogy, I wanted to compare, contrast, and explore Lucas vs Disney era domestic box office revenue. The analysis and python code below will parse weekly ticket sales from Box Office Mojo, adjust revenue numbers for inflation, visualize, and attempt to uncover insights from the data. TL;DR The top 3 revenue generating films (inflation-adjusted) are the first movie for each trilogy Disney era films do not make it past week 20 compared to the Lucas era On average, Lucas era movies generate 80% of their revenue within the first 10 weeks of release while Disney takes 2....

August 1, 2020 · Christopher Yee

Examining drug effectiveness studies via simulation

One of my dogs was recently diagnosed with an enlarged heart so the vet prescribed some medicine to mitigate the problem. The box came with a pamphlet which included the company’s effectiveness study for the drug, Vetmedin. I thought it would be fun to visualize one portion of the study with simulation. What follows is the #rstats code I used to examine and review the drug’s efficacy based on the reported results....

July 10, 2020 · Christopher Yee

Algorithm to prioritize home improvement projects

I moved to Los Angeles with my wife in October 2019 where we had a list of home improvement projects we wanted to complete or things to purchase. The problem we faced was disagreement on where to start since we had to juggle costs and compromise on what was most important at the time. For example, if we focused too much on lower ticket purchases we would delay projects that had potential to improve our home value....

July 2, 2020 · Christopher Yee

R script for the CausalImpact package

Google has an amazing #rstats package called CausalImpact to predict the counterfactual: what would have happened if an intervention did not occur. This is a quick technical post to get someone up and running rather than a review of its literature, usage, or idiosyncrasies Load libraries library(tidyverse) library(CausalImpact) Download (dummy) data df <- read_csv("https://raw.githubusercontent.com/Eeysirhc/random_datasets/master/cimpact_sample_data.csv") df %>% sample_n(5) ## # A tibble: 5 x 3 ## date experiment_type revenue ## <date> <chr> <dbl> ## 1 2020-04-02 control 309....

May 19, 2020 · Christopher Yee

Exploratory data analysis on COVID-19 search queries

The team at Bing were generous enough to release search query data with COVID-19 intent. The files are broken down by country and state level granularity so we can understand how the world is coping with the pandemic through search. What follows is an exploratory analysis on how US Bing users are searching for COVID-19 (a.k.a. coronavirus) information. tl;dr COVID-19 search queries generally fall into five distinct categories: 1....

May 5, 2020 · Christopher Yee