Skip to main content

How-to guides

Estimate a simple range

This example models a best-case and worst-case scenario and calculates the range between them.

  1. Write the model — declare two uniform variables and a derived variable in the editor. For example:

    low ~ uniform(100, 200);
    high ~ uniform(300, 500);
    range = high - low;
  2. Click Run — the playground executes 1,000 simulation iterations and displays a histogram of the output variable (range) in the right pane.

  3. Read the histogram — examine the shape and spread. You should see the possible range values clustered between 100 and 400, with roughly equal probability across the middle.

Model compound growth

This example combines a fixed initial value with a random monthly growth rate to project customers after one year.

  1. Write the model — declare constants and random variables:

    initial_customers = 1000;
    monthly_growth ~ norm(0.05, 0.01);
    customers_year1 = initial_customers * (1 + monthly_growth) ** 12;
  2. Click Run — the playground simulates each month's growth rate as a random draw from the normal distribution, then compounds 12 times.

  3. Read the histogram — you should see a right-skewed distribution because compounding amplifies higher growth rates. The center should be around 1,800 customers (5% monthly growth compounded over 12 months).

Calculate probability of profit

This example models revenue and costs as random variables, then computes profit as a derived variable.

  1. Write the model — declare revenue, costs, and profit:

    revenue ~ norm(100000, 15000);
    costs ~ norm(80000, 10000);
    profit = revenue - costs;
  2. Click Run — the playground simulates revenue and costs each iteration, then computes profit.

  3. Read the histogram — examine the profit distribution. The center should be around $20,000 (mean revenue of $100k minus mean costs of $80k).

  4. Drag the Pr(x < X) line — drag the vertical line to the value 0 on the x-axis. You should see the probability that profit is negative (a loss). For example, Pr(profit < $0) = 0.13 means there is a 13% chance of a loss.