Docs / nablatensor-quant / com.nablatensor.quant
final class
Hooks
Variance-reduction hooks that live entirely in the recorded payoff (Seam 4): they wrap a PathPayoff — a payoff written against an explicit Draws source — and re-record it with a transformed draw stream. No engine change; the adjoint flows through the wrapped graph as usual.
The result is a Product, so it drops straight into MonteCarlo.
Methods
Antithetic pairing: records the payoff twice on the same tape, once with the draw stream z and once with -z, and averages. Unbiased; reduces variance for payoffs with an odd component in z.
Control variate: Y* = Y - beta (X - E[X]), with the control X driven by the same draws as the target Y. Unbiased for any beta; beta = 1 with a well-correlated control is the usual choice. The control must not consume more draws per step than the target.
Importance sampling: draw z ~ N(0,1), feed the payoff the drifted stream z + muPerStep, and multiply by the per-path likelihood ratio exp(-muPerStep * sum z - 0.5 muPerStep^2 n). Unbiased for any muPerStep; a positive shift concentrates paths where an out-of-the-money payoff pays.
Path filter: computes E[payoff * 1{condition > 0}] with the indicator smoothed at width. The condition is a second payoff over the same draws whose sign selects the paths to keep. Note this is E[f * 1{...}], not the conditional expectation E[f | ...].