quaquel/EMAworkbench

Speed up onboarding time for new users by at least one order of magnitude

Opened this issue · 2 comments

Motivation

Currently, it takes many new users a lot of time to:

  • Understand the value of the EMAworkbench
  • Grasp the concepts behind it

This is not ideal. Many (potential) users will unnecessarily find it "hard". Some don't see the value directly. Some have difficulty pitching it to their peers, stakeholders or bosses. While the math and fine details maybe are, at least the general ideas and concept don't have to be.

Goal

The goals is to speed up both understanding the value and grasping the concepts by at least an order of magnitude. This means for value and concepts respectively, going down from hours and days respectively to minutes and hours.*

The goals explicitly is not to allow users to learn the full workbench in hours. Just the value it can offer and the main ideas behind it, so it provides motivation to continue on it and a framework from which to start thinking on. See it as a really good introduction (which can be the foundation on which you build further and deeper knowledge).

* of course this is very hard to measure, and that also isn't the goal. An inverse case of Goodhart's Law.

Potential solutions

I have two ideas to enable this:

  • An extremely intuitive example. If you can feel the problem intuitive, you don't have to spend time about thinking about the problem, and can fully focus on seeing what the workbench enables you to do with a problem you already know by hearth.
  • Visual learning. Let's try to leverage it with some really strong animations.

This could be in the form of a quick demonstation in the Readme (for the value) and a tutorial notebook for the concepts.

Rough storyline that can be used for both a demo (with animations etc.) and a tutorial notebook:

The Lemonade Stand 🍋

Welcome to the journey of running your very own lemonade stand! In this adventure, you're not just selling lemonade; you're making smart decisions to maximize your sales and learn the art of running a business under uncertain conditions. The weather changes, customer preferences vary, and you need to decide not only when to sell but also how to price your lemonade and whether to spend money on signs or advertisements. Let's dive into how we can use smart tools to navigate these challenges and make your lemonade stand a neighborhood hit!

Foundational Concepts

Uncertainty Characterization: Our first step is to map out what we don't know. Will tomorrow be sunny or rainy? Do people prefer lemonade more on weekends? We list these uncertainties to prepare for different possibilities.

Adaptive Policymaking: As we gather more information (like noticing more sales on sunny days), we change our strategies. Maybe we decide to sell only on sunny weekends or lower our prices on slow days to attract more customers.

Exploring the Scenario Space

Open Exploration: Imagine drawing a big map of "what could happen" with your lemonade stand. On one side, you have sunny, hot days, and on the other, chilly, rainy afternoons. You add markers for special events like a local fair or a sports game, considering how each scenario could impact your sales.

Scenario Discovery: With tools like PRIM, we can sift through our map to find the most important factors for success. Maybe we discover that our best sales happen on hot days near the park. Subspace partitioning could reveal that lowering prices slightly on these days boosts sales even more.

Global Sensitivity Analysis: This helps us understand which factors—like weather, day, pricing, or marketing efforts—most influence our sales. This way, we can focus on what really matters.

Optimization under Uncertainty

With insights from our exploration, we strategize on opening hours, pricing, and marketing, considering the trade-offs involved.

Trade-off Analysis: We examine how different strategies—like higher prices versus more advertising—impact our goals of maximizing profit, minimizing costs, and having free time.

  • Many Objective Optimization (MOEA): We use algorithms to find the best balance between these goals, exploring many strategies to see which ones work best across different scenarios.

  • Many Objective Robust Decision Making (MORDM): This approach helps us choose strategies that perform well under a variety of future conditions, ensuring we're prepared for whatever comes our way.

  • Many Objective Robust Optimization (MORO): Focusing on robustness, we find strategies that offer the best chances of success, no matter what uncertainties we face, like sudden weather changes or unexpected events.

Detailed Strategy Suggestions

  • Pricing: Start with a standard price but be ready to offer special deals on slow days or when you have a lot of competition. Use sensitivity analysis to find the price point that maximizes profit without driving away customers.

  • Marketing: Consider simple signs on high-traffic days and a small ad in the local community newsletter for special events. Scenario exploration can help you decide how much to spend on marketing for the best return on investment.

  • Sales Tactics: Offer a "frequent buyer" card or discounts for large orders to encourage more sales. Use scenario discovery to identify which tactics lure in the neighborhood crowd.

Summary/Conclusion

Running a lemonade stand in the face of uncertainty can be a fun and enlightening experience. By characterizing uncertainties, adapting policies based on what we learn, exploring various scenarios, and optimizing our decisions to balance multiple objectives, we set our lemonade stand up for success. This adventure teaches us the importance of flexibility, strategic planning, and the art of making decisions with incomplete information. Armed with these tools and strategies, your lemonade stand is not just a summer activity but a masterclass in business under uncertainty. With the right approach, you'll not only quench the neighborhood's thirst but also achieve your goals, learning valuable lessons in decision-making along the way.

Only thing I maybe don't like about it that's a bit more "business" than "policy". But a lot of people might find business intuitive, so that might also be a strength, especially if we follow up with a policy example.


The model behind it could look like this:

import random

def simulate_lemonade_stand(weather, day, price, marketing_spend, hours_open, lemon_cost, special_event=False):
    """
    Simulates a day at the lemonade stand, considering various factors including time spent and lemon cost.
    
    Parameters:
    - weather: 'sunny', 'cloudy', or 'rainy'
    - day: 'weekday' or 'weekend'
    - price: Price per cup of lemonade
    - marketing_spend: Money spent on marketing that day
    - hours_open: Hours the lemonade stand is open
    - lemon_cost: Cost per lemon (uncertain variable)
    - special_event: Boolean indicating if there's a special event nearby
    
    Returns:
    - sales: Number of lemonade cups sold
    - profit: Net profit for the day
    - time_spent: Total time spent operating the stand
    """
    # Base demand model
    base_demand = 50 if weather == 'sunny' else 30 if weather == 'cloudy' else 10
    
    # Adjust demand for weekend, special events, and hours open
    if day == 'weekend':
        base_demand *= 1.5
    if special_event:
        base_demand *= 2
    base_demand *= (hours_open / 8)  # Assume max demand if open 8 hours
    
    # Influence of marketing spend (logarithmic growth)
    marketing_effectiveness = 10 * (1 - 1 / (1 + marketing_spend / 50))
    
    # Adjust demand for price (demand decreases as price increases, but not linearly)
    price_sensitivity = 50 - (price - 1) ** 2 if price < 5 else 20 - (price - 5)
    price_sensitivity = max(0, price_sensitivity)
    
    # Calculate final demand
    final_demand = base_demand + marketing_effectiveness + price_sensitivity
    
    # Calculate sales and profit
    sales = int(final_demand)
    cost_per_cup = 0.5 + lemon_cost  # Adjusted cost to include lemon cost
    profit = sales * (price - cost_per_cup) - marketing_spend
    
    # Time spent at the stand
    time_spent = hours_open
    
    return sales, profit, time_spent

# Example simulation with uncertain lemon cost
weather = random.choice(['sunny', 'cloudy', 'rainy'])
day = random.choice(['weekday', 'weekend'])
price = round(random.uniform(1, 5), 2)
marketing_spend = random.randint(0, 100)
hours_open = random.randint(4, 8)  # Assume the stand can be open between 4 to 8 hours
lemon_cost = round(random.uniform(0.1, 0.5), 2)  # Uncertain purchase price of lemons
special_event = random.choice([True, False])

sales, profit, time_spent = simulate_lemonade_stand(weather, day, price, marketing_spend, hours_open, lemon_cost, special_event)
print(f"Weather: {weather}, Day: {day}, Price: ${price}, Marketing Spend: ${marketing_spend}, Hours Open: {hours_open}, Lemon Cost: ${lemon_cost}, Special Event: {special_event}")
print(f"Sales: {sales} cups, Profit: ${profit:.2f}, Time Spent: {time_spent} hours")