---
id: wiki-2026-0508-dynamic-pricing-offers
title: Dynamic Pricing & Offers
category: 10_Wiki/Topics
status: verified
canonical_id: self
aliases: [dynamic pricing, surge pricing, demand pricing, personalized offer, price optimization]
duplicate_of: none
source_trust_level: A
confidence_score: 0.92
verification_status: applied
tags: [pricing, dynamic-pricing, optimization, ml, revenue, demand, ecommerce]
raw_sources: []
last_reinforced: 2026-05-10
github_commit: pending
tech_stack:
  language: Python
  framework: scikit-learn / XGBoost / OR-Tools
---

# Dynamic Pricing & Offers

## 매 한 줄
> **"매 supply / demand / inventory / context 의 real-time 의 price 의 adjust"**. 매 Uber surge, 매 airline yield, 매 hotel revenue management. 매 modern: 매 ML + RL + causal inference. 매 ethical: 매 fairness + 매 backlash.

## 매 핵심

### 매 method
- **Rule-based**: 매 demand-tier.
- **Elasticity model**: 매 price-demand curve.
- **MAB / bandit**: 매 explore.
- **RL**: 매 long-horizon reward.
- **Causal**: 매 price 의 effect 의 estimate.

### 매 famous
- **Uber surge**: 매 multiplier.
- **Airline yield**: 매 fare class + restriction.
- **Hotel RM**: 매 occupancy + LOS.
- **Amazon**: 매 millions / day price change.
- **Ticketmaster**: 매 dynamic event.

### 매 ethical / risk
- **Backlash**: 매 ride 의 surge during emergency.
- **Discrimination**: 매 protected attribute 의 proxy.
- **Trust erosion**: 매 frequent change 의 detect.
- **Regulation**: 매 EU price personalization disclosure.

### 매 응용
1. **Ride-hailing**: 매 surge.
2. **Travel**: 매 yield management.
3. **Retail**: 매 markdown.
4. **Energy**: 매 time-of-use.
5. **Subscription**: 매 win-back offer.
6. **Gaming**: 매 IAP discount.

## 💻 패턴

### Price elasticity estimation
```python
import numpy as np
from sklearn.linear_model import LinearRegression

# 매 log-log: log(Q) = a + b * log(P) + ε
def estimate_elasticity(prices, quantities):
    log_p = np.log(prices).reshape(-1, 1)
    log_q = np.log(quantities)
    model = LinearRegression().fit(log_p, log_q)
    elasticity = model.coef_[0]  # 매 typically negative
    return elasticity
```

### Optimal price (revenue maximize)
```python
def optimal_price(cost, base_demand, elasticity, p_min, p_max):
    """매 max revenue: 매 (p - c) * Q(p)."""
    def revenue(p):
        q = base_demand * (p / p_min) ** elasticity
        return (p - cost) * q
    
    from scipy.optimize import minimize_scalar
    result = minimize_scalar(lambda p: -revenue(p), bounds=(p_min, p_max), method='bounded')
    return result.x
```

### Surge multiplier (Uber-style)
```python
def surge_multiplier(active_drivers, pending_requests):
    ratio = pending_requests / max(active_drivers, 1)
    if ratio < 0.5: return 1.0
    elif ratio < 1.0: return 1.2
    elif ratio < 2.0: return 1.5
    elif ratio < 3.0: return 2.0
    else: return min(3.0, 1.0 + ratio * 0.5)
```

### Yield management (hotel)
```python
class YieldManager:
    def __init__(self, total_rooms, days_to_event):
        self.total = total_rooms
        self.dte = days_to_event
        self.booked = 0
    
    def price(self, base_price, demand_signal):
        occupancy = self.booked / self.total
        proximity = max(0, 1 - self.dte / 30)  # 매 closer → urgency
        
        multi = 1 + 0.5 * occupancy + 0.3 * proximity + 0.2 * demand_signal
        return base_price * multi
```

### Contextual bandit price
```python
class PriceBandit:
    def __init__(self, price_options):
        self.prices = price_options
        self.alpha = np.ones(len(price_options))
        self.beta = np.ones(len(price_options))
    
    def select(self, context):
        # 매 Thompson sample
        samples = np.random.beta(self.alpha, self.beta)
        return self.prices[np.argmax(samples)]
    
    def update(self, price_idx, purchased):
        if purchased: self.alpha[price_idx] += 1
        else: self.beta[price_idx] += 1
```

### Personalized offer
```python
def personalized_discount(user, base_price, cost):
    """매 user lifetime value 의 discount 의 fund."""
    ltv = predict_ltv(user)
    sensitivity = predict_price_sensitivity(user)
    
    if sensitivity > 0.8 and ltv > base_price * 5:
        # 매 churn risk + valuable → 매 deep discount
        return base_price * 0.7
    elif sensitivity > 0.5:
        return base_price * 0.9
    return base_price
```

### Win-back offer
```python
def winback_offer(user):
    if user.last_active_days_ago < 30: return None
    if user.churn_score > 0.7:
        return {
            'type': 'discount',
            'value': 0.5,
            'expires': now() + timedelta(days=7),
            'urgency': 'high',
        }
    return None
```

### Causal effect of price (DoWhy)
```python
import dowhy
def estimate_price_causal_effect(df):
    model = dowhy.CausalModel(
        data=df,
        treatment='price',
        outcome='purchased',
        common_causes=['user_segment', 'season', 'inventory'],
    )
    estimand = model.identify_effect()
    estimate = model.estimate_effect(estimand, method_name='backdoor.linear_regression')
    return estimate.value  # 매 price 의 1 unit 의 purchase 의 marginal effect
```

### Anti-discrimination check
```python
def fairness_audit(prices_by_segment):
    """매 protected attribute 의 disparate pricing."""
    grouped = prices_by_segment.groupby('protected_attr')['price']
    means = grouped.mean()
    if (means.max() - means.min()) / means.mean() > 0.05:
        return 'WARN: >5% pricing disparity by protected attribute'
    return 'OK'
```

### Inventory-aware (markdown)
```python
def markdown(item, days_remaining, inventory):
    """매 perishable / seasonal 의 markdown."""
    if days_remaining < 7:
        if inventory > 50: return 0.5
        elif inventory > 20: return 0.7
        else: return 0.9
    return 1.0
```

### A/B testing dynamic pricing
```python
def split_test(user_id):
    bucket = hash(user_id) % 100
    if bucket < 50: return 'control', static_price
    elif bucket < 75: return 'A', dynamic_price_v1
    else: return 'B', dynamic_price_v2
```

## 매 결정 기준
| 상황 | Approach |
|---|---|
| Real-time supply/demand | Surge multiplier |
| Long-horizon | Yield management |
| Few price tiers | Bandit |
| Continuous price | Elasticity model + optimize |
| Personalization | Bandit + user features |
| High-stakes | Causal estimation |

**기본값**: 매 elasticity model + 매 inventory-aware + 매 personalization (LTV) + 매 fairness audit + 매 A/B.

## 🔗 Graph
- 변형: [[Surge-Pricing]]
- 응용: [[Causal-Inference]] · [[Multi-Armed-Bandit]] · [[Reinforcement-Learning]]
- Adjacent: [[E-commerce-Optimization]] · [[Dynamic-Creative-Optimization]]

## 🤖 LLM 활용
**언제**: 매 inventory perishable. 매 demand variable. 매 personalization.
**언제 X**: 매 regulated commodity. 매 trust-critical (medication).

## ❌ 안티패턴
- **No fairness audit**: 매 discrimination.
- **No inventory awareness**: 매 stockout / waste.
- **Surge without cap**: 매 emergency price gouge.
- **No experimentation**: 매 elasticity 의 stale.
- **Personalize without disclosure**: 매 EU compliance.

## 🧪 검증 / 중복
- Verified (Pricing literature, Uber/Amazon engineering posts).
- 신뢰도 A.

## 🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — pricing + 매 elasticity / surge / yield / bandit / fairness code |
