Skip to main content

Reference

Histogram output

note

The histogram shows the distribution of the last declared variable across all iterations by default. You can select a different variable from the dropdown above the chart.

tip

If you want to visualize a specific variable, declare it last in your model.

The histogram displays 1,000 sampled values (one per simulation iteration). The shape shows you the range, central tendency, and spread of possible outcomes.

You can drag the Pr(x < X) line to read off the probability that the output variable is less than any given value. This is particularly useful for questions like:

  • "What is the probability that profit is negative?" → drag to 0
  • "What is the probability that this project finishes in under 10 weeks?" → drag to 10

Error handling

Parse errors and undefined variable references show as an inline error message below the editor. The histogram clears on error so you can see that the model needs to be fixed before results appear.

Mini-language syntax

Statements are separated by ;. Each statement is either a random variable declaration or a derived variable declaration. Variable names must start with a letter and can contain letters, digits, and underscores.

x ~ norm(15, 3);
y ~ uniform(5, 10);
z = x * y;

Random variable declarationname ~ distribution(params). Each simulation iteration draws a new sample from the distribution, so the variable takes different values across iterations.

Derived variable declarationname = expression, a standard arithmetic expression. Variables are resolved in dependency order — you can reference a variable before declaring it.

OperatorMeaningExample
+Additiona + b
-Subtractiona - b
*Multiplicationa * b
/Divisiona / b
**Powera ** b

Comments — lines starting with # are ignored:

# Revenue model
revenue ~ norm(50000, 8000);

Supported distributions

DistributionSyntaxDescription
Normalnorm(mean, std) or normal(mean, std)Symmetric bell-curve. Good for many natural phenomena.
Uniformuniform(low, high) or unif(low, high)Every value in the range is equally likely.
Triangulartriangular(low, mode, high) or tri(low, mode, high)Three-point estimate with a most-likely value.
Lognormallognormal(mean, sigma) or lognorm(mean, sigma)Right-skewed, always positive. Good for costs and time.
Exponentialexponential(rate) or expon(rate)Memoryless waiting times.
Gammagamma(shape, scale)Flexible positive-value distribution.
Betabeta(alpha, beta)Bounded between 0 and 1. Good for probabilities.
Poissonpoisson(rate)Discrete count data.
Binomialbinom(n, p)Number of successes in n independent trials.
Integersintegers(low, high)Uniform random whole number within a range.
Negative Binomialnegbinom(n, p)Number of trials until n successes.
Choicechoice([a, b, c])Picks one value from a list, equally likely.

For detailed parameters and usage notes for each distribution, see Distribution parameters below.

Distribution parameters

normal / norm

x ~ norm(mean, std)
# or
x ~ normal(mean, std)
ParameterDescription
meanCenter of the distribution
stdStandard deviation (spread)

Example: revenue ~ norm(50000, 8000) — revenue centered around $50k with std of $8k.

uniform / unif

x ~ uniform(low, high)
# or
x ~ unif(low, high)
ParameterDescription
lowMinimum value
highMaximum value

Example: growth ~ uniform(0.02, 0.08) — growth rate uniformly between 2% and 8%.

triangular / tri

A three-point estimate — useful when you know a minimum, most likely, and maximum value.

x ~ triangular(low, mode, high)
# or
x ~ tri(low, mode, high)
ParameterDescription
lowMinimum value
modeMost likely value
highMaximum value

Example: project_weeks ~ tri(4, 6, 12) — project takes 4–12 weeks, most likely 6.

lognormal / lognorm

Right-skewed, always positive. Use for modeling costs, time, or quantities that can't be negative.

x ~ lognormal(mean, sigma)
# or
x ~ lognorm(mean, sigma)
ParameterDescription
meanMean of the underlying normal distribution (in log space)
sigmaStandard deviation in log space

exponential / expon

Memoryless. Use for modeling waiting times.

x ~ exponential(rate)
# or
x ~ expon(rate)
ParameterDescription
rateRate parameter (mean = 1/rate)

gamma

A flexible positive-value distribution that generalizes the exponential.

x ~ gamma(shape, scale)
ParameterDescription
shapeShape parameter (k)
scaleScale parameter (θ)

beta

Bounded between 0 and 1. Use for modeling probabilities, fractions, or proportions.

x ~ beta(alpha, beta)
ParameterDescription
alphaShape parameter α (> 0)
betaShape parameter β (> 0)

Example: conversion_rate ~ beta(2, 8) — conversion rate with most probability mass around 20%.

poisson

Discrete count data.

x ~ poisson(rate)
ParameterDescription
rateExpected number of events (λ)

Example: daily_signups ~ poisson(15) — average 15 signups per day.

Operator precedence

Expressions follow standard arithmetic precedence:

PrecedenceOperatorsAssociativity
1 (highest)**Right-to-left
2*, /Left-to-right
3 (lowest)+, -Left-to-right

You can use parentheses ( and ) to override precedence.

Supported functions

These built-in functions are available in expressions:

FunctionDescriptionExample
abs(x)Absolute valueabs(profit)
sqrt(x)Square rootsqrt(variance)
log(x)Natural logarithmlog(odds)
exp(x)Exponential (e^x)exp(growth_rate)
min(a, b)Minimum of two valuesmin(revenue, budget)
max(a, b)Maximum of two valuesmax(profit, 0)