In-App Purchase Tier Optimization and Price Elasticity Modeler
Generates a Python script modeling price elasticity and Bayesian revenue outcomes for in-app purchase tier migrations across app stores.
Use this template when planning price changes or foreign currency adjustments across global app stores. It delivers a mathematically rigorous modeling script to simulate revenue impact before altering live in-app purchase tiers.
Role: Principal App Store Monetization Engineer & Quantitative Analyst
Context
- Target App Identifier: {{target_app_id}}
- Historical Transaction Dataset: {{historical_iap_csv}}
- Global Currency FX & Purchasing Power Parity Matrix: {{currency_matrix_json}}
- Prior Elasticity Mean Estimate: {{elasticity_prior_mean}}
- Statistical Confidence Threshold: {{confidence_threshold}}
- Target App Store Platforms: {{target_store_platforms}}
Task
Develop a modular, production-ready Python script that analyzes historical store transactions, estimates price elasticity of demand via empirical Bayesian regression across localized storefronts, and computes revenue-maximizing price point allocations for {{target_app_id}} across {{target_store_platforms}}.
Method
- Ingest transaction logs from {{historical_iap_csv}} and validate categorical schemas across {{target_store_platforms}}.
- Normalize multi-currency historical transactions using {{currency_matrix_json}} to decouple currency fluctuation from demand shifts.
- Implement a log-log demand regression model incorporating {{elasticity_prior_mean}} as a Bayesian prior.
- Compute price elasticity coefficients (epsilon) per localized storefront with uncertainty intervals at {{confidence_threshold}}.
- Map continuous optimal price curves to discrete Apple App Store / Google Play tier matrix increments.
- Simulate net revenue variations factoring in platform commission tiers (15% small business vs 30% standard).
- Output synthetic validation tests and a structured CLI execution harness with parameter logging.
Constraints
- MUST output runnable Python 3.10+ code using NumPy, SciPy, and Pandas without pseudo-code placeholders.
- MUST NOT hardcode currency conversion rates; all FX mappings must ingest from {{currency_matrix_json}}.
- Elasticity calculations MUST reject sample cohorts below statistical significance at {{confidence_threshold}}.
- Error handling MUST catch zero-variance pricing windows and log mathematical boundary warnings.
Output format
Executable Python script organized as follows:
- Header docstring with mathematical definitions and input expectations
- Imports and configuration dataclasses
- Core analytics classes (DataCleaner, ElasticityModeler, TierOptimizer)
- CLI entrypoint (
if __name__ == '__main__':) accepting runtime arguments - Formatted markdown execution guide appended as a concluding comment block
Self-review
- Ensure Bayesian prior calculations avoid matrix singularity issues during inversion.
- Verify discrete tier mapping strictly adheres to standard App Store pricing brackets.
- Confirm all {{target_store_platforms}} commission logic branches are mathematically sound.
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.