algo-price-elasticity
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePrice Elasticity of Demand
需求价格弹性
Overview
概述
Price elasticity measures the percentage change in quantity demanded for a 1% change in price. Ed = %ΔQ / %ΔP. |Ed| > 1 = elastic (price-sensitive), |Ed| < 1 = inelastic (price-insensitive). Critical for pricing decisions and revenue optimization.
价格弹性衡量的是价格每变化1%时,需求量的百分比变化。公式为Ed = %ΔQ / %ΔP。|Ed| > 1表示需求富有弹性(对价格敏感),|Ed| < 1表示需求缺乏弹性(对价格不敏感)。这一指标对于定价决策和收入优化至关重要。
When to Use
适用场景
Trigger conditions:
- Estimating how a price change will affect unit sales and revenue
- Determining if demand is elastic or inelastic for a product
- Optimizing price for maximum revenue or profit
When NOT to use:
- When you need consumer willingness-to-pay distribution (use Van Westendorp or conjoint)
- When pricing multiple products together (use bundle pricing)
触发条件:
- 估算价格变化对单位销量和收入的影响
- 判断某产品的需求是富有弹性还是缺乏弹性
- 优化价格以实现收入或利润最大化
不适用场景:
- 需要了解消费者支付意愿分布时(应使用Van Westendorp模型或联合分析法)
- 对多产品组合定价时(应使用捆绑定价策略)
Algorithm
算法
IRON LAW: Elasticity Is NOT Constant Along a Linear Demand Curve
It varies at every price point. At high prices, demand is elastic
(small price increase → big volume drop). At low prices, demand is
inelastic. Always calculate at the SPECIFIC price point of interest.
Revenue-maximizing price is where Ed = -1 (unit elastic).IRON LAW: Elasticity Is NOT Constant Along a Linear Demand Curve
It varies at every price point. At high prices, demand is elastic
(small price increase → big volume drop). At low prices, demand is
inelastic. Always calculate at the SPECIFIC price point of interest.
Revenue-maximizing price is where Ed = -1 (unit elastic).Phase 1: Input Validation
阶段1:输入验证
Collect: price-quantity pairs over time (or across markets). Control for: seasonality, promotions, competitor actions, other confounders.
Gate: Minimum 10 price-quantity observations, confounders identified.
收集:不同时间(或不同市场)的价格-销量数据对。需控制以下变量:季节性、促销活动、竞品动作及其他干扰因素。
准入条件: 至少10组价格-销量观测数据,且已识别所有干扰因素。
Phase 2: Core Algorithm
阶段2:核心算法
Point elasticity: Ed = (dQ/dP) × (P/Q) at a specific price point
Arc elasticity: Ed = ((Q₂-Q₁)/((Q₂+Q₁)/2)) / ((P₂-P₁)/((P₂+P₁)/2)) between two points
Regression method: log(Q) = α + β×log(P) + controls → β is the elasticity (constant elasticity model)
点弹性: Ed = (dQ/dP) × (P/Q),针对特定价格点计算
弧弹性: Ed = ((Q₂-Q₁)/((Q₂+Q₁)/2)) / ((P₂-P₁)/((P₂+P₁)/2)),计算两个价格点之间的弹性
回归法: log(Q) = α + β×log(P) + 控制变量 → β即为弹性值(恒定弹性模型)
Phase 3: Verification
阶段3:验证
Check: sign should be negative (price up → quantity down). Cross-validate with holdout periods.
Gate: Elasticity is negative, confidence interval is reasonable.
检查:弹性值应为负数(价格上升→需求量下降)。使用留存期数据进行交叉验证。
准入条件: 弹性值为负,且置信区间合理。
Phase 4: Output
阶段4:输出
Return elasticity estimate with revenue impact projection.
返回弹性估算值及收入影响预测结果。
Output Format
输出格式
json
{
"elasticity": -1.5,
"interpretation": "elastic — 1% price increase → 1.5% quantity decrease",
"revenue_impact": {"price_change_pct": 10, "quantity_change_pct": -15, "revenue_change_pct": -6.5},
"metadata": {"method": "log-log regression", "r_squared": 0.82, "observations": 52}
}json
{
"elasticity": -1.5,
"interpretation": "elastic — 1% price increase → 1.5% quantity decrease",
"revenue_impact": {"price_change_pct": 10, "quantity_change_pct": -15, "revenue_change_pct": -6.5},
"metadata": {"method": "log-log regression", "r_squared": 0.82, "observations": 52}
}Examples
示例
Sample I/O
输入输出样例
Input: Price increased 10% from $100 to $110, quantity dropped from 1000 to 850
Expected: Arc elasticity = ((-150/925) / (10/105)) = -1.70 (elastic)
输入: 价格从100美元上涨10%至110美元,销量从1000降至850
预期结果: 弧弹性 = ((-150/925) / (10/105)) = -1.70(富有弹性)
Edge Cases
边缘情况
| Input | Expected | Why |
|---|---|---|
| Luxury good | May be positive (Veblen) | Higher price → higher perceived value |
| Necessity (insulin) | Near zero | Demand barely responds to price |
| Perfect substitute available | Very elastic (< -3) | Customers switch immediately |
| 输入 | 预期结果 | 原因 |
|---|---|---|
| 奢侈品 | 弹性可能为正(凡勃伦商品) | 价格越高,感知价值越高 |
| 必需品(如胰岛素) | 弹性接近0 | 需求几乎不随价格变化 |
| 存在完美替代品 | 弹性极高(< -3) | 客户会立即转向替代产品 |
Gotchas
注意事项
- Omitted variable bias: Without controlling for advertising, seasonality, and competitor prices, elasticity estimates are biased.
- Short-run vs long-run: Short-run elasticity is typically lower (customers are locked in). Long-run gives them time to find substitutes.
- Cross-price elasticity: Demand for product A may depend on product B's price. Ignoring this in a portfolio context leads to suboptimal pricing.
- Asymmetric elasticity: Consumers may react differently to price increases vs decreases. Don't assume symmetry.
- Small sample noise: With few observations, elasticity estimates have wide confidence intervals. Report intervals, not just point estimates.
- 遗漏变量偏差: 若未控制广告、季节性和竞品价格等因素,弹性估算结果会存在偏差。
- 短期vs长期: 短期弹性通常较低(客户被锁定),长期弹性会让客户有时间寻找替代品。
- 交叉价格弹性: 产品A的需求可能受产品B价格影响。在组合定价场景中忽略这一点会导致次优定价。
- 非对称弹性: 消费者对涨价和降价的反应可能不同,切勿假设弹性对称。
- 小样本噪声: 观测数据过少时,弹性估算的置信区间会很宽。应报告区间而非仅点估算值。
Scripts
脚本
| Script | Description | Usage |
|---|---|---|
| Compute arc elasticity and revenue impact | |
Run to execute built-in sanity tests.
python scripts/arc_elasticity.py --verify| 脚本 | 描述 | 使用方式 |
|---|---|---|
| 计算弧弹性及收入影响 | |
运行 可执行内置的合理性测试。
python scripts/arc_elasticity.py --verifyReferences
参考资料
- For regression-based elasticity estimation, see
references/regression-estimation.md - For cross-price elasticity analysis, see
references/cross-price.md
- 基于回归的弹性估算方法,请参阅
references/regression-estimation.md - 交叉价格弹性分析,请参阅
references/cross-price.md