This document specifies the input syntax, mathematical primitives, statistics grammar, discretization applicability, and link sharing of sItô. For a workflow walkthrough from equations to outputs, see Using sItô.
Identifiers, constants, and typesetting
Every name appearing in Drift, Diffusion, $Y = f(t, X)$, or What to compute must be declared in State variables or Parameters, match one of the time symbols, or name a built-in constant or function.
| Symbol or group | Role and rules |
|---|---|
| State variables | Comma-separated identifiers such as x or S, v. Order fixes row order in Drift, Diffusion, and Initial state. |
| Parameters | Comma-separated identifiers such as mu, sigma. Valid names include lambda, gamma, kappa, beta, S, and i; declared names shadow built-in constants. |
t, T | t tracks simulation time over $t \in [0, T]$, while T is the terminal horizon from Monte Carlo → Settings. Both can appear in drifts, diffusions, transformations, and statistics. |
| Built-in constants | e and E for Euler’s number, pi for $\pi$, I for the imaginary unit, oo for $\infty$, zoo for complex infinity, nan, EulerGamma, Catalan, and GoldenRatio. |
| Transform variables | Comma-separated names under Define, such as y, distinct from all state variables and parameters. |
Unknown names in Drift, Diffusion, or $Y = f(t, X)$ are rejected before running. Common Greek spellings such as alpha, beta, gamma, kappa, lambda, mu, nu, rho, sigma, theta, xi, omega, phi, and psi, together with underscore subscripts such as x_0 and sigma_1, render as typeset math like $x_0$ and $\sigma_1$ in the equation preview.
Operators, comparisons, and functions
Arithmetic uses +, -, *, /, and ^ or ** for exponentiation. Multiplication must always be explicit: write 2 * x, never 2x. Vector and matrix inputs separate entries as follows:
- Drift: one expression per line, matching the order of State variables.
- Diffusion: rows separated by
;or newlines, and columns for independent Brownian motions separated by,. Trailing empty separators are ignored. - Transformations for $Y = f(t, X)$: one expression per line, matching the names in Define.
Comparisons <, <=, >, >=, ==, != and boolean combinators And, Or, Not work inside conditions for Indicator(...) and FirstPassageTime(...).
| Category | Supported names |
|---|---|
| Powers, logs, exponentials | exp, expm1, exp2, log, log1p, log2, log10, sqrt, cbrt, hypot |
| Trigonometric & inverse | sin, cos, tan, cot, sec, csc, asin, acos, atan, atan2, acot, asec, acsc, sinc |
| Hyperbolic & inverse | sinh, cosh, tanh, coth, sech, csch, asinh, acosh, atanh, acoth, asech, acsch |
| Piecewise smooth, rounding, sign | abs, min, max, floor, ceil, ceiling, sign, Mod |
| Special functions | erf, erfc, gamma, loggamma, lowergamma, uppergamma, digamma, trigamma, polygamma, beta, zeta, dirichlet_eta, factorial |
Unsupported forms and direct rewrites:
- Conditional
if ... else ...expressions and multi-branchPiecewise(...)are rejected; express conditional drifts, payoffs, or caps usingmax(...),min(...), orIndicator(cond)terms—for examplemax(x - K, 0)for a call payoff, ora * Indicator(cond) + b * (1 - Indicator(cond))inside statistics. Indicator(...)cannot appear inside $Y = f(t, X)$ because Itô’s lemma differentiates transformations symbolically; keep discontinuous tests in What to compute.
Statistics and path functionals
What to compute accepts one expression per line up to the demo’s line cap, referencing any state variable, transformed variable, parameter, t, or T.
| Expression | Meaning | Sensitivity (∂) |
|---|---|---|
Path(expr) | Full path fan showing median and quantile bands over time | No |
Path(e1, e2) or Path(e1, e2, e3) | Phase trajectories in 2D or 3D state space | No |
Terminal(expr) | Cross-sectional sample values at $t = T$ as a distribution | No |
Terminal(e1, e2) | Joint distribution of two expressions at $t = T$ | No |
Mean(expr) | Ensemble average over paths at each step | Yes |
Variance(expr) | Ensemble variance over paths at each step | Yes |
Std(expr) | Ensemble standard deviation over paths at each step | Yes |
Quantile(expr, p) | Sample quantile at $p \in (0, 1)$; use Quantile(x, 0.5) for the median, as Median is not defined | Yes |
PathMax(expr) | Running pathwise maximum $\max_{0 \le s \le t} \text{expr}_s$ | Composable |
PathMin(expr) | Running pathwise minimum $\min_{0 \le s \le t} \text{expr}_s$ | Composable |
Integral(expr) | Pathwise time integral $\int_0^t \text{expr}_s\,ds$ | Composable |
FirstPassageTime(cond) | First grid time $t \in [0, T]$ where cond becomes true | Composable |
Indicator(cond) | Indicator $1_{\text{cond}}$, equal to $1$ where true and $0$ otherwise | Composable, bumped |
Composition rules:
- Wrap path functionals in
Mean(...),Terminal(...), orQuantile(...)to collapse them across paths or evaluate at maturity—for exampleTerminal(Mean(x))returns a scalar at $t = T$,Mean(Indicator(x > 1.2))traces exceedance probability over time, andTerminal(max(Integral(x)/T - K, 0))prices a discretely averaged Asian call. - Any statistic marked Yes produces a ∂ Sensitivities tab alongside Value for every initial state and parameter. Expressions containing
Indicator(...), comparison operators,floor/ceil, orFirstPassageTime(...)switch automatically from pathwise automatic differentiation to common-random-number finite differences when computing ∂ Sensitivities.
Visual gallery of statistics and functionals
Each expression class in the grammar above maps to a distinct chart or diagnostic view:

Path(expr) (1D fan): empirical path density heatmap with mean, median, and $5\% / 95\%$ bands for a Brownian bridge pinned from $0$ to $1$. Open bridge fan in sItô ↗

Path(e1, e2) (2D phase portrait): five antithetic GBM pairs $(X_t, X_{a,t})$ traced finely in trajectory mode along $X_t X_{a,t} \approx S_0^2 e^{(2r-\sigma^2)t}$. Open 2D trajectory in sItô ↗

Path(e1, e2, e3) (3D trajectory run): five 4,000-step Lorenz trajectories rendered as $x$–$z$ projections alongside pairwise and time tabs. Open 3D Lorenz run in sItô ↗

Terminal(expr) (1D density): cross-sectional distribution at $t = T$ with vertical summary markers for mean, median, and $5\% / 95\%$ quantiles. Open terminal density in sItô ↗

Terminal(e1, e2) (2D joint law): final-time scatter cloud ($1{,}500$ pairs) with $50\%$, $80\%$, and $95\%$ contour loops and sample mean cross. Open joint terminal plot in sItô ↗
![Time evolution of simulated E[C - P] climbing steadily from 0 to 2.96 across t ∈ [0, 1]](/images/sito-notes/parity-right-dark.webp)
Mean(expr) (Value tab): ensemble statistic evaluated at every grid time $t \in [0, T]$ (here discounted put–call difference matching forward carry). Open Value curve in sItô ↗

PathMax(expr) (Terminal(PathMax(x))): half-normal distribution of the Brownian running maximum accumulated pathwise without auxiliary state equations. Open PathMax distribution in sItô ↗
![Conditional default hitting-time density FirstPassageTime(x < 0.7) over t ∈ [0, 1] peaking around 0.18](/images/sito-notes/default-time-dark.webp)
FirstPassageTime(cond): conditional hitting-time density across paths reaching the threshold before $T$ (omitting non-crossing paths). Open first-passage density in sItô ↗

Integral(expr) in payoffs: arithmetic-minus-geometric Asian control residual computed inline from Integral(x) and Integral(log(x)). Open Integral payoff in sItô ↗

∂ Sensitivities (smooth pathwise AD): derivative curves and legend generated automatically alongside Mean, Variance, Std, and Quantile statistics. Open Schwartz sensitivities in sItô ↗

∂ Sensitivities (CRN finite-difference fallback): Indicator, comparison, rounding, and hitting-time expressions replace pathwise AD with central parameter bumping under common random numbers. Open digital fallback in sItô ↗Discretization schemes and demo restrictions
| Scheme | Name | Group | Convergence order | Noise structure supported |
|---|---|---|---|---|
| Euler | Euler | Strong | Strong 0.5, Weak 1.0 | Any dimension and diffusion matrix |
| Milstein | Milstein | Strong | Strong 1.0, Weak 1.0 | 1 noise term, or diagonal diffusion with $m = d$ and off-diagonals zero |
| Taylor 1.5 | StrongTaylor1_5 | Strong | Strong 1.5, Weak 1.5 | 1 noise term, or diagonal diffusion |
| Weak Euler | WeakEuler | Weak | Weak 1.0 | Any dimension and diffusion matrix |
| Weak Taylor 2.0 | WeakTaylor2_0 | Weak | Weak 2.0 | 1 noise term, or diagonal diffusion with $m = d$ and off-diagonals zero |
Precision and hardware: float64 is the default double-precision backend; float32 cuts arithmetic precision in exchange for speed. Hardware selects CPU or GPU depending on server availability. Measured speed tradeoffs across precisions, schemes, and backends are documented in CPU and GPU simulation performance, and sensitivity overhead in sensitivity performance benchmarks.
Demo limits: The hosted instance at sItô enforces caps on problem dimensions, formula size, grid products, execution time, and request rate; slider stops outside those bounds display a lock icon, and active thresholds are listed in the Demo limits dialog on the app itself. When every statistics line is a 2- or 3-argument Path(...), the grid switches automatically to a fine trajectory run showing a handful of paths without derivatives.

float32 at large offsets ($X_0 = 10^7$): single-precision increments round to zero against $X_0$, pinning $\operatorname{Var}(X_t) \equiv 0$. Open float32 case in sItô ↗

float64 (default): double precision preserves unit steps around $10^7$ and recovers exact linear variance $\operatorname{Var}(X_t) = t$. Open float64 case in sItô ↗Sharing
Clicking Share after a result renders encodes the current form inputs into a portable URL. No simulation results are stored on the server for shared links; opening a shared link repopulates the form and triggers a fresh run.