martingale_step

std.stats.martingale_step · Level L1

One time step of a martingale check on a finite probability space: on each block of the partition F_t, E[X_{t+1} | F_t] − X_t (0 on a zero-mass block, which is determined only almost surely), and whether X_t is constant on the blocks of F_t (adapted). The body martingale_check scans.

E[X_{t+1} | F_t] − X_t

Signature

martingale_step(adapted: f64[], gap: f64[n], a: f64[n], xt: f64[n], xn: f64[n], p: f64[n]) → f64[], f64[n]

Structure

The function as NOVA stores it: one box per input, operation and output, and arrows that carry values. A double border marks another library function this one runs — called once, or by Scan once per element; select it to open that function.

adaptedf64[]gapf64[n]xtf64[n]af64[n]pf64[n]xnf64[n]ReshapexrReshapexcReshapeacReshapearReshapeprReshapenrEqualeqxEqualsameGreatersplitMultiplywReduceMaxbad1.0ReduceSummassMultiplywx0.0SubtractgoodReduceSumnumEqualemptyMultiplyadapted2AddsafeSubtractliveDivideceSubtractdgapMultiplygap2adapted2f64[]gap2f64[n]
  • input
  • operation
  • constant
  • call
  • output

Verification

  • Signature proven by NOVA’s shape solver, for every size.
  • Equal to the reference block masses and block means of X_{t+1}, in exact arithmetic in exact rational arithmetic, on all 40 test cases.
  • All 193 float64 results inside the running error bound; the closest uses 30% of it.
  • Interpreter and NumPy backend return bit-identical results.
  • At float32 too: the 40 test cases rounded to float32, and 40 of them inside the running error bound at u = 2⁻²⁴; the closest uses 41% of it.
Accuracy in detail
correctly rounded (the float64 nearest the exact value)
87%
bit-equal to the NumPy formula in float64
100%
largest error, in units in the last place
11

Large ulp counts appear where a result is tiny next to the numbers it is computed from (after cancellation, for example), so one unit in the last place is tiny too; the absolute error is still inside the bound. Results within their own error of zero are not counted.

Identity

Calls
—
Called by
sha256:746c42be288c72103efea63d001dd1e044a80e8566e75a4c648bdb425b526dcb

The semantic hash of the graph. It changes when the program changes, and never when only its documentation does.

Control handle

Symbol
Ω:std.stats.martingale_step · Ω:martingale_step
Pins
sha256:49f191b88862c63dac0ba5c2f39cbc38ed3d36ba2d6560053583b7b557a3a41athis graph alone
Evidence
sha256:e0c8a53115d4edd9e8245724db59f58f23f237e082d46fe3262f6f4ba1f4a64bthe hash of its verification record
Needs
no capability: a pure function

Through NOVA’s control layer, the symbol launches this function only while the program still matches what it pins: a change to this graph, or to any graph it reaches, needs a migration first.

ΣEML 2026

Efficient New Language — a high-density semantic overlay for humans and AI agents.

This site’s demos run on the real EML toolchain, in your browser.

© 2026 EveMissLab (一言諾科技有限公司) / Neo.K. All rights reserved.