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 groupRole and rules
State variablesComma-separated identifiers such as x or S, v. Order fixes row order in Drift, Diffusion, and Initial state.
ParametersComma-separated identifiers such as mu, sigma. Valid names include lambda, gamma, kappa, beta, S, and i; declared names shadow built-in constants.
t, Tt 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 constantse 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 variablesComma-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(...).

CategorySupported names
Powers, logs, exponentialsexp, expm1, exp2, log, log1p, log2, log10, sqrt, cbrt, hypot
Trigonometric & inversesin, cos, tan, cot, sec, csc, asin, acos, atan, atan2, acot, asec, acsc, sinc
Hyperbolic & inversesinh, cosh, tanh, coth, sech, csch, asinh, acosh, atanh, acoth, asech, acsch
Piecewise smooth, rounding, signabs, min, max, floor, ceil, ceiling, sign, Mod
Special functionserf, erfc, gamma, loggamma, lowergamma, uppergamma, digamma, trigamma, polygamma, beta, zeta, dirichlet_eta, factorial

Unsupported forms and direct rewrites:

  • Conditional if ... else ... expressions and multi-branch Piecewise(...) are rejected; express conditional drifts, payoffs, or caps using max(...), min(...), or Indicator(cond) terms—for example max(x - K, 0) for a call payoff, or a * 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.

ExpressionMeaningSensitivity (∂)
Path(expr)Full path fan showing median and quantile bands over timeNo
Path(e1, e2) or Path(e1, e2, e3)Phase trajectories in 2D or 3D state spaceNo
Terminal(expr)Cross-sectional sample values at $t = T$ as a distributionNo
Terminal(e1, e2)Joint distribution of two expressions at $t = T$No
Mean(expr)Ensemble average over paths at each stepYes
Variance(expr)Ensemble variance over paths at each stepYes
Std(expr)Ensemble standard deviation over paths at each stepYes
Quantile(expr, p)Sample quantile at $p \in (0, 1)$; use Quantile(x, 0.5) for the median, as Median is not definedYes
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 trueComposable
Indicator(cond)Indicator $1_{\text{cond}}$, equal to $1$ where true and $0$ otherwiseComposable, bumped

Composition rules:

  • Wrap path functionals in Mean(...), Terminal(...), or Quantile(...) to collapse them across paths or evaluate at maturity—for example Terminal(Mean(x)) returns a scalar at $t = T$, Mean(Indicator(x > 1.2)) traces exceedance probability over time, and Terminal(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, or FirstPassageTime(...) switch automatically from pathwise automatic differentiation to common-random-number finite differences when computing ∂ Sensitivities.

Each expression class in the grammar above maps to a distinct chart or diagnostic view:

Brownian bridge path fan pinned at x₀ = 0 and pinching back onto b = 1 at t = 1 Brownian bridge path fan pinned at x₀ = 0 and pinching back onto b = 1 at t = 1
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ô ↗
2D phase trajectory of five coupled antithetic GBM pairs (X, X_a) hugging a tight hyperbolic diagonal curve 2D phase trajectory of five coupled antithetic GBM pairs (X, X_a) hugging a tight hyperbolic diagonal curve
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ô ↗
Five simulated paths of the stochastic Lorenz system projected onto the x-z plane tracing the two lobes of the attractor Five simulated paths of the stochastic Lorenz system projected onto the x-z plane tracing the two lobes of the attractor
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ô ↗
Strictly positive right-skewed lognormal terminal density under Black's model with 5% quantile at 0.00116 Strictly positive right-skewed lognormal terminal density under Black's model with 5% quantile at 0.00116
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ô ↗
2D joint density contours and 1500 sample scatter pairs of terminal CIR short rate r against bond discount factor B 2D joint density contours and 1500 sample scatter pairs of terminal CIR short rate r against bond discount factor B
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] Time evolution of simulated E[C - P] climbing steadily from 0 to 2.96 across t ∈ [0, 1]
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ô ↗
Terminal density of running maximum PathMax(x) showing half-normal distribution with mean 0.752 Terminal density of running maximum PathMax(x) showing half-normal distribution with mean 0.752
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 Conditional default hitting-time density FirstPassageTime(x < 0.7) over t ∈ [0, 1] peaking around 0.18
FirstPassageTime(cond): conditional hitting-time density across paths reaching the threshold before $T$ (omitting non-crossing paths). Open first-passage density in sItô ↗
Sharply concentrated terminal control-variate residual density centered at 0.2005 Sharply concentrated terminal control-variate residual density centered at 0.2005
Integral(expr) in payoffs: arithmetic-minus-geometric Asian control residual computed inline from Integral(x) and Integral(log(x)). Open Integral payoff in sItô ↗
Pathwise AD sensitivities of Schwartz one-factor spot expectation with multi-parameter legend Pathwise AD sensitivities of Schwartz one-factor spot expectation with multi-parameter legend
∂ Sensitivities (smooth pathwise AD): derivative curves and legend generated automatically alongside Mean, Variance, Std, and Quantile statistics. Open Schwartz sensitivities in sItô ↗
Finite-difference sensitivities of Mean(Indicator(x > k)) with common-random-numbers footer note Finite-difference sensitivities of Mean(Indicator(x > k)) with common-random-numbers footer note
∂ 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

SchemeNameGroupConvergence orderNoise structure supported
EulerEulerStrongStrong 0.5, Weak 1.0Any dimension and diffusion matrix
MilsteinMilsteinStrongStrong 1.0, Weak 1.01 noise term, or diagonal diffusion with $m = d$ and off-diagonals zero
Taylor 1.5StrongTaylor1_5StrongStrong 1.5, Weak 1.51 noise term, or diagonal diffusion
Weak EulerWeakEulerWeakWeak 1.0Any dimension and diffusion matrix
Weak Taylor 2.0WeakTaylor2_0WeakWeak 2.01 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.

Flat zero variance line at X₀ = 10^7 under float32 precision Flat zero variance line at X₀ = 10^7 under float32 precision
Precision = 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ô ↗
Linear variance curve climbing from 0 to 1.002 at X₀ = 10^7 under float64 precision Linear variance curve climbing from 0 to 1.002 at X₀ = 10^7 under float64 precision
Precision = 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.