price-demand-optimization
Skill1 starsChanged 7 months agoMITView on GitHub
Optimizes unit prices, segmented pricing, non-linear pricing (two-part tariffs, bundling), dynamic markdowns, and capacity allocation (EMSR) for revenue management. Use when asked to: find the optimal price, model demand elasticity, design discount structures, plan markdown schedules for perishable inventory, allocate fare class capacity, or optimize bundle pricing. Also trigger when someone says "price optimization", "demand elasticity", "markdown schedule", "clearance sale pricing", "fare class allocation", "EMSR", "two-part tariff", "bundling strategy", "price segmentation", "willingness to pay", "revenue management", "dynamic pricing", "stockout price", or "Littlewood rule". Always renders inline HTML dashboard as primary output. Includes marketer NBA and benchmarks.
In this repository35 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- agency-request-intake-routerSkill
- analyzing-marketing-campaignSkill
- audience-segmentation-briefSkill
- campaign-launch-qaSkill
- change-order-generatorSkill
- client-memory-synthesizerSkill
- creative-supply-plannerSkill
- crm-journey-architectSkill
- customer-lifetime-valueSkill
- customer-segmentation-clusteringSkill
- data-intake-normalizerSkill
- executive-growth-memoSkill
- fte-capacity-sizingSkill
- margin-simulationSkill
- market-basket-analysisSkill
- measurement-incrementalitySkill
- media-procurement-benchmarkSkill
- media-routing-plannerSkill
- mmm-modelingSkill
- performance-diagnosisSkill
- ppa-assortment-diagnosisSkill
- ppa-continuous-optimizationSkill
- ppa-financial-modelSkill
- ppa-pack-size-leverageSkill
- ppa-value-perceptionSkill
- price-elasticity-modelingSkill
- price-threshold-detectionSkill
- qbr-generatorSkill
- recommender-systemsSkill
- response-uplift-modelingSkill
- rfp-submissionSkill
- scope-auditSkill
- survival-analysis-marketingSkill
- weekly-control-towerSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 38
Every single price leaves money on the table — customers who would pay more, and customers who won't buy at this price but would at a lower …
- Distinctive: line 230
Always produce 5–6 specific, actionable recommendations:
- Distinctive: line 259
Bundling requires negative correlation: If WTP for A and B are positively correlated, bundling does not help (Fig.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Price & Demand Optimization
Revenue optimization across five method families: demand modeling → unit price → segmentation → dynamic markdowns → capacity allocation (EMSR). Always outputs dashboard + marketer NBA.
Plain Language: What This Does
"How should I price this product?" → Unit price optimization (§6.5.1)
"Should I offer student/senior discounts?" → Market segmentation (§6.5.2)
"Subscription + per-use fee?" → Two-part tariff (§6.5.3)
"Bundle products A and B?" → Bundling optimization (§6.5.4)
"Plan a 4-week clearance sale?" → Markdown LP (§6.7.2.2)
"How many business vs economy seats?" → EMSR (§6.8)The core insight (Katsov §6.5.2): Every single price leaves money on the table — customers who would pay more, and customers who won't buy at this price but would at a lower one. Segmentation captures both.
Core Equations (Katsov Ch. 6)
Demand Models (§6.4)
# Linear demand (uniform WTP, eq. 6.11):
q(p) = Qmax * (1 - p/P)
# Constant-elasticity (eq. 6.13):
q(p) = C * p^{-ε} # ε = price elasticity
# Logit demand (eq. 6.15):
q(p) = Qmax / (1 + exp(a + b*p)) # S-curve, max sensitivity at -a/b
# Elasticity definition (eq. 6.9):
ε = -(p/q) * dq/dpUnit Price Optimization (§6.5.1)
# Optimal price, linear demand (eq. 6.24):
p_opt = (P + V) / 2 # average of max WTP and variable cost
# Optimal price, constant-elasticity (eq. 6.28):
p_opt = V * ε / (ε - 1) # requires ε > 1
# Optimal profit (eq. 6.26):
G_opt = Qmax * (P - V)² / (4P)Market Segmentation — n Segments (§6.5.2)
# Optimal price for segment i (eq. 6.34):
p_i* = [(n+1-i)*P + i*V] / (n+1) # equally spaced between P and V
# Optimal segmented profit (eq. 6.35):
G_opt = Qmax * n*(P-V)² / [2*(n+1)*P] # → Gmax as n → ∞Two-Part Tariff (§6.5.3)
# Homogeneous demand — optimal metered price (eq. 6.40):
p_m* = V # set metered price to marginal cost
# Entrance fee = consumer surplus under demand curve (eq. 6.37):
p_e* = Qmax * (P - p_m)² / (2P)
# Heterogeneous demand — adjusted metered price (eq. 6.44):
p_m* = V + P * (E[k] - 1) # E[k] = weighted avg demand multiplierMarkdown LP — Perishable Inventory (§6.7.2.2)
maximize Σ_t Σ_i z_it * P_i * q(P_i, t)
subject to Σ_t Σ_i z_it * q(P_i, t) ≤ C [capacity]
Σ_i z_it = 1 for each t [one price per period]
z_it ≥ 0EMSR Heuristics (§6.8.4)
# Littlewood's rule — two classes (eq. 6.104):
y_opt = F1_inv(1 - p2/p1) # protect y units for class 1
# EMSRa (eq. 6.112–6.113):
y_j = Σ_{k=1}^{j} y_{j+1}^(k) # sum of pairwise Littlewood levels
# EMSRb (eq. 6.114–6.116):
Q_j_agg = Σ_{k=1}^{j} Q_k # aggregate demand
p_j_agg = Σ p_k*E[Q_k] / Σ E[Q_k] # weighted avg price
y_j from: p_{j+1} = p_j_agg * Pr(Q_j_agg ≥ y_j)Algorithm Selection
| Scenario | Method | Script |
| Single price, estimate P and V | Unit price optimizer | price_unit_optimizer.py |
| Multiple customer segments | Segmented pricing | price_segmentation.py |
| Subscription + per-unit billing | Two-part tariff | two_part_tariff.py |
| Bundle two+ products | Bundle optimizer | bundling_optimization.py |
| Clearance / seasonal markdown | Markdown LP | markdown_linear_program.py |
| Airline/hotel fare classes | EMSR-a & EMSR-b | emsra.py / emsrb.py |
| Competing products | Joint pricing | competing_products_optim.py |
| Fit demand curve to data | Demand model fitting | demand_logit.py |
Workflow
Step 1 — Fit Demand Model
python scripts/demand_logit.py \
--price-data data/price_volume.csv \
--output results/demand_params.jsonOutput: fitted Qmax, a, b (logit) or P, elasticity (linear/const-elasticity).
Step 2 — Run Price Optimizer
# Unit price
python scripts/price_unit_optimizer.py \
--P 100 --V 10 --Qmax 1000 --output results/unit_price.json
# Segmented (n=3 segments)
python scripts/price_segmentation.py \
--P 100 --V 10 --Qmax 1000 --n-segments 3 \
--output results/segmented_price.jsonStep 3 — Markdown Schedule (perishable inventory)
python scripts/markdown_linear_program.py \
--demand-params results/demand_params.json \
--capacity 700 \
--price-levels "89,79,69,59,49" \
--weeks 4 \
--output results/markdown_schedule.jsonStep 4 — EMSR (airline/hotel)
python scripts/emsrb.py \
--fares "300,200,100" \
--demand-means "8,12,20" \
--demand-stds "2,3,5" \
--capacity 20 \
--output results/emsr_protection_levels.jsonStep 5 — Render Dashboard + Insights
python scripts/export_price_dashboard_json.py \
--optimizer-type markdown \
--results results/markdown_schedule.json \
--output dashboard_data.jsonOutput sequence:
1. [bash_tool] Fit demand + run optimizer
2. [web_search] Industry pricing benchmarks (elasticity, markdown lift, ARPU)
3. [bash_tool] export_price_dashboard_json.py → JSON
4. [show_widget] Dashboard: demand curve, price vs profit, markdown schedule, EMSR levels
5. [text] CMO/marketer insights + NBA (Next Best Actions)
6. [text] Caveats: elasticity uncertainty, segmentation leakage, EMSR assumptionsOutput Format — Visualization First
Primary output: inline HTML dashboard. Always render before text.
Dashboard panels (see references/price_dashboard_template.html):
- KPI bar — optimal price, expected profit, % improvement vs current price, targeting depth
- Demand curve — q(p) with optimal price marked + profit rectangle
- Segment price ladder — bar chart of n segment prices P_1..P_n
- Profit vs price — parabola showing G(p) with p_opt annotated
- Markdown schedule — weekly price plan with capacity pacing
- EMSR protection levels — stacked bar of fare class allocations
Marketer Insights Layer (MANDATORY)
Search before benchmarking
web_search: "price elasticity [industry/category] benchmark [country] [year]"
web_search: "markdown optimization retail lift revenue [year]"
web_search: "revenue management hotel airline EMSR improvement [year]"Translate Metrics to Business Language
| Technical output | Business meaning |
| p_opt = $X | "Charge $X to maximize profit — not the lowest price, not the highest" |
| n=3 segments: $74, $62, $50 | "3-tier pricing captures 75% of max possible profit vs 67% with one price" |
| Markdown wk1=$89, wk4=$49 | "Start high, end low — early buyers pay premium, clearance buyers get deal" |
| EMSR y1=7, y2=13 | "Hold 7 first-class and 13 economy seats, release discount only when 1st fills" |
| ε=2.3 | "10% price cut → 23% demand increase. Elastic market — discounts work" |
| ε=0.4 | "Even 50% price cut barely moves demand. Inelastic — don't discount" |
NBA — Next Best Actions for Marketers/CMOs
Always produce 5–6 specific, actionable recommendations:
Template (adapt to context):
- Elasticity first: "Measure your true price elasticity before optimizing — a 0.5 error in ε leads to prices ranging $21–$110 for the same product (Katsov Table 6.2)"
- Segment fences: "Perfect segmentation requires impermeable fences. Check for leakage (Table 6.3): 500 high-value customers buying the discounted tier erases all gains"
- Markdown timing: "For perishable inventory: start at stockout price, decrease evenly to variable cost (eq. 6.87). Never discount before week 2 if demand is high"
- Two-part tariff: "If you have heterogeneous usage levels, metered price > marginal cost (eq. 6.44). Subscription + overage charges beat flat pricing"
- Bundle test: "Bundling only outperforms individual pricing when WTP is negatively correlated across products (Fig. 6.13). Test with segmentation data first"
- EMSR lead time: "Open discount fares early (booking in advance = low-fare), protect high-fare capacity for late buyers. EMSR closes discounts automatically"
Connect to Business Objectives (Katsov §3.2)
| Pricing strategy | Business objective | When to use |
| Unit price optimization | Maximization — extract margin | Established product, stable demand |
| Market segmentation | Acquisition + Maximization | Heterogeneous market, strong fences |
| Dynamic markdown | Retention (clear inventory, keep loyalty) | Seasonal, fashion, perishable goods |
| Two-part tariff | Maximization — usage-based capture | SaaS, utilities, amusement parks |
| EMSR | Maximization — capacity revenue | Airlines, hotels, event tickets |
Key Caveats
- Elasticity estimation uncertainty: Small errors in ε produce huge price swings (Table 6.2). Always report confidence intervals on ε.
- Demand cannibalization: Imperfect segmentation fences leak high-value customers to lower tiers (Table 6.3). Model leakage K before committing to segmented prices.
- Markdown irreversibility: Prospect theory (§6.3.2) — customers anchor to the first price they see. Don't discount too early; it permanently lowers the reference point.
- EMSR independence assumption: EMSR assumes independent demand across fare classes. In reality, rejected low-fare customers upgrade. This inflates protection levels.
- LP relaxation: Markdown LP allows fractional prices (z_it ∈ [0,1]). Round to nearest practical price point.
- Bundling requires negative correlation: If WTP for A and B are positively correlated, bundling does not help (Fig. 6.12 vs 6.13).
Integration with Agency Growth OS
| Skill | Handoff |
audience-segmentation-brief | Segment willingness-to-pay distribution → p_i* per segment |
response-uplift-modeling | Personalized discount depth via uplift × price sensitivity |
measurement-incrementality | Price test A/B → causal estimate of elasticity |
margin-simulation | p_opt + G_opt feed P&L model |
crm-journey-architect | Markdown schedule → trigger CRM messages per pricing phase |
Reference Files
references/katsov_price_excerpts.md— Key equations §6.4–6.8 + numerical examplesreferences/model_selection_price.md— Which optimizer for which business scenarioreferences/industry_benchmarks_price.md— Elasticity ranges + markdown lift benchmarksreferences/price_dashboard_template.html— HTML dashboard; injectSKILL_DATA_JSON
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

