Skip to main content

Reference

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​

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

Precedence (highest first): ** (right-to-left) → *, / (left-to-right) → +, - (left-to-right). Use parentheses to override.

Built-in functions​

FunctionDescription
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​

DistributionSyntaxDescription
Normalnorm(mean, std) or normal(mean, std)Symmetric bell curve
Uniformuniform(low, high) or unif(low, high)Every value equally likely
Triangulartriangular(low, mode, high) or tri(low, mode, high)Three-point estimate
Lognormallognormal(mean, sigma) or lognorm(mean, sigma)Right-skewed, always positive
Exponentialexponential(rate) or expon(rate)Memoryless waiting times
Gammagamma(shape, scale)Flexible positive-value distribution
Betabeta(alpha, beta)Bounded 0–1; good for probabilities
Poissonpoisson(rate)Discrete count data
Binomialbinom(n, p)Successes in n independent trials
Integersintegers(low, high)Uniform random whole number in range
Negative Binomialnegbinom(n, p)Trials until n successes
Choicechoice([a, b, c])Picks one value from a list equally
Weibullweibull(scale, shape)Wear-out or reliability modeling (spreadsheet engine)
Constantconstant(value)Fixed value — effectively a pinned input (spreadsheet engine)

Distribution parameters​

normal / norm​

ParameterDescription
meanCenter of the distribution
stdStandard deviation (spread)

uniform / unif​

ParameterDescription
lowMinimum value
highMaximum value

triangular / tri​

ParameterDescription
lowMinimum value
modeMost likely value
highMaximum value

lognormal / lognorm​

ParameterDescription
meanMean of the underlying normal distribution (in log space)
sigmaStandard deviation in log space

exponential / expon​

ParameterDescription
rateRate parameter (mean = 1/rate)

gamma​

ParameterDescription
shapeShape parameter (k)
scaleScale parameter (θ)

beta​

ParameterDescription
alphaShape parameter α (> 0)
betaShape parameter β (> 0)

poisson​

ParameterDescription
rateExpected number of events (λ)

binom​

ParameterDescription
nNumber of trials
pProbability of success per trial

negbinom​

ParameterDescription
nTarget number of successes
pProbability of success per trial

integers​

ParameterDescription
lowMinimum integer (inclusive)
highMaximum integer (inclusive)

choice​

ParameterDescription
[a, b, c]List of numeric values; one is picked uniformly each iteration

Output metric types​

Configured per output variable in the author view.

KindDescriptionExtra fields
meanArithmetic mean across iterations—
median50th percentile—
percentileArbitrary percentilep (0–100)
probabilityFraction of iterations satisfying a thresholdop (<, <=, >, >=), value
stdStandard deviation—
minMinimum sampled value—
maxMaximum sampled value—

Default metric set when none are configured: mean, P25, P75.

Output format types​

FormatDisplay
numberPlain number (default)
currencyDollar-prefixed
percentPercentage
durationHuman-readable duration

User input types (parameters manifest)​

KindRunner controlFields
numberNumeric text fielddefault, optional test_value
choiceRadio buttonschoices (label + value pairs), default (option label), optional test_value
distributionFamily-locked distribution controlfamily, 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_uiRunner controlsSupported families
rawThe distribution's native parametersAll
min-mode-maxMin, mode, max number inputstriangular only
low-high-confLow bound, high bound, confidence percentnorm only
presetsAuthor-defined preset chipsAll (each preset maps to a full parameter set)

Spreadsheet engine​

Supported workbook features​

FeatureSupport
.xlsx filesSupported
Multiple sheetsSupported — switch via sheet tabs
Cell formulasRendered read-only via IronCalc
.xls (legacy)Not supported — save as .xlsx first
Macros / VBANot executed

Assumption fields​

FieldDescription
NameLabel shown in the sidebar and runs table
SheetSheet name containing the target cell
CellSingle cell reference (e.g. B4)
DistributionProbability distribution used for sampling
ParametersDistribution-specific parameter values
Originassumption (sampled each iteration) or user_input (bound once per run)

Simulation parameters​

ParameterDefaultRange
Rep count1,0001–10,000
Job timeout60 sFixed

Output types​

OutputResult display
Single cellHistogram of scalar values across all replications
Cell rangeOne histogram per cell in the range

Percentile table​

PercentileMeaning
P55% of replications produced a value below this
P25Lower quartile
P50Median
P75Upper quartile
P9595% of replications produced a value below this

REST endpoints​

MethodPathDescription
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.csvCSV 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 pathRedirects 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.