Reference
Histogram output
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.
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 declaration — name ~ distribution(params). Each simulation iteration draws a new sample from the distribution, so the variable takes different values across iterations.
Derived variable declaration — name = expression, a standard arithmetic expression. Variables are resolved in dependency order — you can reference a variable before declaring it.
| Operator | Meaning | Example |
|---|---|---|
+ | Addition | a + b |
- | Subtraction | a - b |
* | Multiplication | a * b |
/ | Division | a / b |
** | Power | a ** b |
Comments — lines starting with # are ignored:
# Revenue model
revenue ~ norm(50000, 8000);
Supported distributions
| Distribution | Syntax | Description |
|---|---|---|
| Normal | norm(mean, std) or normal(mean, std) | Symmetric bell-curve. Good for many natural phenomena. |
| Uniform | uniform(low, high) or unif(low, high) | Every value in the range is equally likely. |
| Triangular | triangular(low, mode, high) or tri(low, mode, high) | Three-point estimate with a most-likely value. |
| Lognormal | lognormal(mean, sigma) or lognorm(mean, sigma) | Right-skewed, always positive. Good for costs and time. |
| Exponential | exponential(rate) or expon(rate) | Memoryless waiting times. |
| Gamma | gamma(shape, scale) | Flexible positive-value distribution. |
| Beta | beta(alpha, beta) | Bounded between 0 and 1. Good for probabilities. |
| Poisson | poisson(rate) | Discrete count data. |
| Binomial | binom(n, p) | Number of successes in n independent trials. |
| Integers | integers(low, high) | Uniform random whole number within a range. |
| Negative Binomial | negbinom(n, p) | Number of trials until n successes. |
| Choice | choice([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)
| Parameter | Description |
|---|---|
mean | Center of the distribution |
std | Standard 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)
| Parameter | Description |
|---|---|
low | Minimum value |
high | Maximum 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)
| Parameter | Description |
|---|---|
low | Minimum value |
mode | Most likely value |
high | Maximum 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)
| Parameter | Description |
|---|---|
mean | Mean of the underlying normal distribution (in log space) |
sigma | Standard deviation in log space |
exponential / expon
Memoryless. Use for modeling waiting times.
x ~ exponential(rate)
# or
x ~ expon(rate)
| Parameter | Description |
|---|---|
rate | Rate parameter (mean = 1/rate) |
gamma
A flexible positive-value distribution that generalizes the exponential.
x ~ gamma(shape, scale)
| Parameter | Description |
|---|---|
shape | Shape parameter (k) |
scale | Scale parameter (θ) |
beta
Bounded between 0 and 1. Use for modeling probabilities, fractions, or proportions.
x ~ beta(alpha, beta)
| Parameter | Description |
|---|---|
alpha | Shape parameter α (> 0) |
beta | Shape parameter β (> 0) |
Example: conversion_rate ~ beta(2, 8) — conversion rate with most probability mass around 20%.
poisson
Discrete count data.
x ~ poisson(rate)
| Parameter | Description |
|---|---|
rate | Expected number of events (λ) |
Example: daily_signups ~ poisson(15) — average 15 signups per day.
Operator precedence
Expressions follow standard arithmetic precedence:
| Precedence | Operators | Associativity |
|---|---|---|
| 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:
| Function | Description | Example |
|---|---|---|
abs(x) | Absolute value | abs(profit) |
sqrt(x) | Square root | sqrt(variance) |
log(x) | Natural logarithm | log(odds) |
exp(x) | Exponential (e^x) | exp(growth_rate) |
min(a, b) | Minimum of two values | min(revenue, budget) |
max(a, b) | Maximum of two values | max(profit, 0) |