The user wants a Monte Carlo simulation for "cash runway."
This involves simulating future cash flows over time to see how long a company's cash lasts under uncertainty.
Key components requested:
- Distributions: What probability distributions to use for the input variables (revenue, expenses, etc.).
- Scenario Weights: How to mix different economic environments (e.g., Base, Bull, Bear cases).
- Triggers: What specific events or thresholds indicate a problem (running out of cash, breaching covenants).
Structure of the response:
- Introduction: Briefly explain the goal (probabilistic view of insolvency).
- Input Variables & Distributions: This is the core math part.
- Revenue: Lognormal is usually best (can't be negative, skewed right).
- OpEx (Operating Expenses): Normal or Triangular. Fixed vs. Variable.
- Collections/AR: Use a "Days Sales Outstanding" (DSO) shift or a probability of non-payment.
- Investments/CAPEX: Often discrete (step functions) or uniform.
- Scenario Weights (The "Metamodel"): How to handle macro scenarios.
- Don't just run one random simulation. Run three defined logic sets and weight the results.
- Approach: Define correlation matrices for variables within scenarios.
- The Simulation Logic (The "Engine"):
- Time steps (Monthly).
- Formula: Casht = Casht−1 + Inflows - Outflows.
- Triggers (The Outputs):
- Runway End: Cash ≤ 0 (or minimum buffer).
- Soft Triggers: Cash < 3 months OpEx (Caution zone).
- Covenant Breaches: EBITDA/Debt ratios (if applicable).
- Implementation (Python Example): A code snippet is essential to make this actionable. It should use
numpy and pandas.
- Visualization/Interpretation: How to read the output (histograms of runway months, percentile charts).
Drafting the Content - Section by Section:
-
Distributions:
- Revenue: Startups often fail linear, but growth is exponential-ish. Lognormal is standard for financial assets. For early stage, maybe Uniform if huge uncertainty, or PERT (Program Evaluation and Review Technique) distribution (smoothed triangular). Let's stick to Lognormal for growth, Triangular for specific cost estimates.
- Churn/Burn: Normal distribution around a budget mean is easiest, but usually costs are sticky downwards. Maybe a skewed normal.
- Critical insight: Correlation matters. If revenue drops, variable costs drop, but fixed costs stay. Need a correlation matrix.
-
Scenario Weights:
- This is distinct from just running 10,000 random iterations. The user asked for "Scenario Weights."
- Method: The "Three-Point Estimate" approach combined with Monte Carlo.
- Or: Assign probability weights to distinct macro environments (e.g., 20% Recession, 50% Normal, 30% Growth) and run simulations within those constraints.
- Let's go with: Define parameter shifts based on scenarios.
- Scenario A (Recession): Shifts mean revenue down, increases DSO.
- Scenario B (Base): Standard assumptions.
- Scenario C (Boom): High growth, high burn.
- Weighting: Calculate the aggregate PDF by summing P(Sce.
Review against constraints:
- Did I cover distributions? Yes.
- Did I cover scenario weights? Yes.
- Did I cover triggers? Yes.
- Is it actionable? Yes, code included.
Self-Correction during drafting:
- Initial thought: Just use Normal distributions for everything.
- Correction: Revenue cannot be negative. Use Lognormal or Truncated Normal.
- Initial thought: Run scenarios separately.
- Correction: Combine them into a single probabilistic view for the final "Runway Risk" chart.
Final Polish:
- Make the code readable.
- Add comments explaining the math.
- Ensure the distinction between "Variable Costs" (COGS) and "Fixed Costs" (OpEx) is clear in the model logic.
Let's write the response.
A robust Monte Carlo simulation for cash runway moves beyond simple "base case" modeling by acknowledging that financial inputs are uncertain variables, not static numbers.
Here is a framework for building a Cash Runway Monte Carlo, structured around the three pillars you requested: Distributions, Scenario Weights, and Triggers.
1. Selecting Distributions (The Inputs)
The accuracy of your simulation depends entirely on choosing probability distributions that reflect the real-world behavior of your line items.
A. Revenue (Growth & Contraction)
Do not use a standard Normal (Bell Curve) distribution for revenue. Revenue is multiplicative, not additive, and cannot go below zero.
- Best Choice: Lognormal Distribution.
- Why: It ensures values are always positive (>0) and accounts for "fat tails" (the small chance of massive viral growth or catastrophic loss).
- Parameters: Mean Growth Rate, Standard Deviation (Volatility).
- Alternative for Startups: PERT Distribution (Program Evaluation and Review Technique).
- Why: Good when you have limited data. You define a Minimum (pessimistic), Maximum (optimistic), and Most Likely (mode).
B. Operating Expenses (OpEx) & Burn
Expenses tend to be "sticky" (hard to reduce quickly) but can spike unexpectedly (hiring, marketing blitzes).
- Best Choice: Triangular Distribution.
- Why: It is intuitive. You set a Floor (base salaries), a Ceiling (base + max overtime/hiring), and a Peak (most likely spend).
- For Specific Events: Discrete Distribution.
- Use case: One-time costs (e.g., "20% chance of a 50klegalsettlement,800").
C. Accounts Receivable (Timing)
Revenue is booked, but cash is not always collected immediately.
- Best Choice: Uniform or Poisson Distribution.
- Use case: Modeling "Days Sales Outstanding" (DSO). If collections usually take 30-45 days, draw a random number from that range to lag the cash inflow.
2. Scenario Weights (The Context)
Instead of running one generic simulation, you should define distinct economic environments (Scenarios) and assign a probability weight to each. This is often called a "Mixture Model."
The Structure
You define 3 macro-scenarios and assign weights that sum to 100%.
| Scenario | Weight | Logic Applied to Variables |
|---|
| Bull Market | 20% | Revenue mean shifts up; Fundraising success probability high. |
| Base Case | 60% | Uses the standard distributions defined in Section 1. |
| Recession | 20% | Revenue mean shifts negative; Churn rates increase; AR collections lag. |
Implementation Logic
When the simulation runs (e.g., 10,000 iterations), the computer first "rolls the dice" to pick the Scenario based on weights.
- If it hits "Recession": It draws revenue from a distribution with a negative mean and draws expenses from a distribution with a 10% higher burn rate.
- If it hits "Bull": It draws revenue from a distribution with high volatility on the upside.
3. Triggers (The Outputs)
Triggers are the specific boolean flags or thresholds that turn raw data into decisions.
A. Insolvency Trigger (Hard Stop)
The mathematical definition of running out of cash.
- Definition: Casht≤0 OR Casht (e.g., $10k).
B. "Take Action" Trigger (Soft Stop)
The point where the company must cut costs or raise a bridge round to survive.
- Definition: Months_of_Runway<6 OR Cash<.
C. Covenant Breach Trigger
If you have debt, this is critical.
- Definition: QuickRatio<1.0 or EBITDA<DebtS.
4. Python Implementation Example
Below is a simplified, functional Python script using numpy and pandas to demonstrate this logic.
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# --- CONFIGURATION ---
starting_cash = 1_000_000 # $1M starting runway
months_to_sim = 36 # Simulate 3 years
n_simulations = 10_000 # Number of paths
# --- 2. SCENARIO WEIGHTS ---
# Probability of [Recession, Base, Bull]
scenario_probs = [0.2, 0.6, 0.2]
# Adjustments to Monthly Revenue Growth Mean per scenario
scenario_growth_means = [-0.05, 0.02, 0.10]
# --- 1. DISTRIBUTIONS HELPER ---
def get_distribution_params(scenario_idx):
"""Returns the Mean and Std Dev for Revenue and OpEx based on scenario"""
# Revenue: Lognormal requires mean and sigma.
# We model monthly % change.
# Note: In numpy lognormal, the mean is of the underlying normal distribution.
# Simplified here: We use the scenario growth mean + noise.
rev_growth_mean = scenario_growth_means[scenario_idx]
rev_volatility = 0.10 # 10% standard deviation in revenue month-to-month
# OpEx: Triangular Distribution (min, mode, max)
# Base OpEx is $100k. In recession, might be lower. In bull, higher (hiring).
base_opex = 100_000
opex_mode = base_opex * (1 + scenario_idx * 0.1) # Scales up in better scenarios
return rev_growth_mean, rev_volatility, opex_mode
# --- SIMULATION ENGINE ---
results = []
for sim in range(n_simulations):
# 1. Choose Scenario based on Weights
scenario_idx = np.random.choice([0, 1, 2], p=scenario_probs)
rev_growth_mean, rev_volatility, base_opex = get_distribution_params(scenario_idx)
cash_balance = starting_cash
prev_revenue = 80_000 # Starting revenue (for month 0)
monthly_cash_flow = []
for month in range(months_to_sim):
# --- Calculate Inflows (Revenue) ---
# Random growth factor: Normal distribution clipped at -50% to prevent instant bankruptcy
growth_factor = np.random.normal(rev_growth_mean, rev_volatility)
current_revenue = max(0, prev_revenue * (1 + growth_factor))
# --- Calculate Outflows (OpEx) ---
# Simple Normal distribution for expenses
current_opex = np.random.normal(base_opex, 10_000) # 10k std dev
# --- Net Cash Flow ---
net_flow = current_revenue - current_opex
cash_balance += net_flow
# --- 3. CHECK TRIGGERS ---
# Insolvency Trigger
if cash_balance < 0:
runway_months = month
break # Company dies
prev_revenue = current_revenue
else:
# If loop completes without breaking, company survived full period
runway_months = months_to_sim
results.append({
'Scenario': scenario_idx,
'Final_Cash': max(0, cash_balance),
'Runway_Months': runway_months,
'Died': runway_months < months_to_sim
})
# --- ANALYSIS ---
df = pd.DataFrame(results)
# Calculate Probability of Survival (Runway > 24 months)
prob_survival_2yr = (df['Runway_Months'] >= 24).mean() * 100
avg_runway = df['Runway_Months'].mean()
print(f"Simulation Results ({n_simulations} runs):")
print(f"Average Runway: {avg_runway:.1f} months")
print(f"Probability of Surviving 2 Years: {prob_survival_2yr:.1f}%")
print(f"Median Final Cash Position: ${df['Final_Cash'].median():,.0f}")
# Visualization of Runway Distribution
df['Runway_Months'].hist(bins=36, grid=False)
plt.title('Distribution of Cash Runway (Months)')
plt.xlabel('Months Until $0')
plt.ylabel('Frequency')
plt.show()
Summary of Output Analysis
When you look at the histogram generated by the code above, look for these specific shapes:
- The "Wall": A large bar at the end (e.g., 36 months) indicates the probability of survival.
- The "Early Spikes": If you see a high frequency of failures at months 6-12, your burn rate is too high relative to your starting cash, regardless of the scenario.
- Fat Tails: If the distribution is wide (e.g., failures happen anywhere from month 5 to month 30), your Input Volatility (Std Dev) is the primary driver of risk, and you need to stabilize operations, not just raise more cash.