Mini-language syntax
Statements are separated by newlines (semicolons also accepted). Each statement is a random variable declaration or a derived variable declaration. Variable names may contain letters, digits, underscores, and internal spaces (e.g. hrs per phase).
revenue ~ norm(100000, 15000)
costs ~ norm(80000, 10000)
profit = revenue - costs
Random variable declaration — name ~ distribution(params). Each simulation iteration draws a new sample from the distribution.
Derived variable declaration — name = expression. Standard arithmetic; variables resolve in dependency order regardless of declaration order.
Comments — lines starting with # are ignored:
# Revenue model
revenue ~ norm(50000, 8000)
Operators
| Operator | Meaning | Example |
|---|
+ | Addition | a + b |
- | Subtraction | a - b |
* | Multiplication | a * b |
/ | Division | a / b |
** | Power | a ** b |
Precedence (highest first): ** (right-to-left) → *, / (left-to-right) → +, - (left-to-right). Use parentheses to override.
Built-in functions
| Function | Description |
|---|
abs(x) | Absolute value |
sqrt(x) | Square root |
log(x) | Natural logarithm |
exp(x) | Exponential (e^x) |
min(a, b) | Minimum of two values |
max(a, b) | Maximum of two values |
Supported distributions
| Distribution | Syntax | Description |
|---|
| Normal | norm(mean, std) or normal(mean, std) | Symmetric bell curve |
| Uniform | uniform(low, high) or unif(low, high) | Every value equally likely |
| Triangular | triangular(low, mode, high) or tri(low, mode, high) | Three-point estimate |
| Lognormal | lognormal(mean, sigma) or lognorm(mean, sigma) | Right-skewed, always positive |
| Exponential | exponential(rate) or expon(rate) | Memoryless waiting times |
| Gamma | gamma(shape, scale) | Flexible positive-value distribution |
| Beta | beta(alpha, beta) | Bounded 0–1; good for probabilities |
| Poisson | poisson(rate) | Discrete count data |
| Binomial | binom(n, p) | Successes in n independent trials |
| Integers | integers(low, high) | Uniform random whole number in range |
| Negative Binomial | negbinom(n, p) | Trials until n successes |
| Choice | choice([a, b, c]) | Picks one value from a list equally |
| Weibull | weibull(scale, shape) | Wear-out or reliability modeling (spreadsheet engine) |
| Constant | constant(value) | Fixed value — effectively a pinned input (spreadsheet engine) |
Distribution parameters
normal / norm
| Parameter | Description |
|---|
mean | Center of the distribution |
std | Standard deviation (spread) |
| Parameter | Description |
|---|
low | Minimum value |
high | Maximum value |
triangular / tri
| Parameter | Description |
|---|
low | Minimum value |
mode | Most likely value |
high | Maximum value |
lognormal / lognorm
| Parameter | Description |
|---|
mean | Mean of the underlying normal distribution (in log space) |
sigma | Standard deviation in log space |
exponential / expon
| Parameter | Description |
|---|
rate | Rate parameter (mean = 1/rate) |
gamma
| Parameter | Description |
|---|
shape | Shape parameter (k) |
scale | Scale parameter (θ) |
beta
| Parameter | Description |
|---|
alpha | Shape parameter α (> 0) |
beta | Shape parameter β (> 0) |
poisson
| Parameter | Description |
|---|
rate | Expected number of events (λ) |
binom
| Parameter | Description |
|---|
n | Number of trials |
p | Probability of success per trial |
negbinom
| Parameter | Description |
|---|
n | Target number of successes |
p | Probability of success per trial |
integers
| Parameter | Description |
|---|
low | Minimum integer (inclusive) |
high | Maximum integer (inclusive) |
choice
| Parameter | Description |
|---|
[a, b, c] | List of numeric values; one is picked uniformly each iteration |
Output metric types
Configured per output variable in the author view.
| Kind | Description | Extra fields |
|---|
mean | Arithmetic mean across iterations | — |
median | 50th percentile | — |
percentile | Arbitrary percentile | p (0–100) |
probability | Fraction of iterations satisfying a threshold | op (<, <=, >, >=), value |
std | Standard deviation | — |
min | Minimum sampled value | — |
max | Maximum sampled value | — |
Default metric set when none are configured: mean, P25, P75.
| Format | Display |
|---|
number | Plain number (default) |
currency | Dollar-prefixed |
percent | Percentage |
duration | Human-readable duration |
| Kind | Runner control | Fields |
|---|
number | Numeric text field | default, optional test_value |
choice | Radio buttons | choices (label + value pairs), default (option label), optional test_value |
distribution | Family-locked distribution control | family, param_ui, default (parameter set) |
test_value is author-only — it drives the editor's live preview and is never written to saved runs.
Distribution param_ui values
Controls the runner-facing interface for distribution user inputs.
param_ui | Runner controls | Supported families |
|---|
raw | The distribution's native parameters | All |
min-mode-max | Min, mode, max number inputs | triangular only |
low-high-conf | Low bound, high bound, confidence percent | norm only |
presets | Author-defined preset chips | All (each preset maps to a full parameter set) |
Spreadsheet engine
Supported workbook features
| Feature | Support |
|---|
.xlsx files | Supported |
| Multiple sheets | Supported — switch via sheet tabs |
| Cell formulas | Rendered read-only via IronCalc |
.xls (legacy) | Not supported — save as .xlsx first |
| Macros / VBA | Not executed |
Assumption fields
| Field | Description |
|---|
| Name | Label shown in the sidebar and runs table |
| Sheet | Sheet name containing the target cell |
| Cell | Single cell reference (e.g. B4) |
| Distribution | Probability distribution used for sampling |
| Parameters | Distribution-specific parameter values |
| Origin | assumption (sampled each iteration) or user_input (bound once per run) |
Simulation parameters
| Parameter | Default | Range |
|---|
| Rep count | 1,000 | 1–10,000 |
| Job timeout | 60 s | Fixed |
Output types
| Output | Result display |
|---|
| Single cell | Histogram of scalar values across all replications |
| Cell range | One histogram per cell in the range |
Percentile table
| Percentile | Meaning |
|---|
| P5 | 5% of replications produced a value below this |
| P25 | Lower quartile |
| P50 | Median |
| P75 | Upper quartile |
| P95 | 95% of replications produced a value below this |
REST endpoints
| Method | Path | Description |
|---|
GET | /api/estimator/ | List your estimators |
POST | /api/estimator/ | Create an estimator |
GET | /api/estimator/<id>/ | Retrieve an estimator |
PUT | /api/estimator/<id>/ | Update an estimator |
DELETE | /api/estimator/<id>/ | Delete (blocked if template has runs) |
POST | /api/estimator/<id>/run/ | Run with given bindings |
POST | /api/estimator/run-adhoc/ | Run any model without persisting |
GET | /api/estimator/<id>/runs/ | List runs of a template |
POST | /api/estimator/<id>/runs/ | Create a run |
GET | /api/estimator/runs/<run_id>/ | Retrieve a run |
PUT | /api/estimator/runs/<run_id>/ | Update a run |
DELETE | /api/estimator/runs/<run_id>/ | Delete a run |
GET | /api/estimator/<id>/runs.csv | CSV export of a template's runs |
POST | /api/estimator/<id>/share/ | Generate or revoke a template share token |
POST | /api/estimator/runs/<run_id>/share/ | Generate or revoke a run share token |
GET | /api/estimator/shared/<token>/ | Public template view |
GET | /api/estimator/runs/shared/<token>/ | Public run view |
/api/estimator/run-adhoc/ and /api/estimator/shared/* are unauthenticated. All other endpoints require authentication and ownership. Running a spreadsheet-engine estimator requires Pro (403 {"error": "pro_required"} otherwise).
Legacy redirects
Browser bookmarks to the old Probability Playground and Spreadsheet Sim URLs redirect permanently:
| Old path | Redirects to |
|---|
/playground/ | /estimator/ |
/app/playground/ | /app/estimator/ |
/app/playground/<id>/ | /app/estimator/<id>/ |
/playground/shared/<token>/ | /app/estimator/shared/<token>/ |
/spreadsheet-sim/ | /estimator/ |
/app/spreadsheet-sim/ | /app/estimator/ |
Simulation request and response
POST /api/estimator/<id>/run/
Request
{
"bindings": {
"n_phases": 4,
"complexity": 1.5,
"close_prob": {"family": "beta", "params": {"a": 2.5, "b": 3.0}}
},
"nreps": 1000,
"seed": null
}
- Scalar bindings become
name = value prepended to the model.
- Distribution bindings become
name ~ family(params) prepended.
- Bindings for identifiers not in the model are rejected.
- Missing required bindings use the parameter default.
Response (formula engine — synchronous)
{
"variables": ["hrs_per_phase", "rate_per_phase", "total"],
"samples": {
"hrs_per_phase": [22.1, 18.4, "..."],
"total": [66300, 55200, "..."]
},
"metrics": {
"total": {
"mean": 68000,
"p10": 54000,
"p90": 84000,
"pr_gt_75000": 0.34
}
}
}
Spreadsheet-engine requests return 202 {"job_id": "..."} immediately; poll GET /api/jobs/<job_id>/ until status == "complete", then read the same shape from job.result_json.