Dynamic Pricing with Machine Learning: Brewing the topic

Dwipam Katariya
6 min readMar 16, 2023

--

Have you ever come across prices of commodities or your rides at Uber/Lyft or your AirBnB prices moving up and down? Yes, that’s dynamic pricing that’s trying to manage the equilibrium of supply, demand, and profitability

Reference: Yield Management

Introduction

Dynamic pricing is not a new concept. It has been around since the 1980s and is already used in the travel and hospitality industry. During peak usage and high demand, Dynamic pricing increases the prices while low demand reduces the prices to match up the supply and maximize profitability for all the parties. Dynamic pricing is also known as surge pricing, demand pricing, or time-based pricing. For example, airlines change prices based on seat types, the number of seats, and the time of the flight.

Basics of supply and demand equilibrium

Reference: umn.edu

The logic is pretty straightforward. The demand curve shows the buyer's willingness to buy the goods for various quantities, while the supply curve shows the seller's willingness to sell the goods for various quantities. Compare it to inflation. Prices of the goods increase because supply is limited, but demand skyrockets. When the two curves intersect, that’s the equilibrium when both buyer and seller agree on the price to trade and the quantity of supply is equal to the quantity of demand. In the above fig. $6 is the equilibrium price for an equilibrium quantity of 25 million quantities of coffee per month.

Price elasticity

Most customers in most markets are sensitive to the price of a product or service, and the assumption is that more people will buy the product or service if it’s cheaper and fewer will buy it if it’s more expensive. But the phenomenon is more quantifiable than that, and price elasticity shows exactly how responsive customer demand is for a product based on its price. “Marketers need to understand how elastic, sensitive to fluctuations in price, or inelastic, largely ambivalent about price changes, their products are when contemplating how to set or change a price,” says Avery. Commodities have the highest price elasticity while essentials are inelastic. Price elasticity is directly related to the demand curve. Price elasticity can be measured as follows:

reference: Harvard Business Review

A price elasticity of 1 denotes, your product is unit elastic and a change in price has an equal effect on the demand. A price elasticity of > 1 suggests the product is elastic and any changes in your price will cause a greater than proportional change in supply or demand while a price elasticity < 1 means, your product is inelastic and changes in your price will result in a smaller change in the supply or demand for your product.

Reference: https://www.economicsonline.co.uk/

If your product is elastic, you should be cautious about raising price, since it can directly impact the demand and impact overall revenue. But if your price is inelastic then you can adjust your prices with less caution.

Price Elasticity of Demand (PED)

Before we explore using statistical techniques to perform dynamic pricing, understanding the Price Elasticity of Demand is really crucial. If you sell, If you sell 10,000 reams of paper at $100 per ream and then raise the price to $150 per ream and sell 7,000 reams, your elasticity of demand would be -0.88. This would be considered inelastic because it is less than one.

Broken down even further to include the calculation of percent change, this formula looks like this:

((QN — QI) / (QN + QI) / 2) / ((PN — PI) / (PN + PI) / 2)

where:

  • QN = New Quantity (7,000)
  • QI = Initial Quantity (10,000)
  • PN = New Price ($150)
  • PI = Initial Price ($100)

Our numbers plugged into this formula would be:

(7,000–10,000) / (7,000 +10,000) /2) / (150–100) / (150–100) / 2)

This comes to an inelastic demand of -0.8, Since |PED| < 1 ⇒ demand is inelastic.

One last fundamental to cover is “Willingness to Pay”

Have you thought, why are we paying different prices from others? Is it a personalized price? Is that even appropriate to differentiate between each other? Well, the answer is not that straightforward. The two concepts of WTP and elasticity of demand are very related but not the same. WTP is useful to measure each customer. For example, high earning population has a high threshold to spend while low earnings can have a low threshold. Willingness to buy is the highest valuation in terms of money placed on a good or service by an individual — what is the highest absolute amount one would be willing to pay?
Price elasticity of demand is the responsiveness of the quantity demanded of a good in relation to its own price, e.g. as price increases how much does the quantity purchased decrease?

Dynamic Pricing at ride-hailing services

Demand to Supply ratios | source: Ride-hailing dynamic pricing

Ride-hailing services suffer through a major challenge of frequently changing supply and demand. For example, San Fransisco Sunset district observes high demand during the morning while the Financial district observes high demand during the evening since people mostly stay in the Sunset district and travel for work in the morning while people travel back home from the financial district in the evening. To mitigate such imbalance, dynamic pricing (DP) is employed by ride-hailing platforms to balance supply and demand both temporally and spatially. Uber refers to its DP decisions as surge multipliers, meaning that when demand is very high relative to supply the base fare is multiplied by a multiplier that is greater than one. There are several goals that ride-hailing platforms need to optimize for such as minimizing rider’s waiting time and driver's dispatch time, maximizing ride acceptance rate, maximizing booking rate, maximizing business margin, and maximizing revenue. Let’s start with a basic Machine Learning + Operations Research Framework. Obviously, Uber’s/Lyft's dynamic pricing algorithms are propriety, but the below framework should still give some basics about optimizing for the best price while satisfying the above goals.

Let’s assume we have data on riders, drivers, trips, and seasonality, we can devise the below models:

  1. Trip Cost Model — Average cost model that predicts the cost of each trip based on various economic factors, gas price, the shortest distance, events, traffic, etc..
  2. User’s WTP model — User price sensitivity model for predicting the demand curve based on user demographics, number of users looking for a ride, source location, source destination, etc..
  3. Driver’s acceptance model — Driver acceptance model for predicting the supply curve based on available drivers, car model, prior acceptance, shift duration, miles driven during the shift, etc..

My next blog will cover each model in detail followed by an optimization maximizing business goals, minimizing wait time, maximizing driver's profitability, and deriving Surge multiplier!

Cite:

@article{dkatariya2023DynamicPricing,
title={Dynamic Pricing with Machine Learning},
author={Katariya, Dwipam},
journal={Medium, Analytics Vidya},
volume={3},
year={2023}
}

References:

Dynamic Pricing: How Pricing Optimization And Revenue Management Benefit From Machine Learning at https://www.width.ai/post/dynamic-pricing-price-optimization

Katariya, D. (2021). What length of dependencies can LSTM & T-CNN really remember?. Medium, Towards Data Science, 3.

Katariya, D. (2020). Learning from Multimodal Target. Medium, Towards Data Science, 4.

Price elasticity of Demand: By Patrick L. Anderson, Richard D. McLellan, Joseph P. Overton, and Dr. Gary L. Wolfram | Nov. 13, 1997https://lindseyresearch.com/wp-content/uploads/2021/12/NHTSA-2021-0053-1575-Exhibit-44-Anderson-1997.pdf

Yan, Chiwei & Zhu, Helin & Korolko, Nikita & Woodard, Dawn. (2019). Dynamic pricing and matching in ride‐hailing platforms. Naval Research Logistics (NRL). 67. 10.1002/nav.21872.

--

--