AI Hints
Home›Data Science Tutorial›Deciding Under Uncertainty
Data Science · Lesson 52 of 101

What Matters Most?

Sensitivity analysis.

⏱ 2 min read▶ Video at 1:29:14🎓 Free
Watch this lesson in the Data Science courseWatch on YouTube ↗Full Data Science course

You've got ten uncertain numbers in your plan, and just one week to research them. Which should you investigate? Most people pick the ones that are easiest to find out. But they should pick the ones that change the answer the most.

What Matters Most?
From the video: What Matters Most?
  • Ten uncertain numbers
  • One week to research
  • Pick what changes the answer

Swinging one number at a time

We take a simple profit function. Then we change one input at a time, from its low value to its high value, and leave the rest alone. And we sort by how much the result swings. Run it. Visitors matter most, with a swing of about ninety seven thousand dollars. Rent matters least, at forty thousand, even though the team spent weeks negotiating over it. Now you know where to spend your research week. Go and count footfall at the location. Drawn as a chart, this is called a tornado diagram, and it's one of the most useful charts in business.

tornado.pypython
def profit(visitors=90000, spend=5.2, margin=.62, rent=130000):
    return visitors * spend * margin - rent

base = profit()
tests = {"visitors": (75000, 105000), "spend": (4.5, 5.9), "margin": (.56, .68), "rent": (110000, 150000)}

rows = []
for name, (low, high) in tests.items():
    a, b = profit(**{name: low}), profit(**{name: high})
    rows.append((abs(b - a), name, a, b))

print(f"Base: ${base:,.0f}")
for swing, name, a, b in sorted(rows, reverse=True):
    print(f"{name:<9} ${a:>9,.0f} to ${b:>9,.0f}  swing ${swing:,.0f}")
Output
Base: $160,160
visitors  $  111,800 to $  208,520  swing $96,720
spend     $  121,100 to $  199,220  swing $78,120
margin    $  132,080 to $  188,240  swing $56,160
rent      $  180,160 to $  140,160  swing $40,000

Summary

Spend your effort on what moves the answer. Next, a question that every investor asks.

Key takeaways
  • Change one input at a time
  • Sort by the swing
  • Research what matters most
Next up: Payback Time — when does a customer pay off?